-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add reference-policy option to oc tag #12862
Add reference-policy option to oc tag #12862
Conversation
@miminar can I have quick review here? seems like an easy fix for great profit :-) I tested this:
|
[test] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit, otherwise LGTM
pkg/cmd/cli/cmd/tag.go
Outdated
@@ -273,6 +278,12 @@ func (o TagOptions) Validate() error { | |||
return errors.New("--alias and --delete may not be both specified") | |||
} | |||
|
|||
switch o.referencePolicy { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't plain old if better suited here, this reads weird 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done :-)
1c157a7
to
0d94afe
Compare
pkg/cmd/cli/cmd/tag.go
Outdated
cmd.Flags().BoolVar(&opts.aliasTag, "alias", false, "Should the destination tag be updated whenever the source tag changes. Defaults to false.") | ||
cmd.Flags().BoolVar(&opts.referenceTag, "reference", false, "Should the destination tag continue to pull from the source namespace. Defaults to false.") | ||
cmd.Flags().BoolVar(&opts.scheduleTag, "scheduled", false, "Set a Docker image to be periodically imported from a remote repository. Defaults to false.") | ||
cmd.Flags().BoolVar(&opts.insecureTag, "insecure", false, "Set to true if importing the specified Docker image requires HTTP or has a self-signed certificate. Defaults to false.") | ||
cmd.Flags().StringVar(&opts.referencePolicy, "reference-policy", opts.referencePolicy, "Describes how pull-specs for images in the image stream tag are generated. Valid values are 'source' (default) or 'local'.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/or/and/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The help doesn't help me to understand what it does.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about Instruct image consumers where to pull the image from. Use 'local' to pull from integrated registry. Use 'source' to pull from the image source (default).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@miminar i don't think that describes what this does... basically this just says how the triggers should resolve the image... how about:
Specify how triggers should resolve the image. Use "local" to use integrated registry or "source" for original image source (default).
pkg/cmd/cli/cmd/tag.go
Outdated
@@ -273,6 +278,10 @@ func (o TagOptions) Validate() error { | |||
return errors.New("--alias and --delete may not be both specified") | |||
} | |||
|
|||
if o.referencePolicy != "source" && o.referencePolicy != "local" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you use constants?
0d94afe
to
bfdefea
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
[merge] |
Evaluated for origin merge up to df6b2fd |
[Test]ing while waiting on the merge queue |
Evaluated for origin test up to df6b2fd |
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/13729/) (Base Commit: 863f435) |
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/13729/) (Base Commit: 38d2e9b) (Image: devenv-rhel7_5882) |
cmd.Flags().BoolVar(&opts.aliasTag, "alias", false, "Should the destination tag be updated whenever the source tag changes. Defaults to false.") | ||
cmd.Flags().BoolVar(&opts.referenceTag, "reference", false, "Should the destination tag continue to pull from the source namespace. Defaults to false.") | ||
cmd.Flags().BoolVar(&opts.scheduleTag, "scheduled", false, "Set a Docker image to be periodically imported from a remote repository. Defaults to false.") | ||
cmd.Flags().BoolVar(&opts.insecureTag, "insecure", false, "Set to true if importing the specified Docker image requires HTTP or has a self-signed certificate. Defaults to false.") | ||
cmd.Flags().StringVar(&opts.referencePolicy, "reference-policy", sourceReferencePolicy, "Allow to request pull-trough for external image when set to 'local'. Defaults to 'source'.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo in pull-trough
😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hups
Reference tagging original API change PR #12217 |
No description provided.