From 9e0f255fe3430015264355ad70eafe55a40b0f56 Mon Sep 17 00:00:00 2001 From: Jonathon Anderson Date: Wed, 4 Sep 2024 16:46:28 -0600 Subject: [PATCH] Use wwctl container import --password by default Retains support for --passwd as a hidden flag targeting the same variable. Signed-off-by: Jonathon Anderson --- internal/app/wwctl/container/imprt/root.go | 2 ++ userdocs/contents/containers.rst | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/app/wwctl/container/imprt/root.go b/internal/app/wwctl/container/imprt/root.go index 73c7f648..7bf42a78 100644 --- a/internal/app/wwctl/container/imprt/root.go +++ b/internal/app/wwctl/container/imprt/root.go @@ -47,7 +47,9 @@ func init() { baseCmd.PersistentFlags().BoolVar(&SyncUser, "syncuser", false, "Synchronize UIDs/GIDs from host to container") baseCmd.PersistentFlags().BoolVar(&OciNoHttps, "nohttps", false, "Ignore wrong TLS certificates, superseedes env WAREWULF_OCI_NOHTTPS") baseCmd.PersistentFlags().StringVar(&OciUsername, "username", "", "Set username for the access to the registry, superseedes env WAREWULF_OCI_USERNAME") + baseCmd.PersistentFlags().StringVar(&OciPassword, "password", "", "Set password for the access to the registry, superseedes env WAREWULF_OCI_PASSWORD") baseCmd.PersistentFlags().StringVar(&OciPassword, "passwd", "", "Set password for the access to the registry, superseedes env WAREWULF_OCI_PASSWORD") + _ = baseCmd.PersistentFlags().MarkHidden("passwd") } // GetRootCommand returns the root cobra.Command for the application. diff --git a/userdocs/contents/containers.rst b/userdocs/contents/containers.rst index 6911a3a2..2e84921f 100644 --- a/userdocs/contents/containers.rst +++ b/userdocs/contents/containers.rst @@ -91,10 +91,10 @@ Here are the environmental variables that can be used. WAREWULF_OCI_PASSWORD WAREWULF_OCI_NOHTTPS -They can be overwritten with ``--nohttps``, ``--username`` and ``--passwd``. +They can be overwritten with ``--nohttps``, ``--username`` and ``--password``. .. code-block:: console - # wwctl import --username tux --passwd supersecret docker://ghcr.io/privatereg/rocky:8 + # wwctl import --username tux --password supersecret docker://ghcr.io/privatereg/rocky:8 The above is just an example. Consideration should be done before doing it this way if you are in a security sensitive environment or