Skip to content

Commit fd4ec90

Browse files
committed
feat: unhide username/password/token flags for all builders
Since PR knative#3298 fixed these credentials to work with all builders (host, pack, s2i), there's no reason to keep them hidden anymore. Also added environment variable hints to flag descriptions.
1 parent f8dd264 commit fd4ec90

2 files changed

Lines changed: 6 additions & 20 deletions

File tree

cmd/build.go

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -123,20 +123,13 @@ EXAMPLES
123123
cmd.Flags().StringP("platform", "", "",
124124
"Optionally specify a target platform, for example \"linux/amd64\" when using the s2i build strategy")
125125
cmd.Flags().StringP("username", "", "",
126-
"Username to use when pushing to the registry.")
126+
"Username to use when pushing to the registry. ($FUNC_USERNAME)")
127127
cmd.Flags().StringP("password", "", "",
128-
"Password to use when pushing to the registry.")
128+
"Password to use when pushing to the registry. ($FUNC_PASSWORD)")
129129
cmd.Flags().StringP("token", "", "",
130-
"Token to use when pushing to the registry.")
130+
"Token to use when pushing to the registry. ($FUNC_TOKEN)")
131131
cmd.Flags().BoolP("build-timestamp", "", false, "Use the actual time as the created time for the docker image. This is only useful for buildpacks builder.")
132132

133-
// Temporarily Hidden Basic Auth Flags
134-
// Username, Password and Token flags, which plumb through basic auth, are
135-
// currently only available on the "host" builder.
136-
_ = cmd.Flags().MarkHidden("username")
137-
_ = cmd.Flags().MarkHidden("password")
138-
_ = cmd.Flags().MarkHidden("token")
139-
140133
// Oft-shared flags:
141134
addConfirmFlag(cmd, cfg.Confirm)
142135
addPathFlag(cmd)

cmd/deploy.go

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -207,22 +207,15 @@ EXAMPLES
207207
cmd.Flags().String("platform", "",
208208
"Optionally specify a specific platform to build for (e.g. linux/amd64). ($FUNC_PLATFORM)")
209209
cmd.Flags().StringP("username", "", "",
210-
"Username to use when pushing to the registry.")
210+
"Username to use when pushing to the registry. ($FUNC_USERNAME)")
211211
cmd.Flags().StringP("password", "", "",
212-
"Password to use when pushing to the registry.")
212+
"Password to use when pushing to the registry. ($FUNC_PASSWORD)")
213213
cmd.Flags().StringP("token", "", "",
214-
"Token to use when pushing to the registry.")
214+
"Token to use when pushing to the registry. ($FUNC_TOKEN)")
215215
cmd.Flags().BoolP("build-timestamp", "", false, "Use the actual time as the created time for the docker image. This is only useful for buildpacks builder.")
216216
cmd.Flags().StringP("namespace", "n", defaultNamespace(f, false),
217217
"Deploy into a specific namespace. Will use the function's current namespace by default if already deployed, and the currently active context if it can be determined. ($FUNC_NAMESPACE)")
218218

219-
// Temporarily Hidden Basic Auth Flags
220-
// Username, Password and Token flags, which plumb through basic auth, are
221-
// currently only available on "host" builder.
222-
_ = cmd.Flags().MarkHidden("username")
223-
_ = cmd.Flags().MarkHidden("password")
224-
_ = cmd.Flags().MarkHidden("token")
225-
226219
// Oft-shared flags:
227220
addConfirmFlag(cmd, cfg.Confirm)
228221
addPathFlag(cmd)

0 commit comments

Comments
 (0)