Skip to content

Read insecure annotation on an image stream when import-image is invoked#8456

Merged
openshift-bot merged 2 commits intoopenshift:masterfrom
soltysh:issue8452
Apr 30, 2016
Merged

Read insecure annotation on an image stream when import-image is invoked#8456
openshift-bot merged 2 commits intoopenshift:masterfrom
soltysh:issue8452

Conversation

@soltysh
Copy link
Copy Markdown
Contributor

@soltysh soltysh commented Apr 11, 2016

Spec: imageapi.ImageStreamImportSpec{Import: true},
}
insecureAnnotation := stream.Annotations[imageapi.InsecureRepositoryAnnotation]
insecure := o.Insecure || insecureAnnotation == "true"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a user passes oc import-image --insecure=false, should that take priority over the image stream? Why or why not?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For why not - no opinions. For why yes - because that's what we do everywhere else, the flag has higher precedence than what's already there. I'll prepare an update to that...

@soltysh
Copy link
Copy Markdown
Contributor Author

soltysh commented Apr 12, 2016

@smarterclayton added the precedence you've asked for, ptal.

cmd.Flags().BoolVar(&opts.Confirm, "confirm", false, "If true, allow the image stream import location to be set or changed")
cmd.Flags().BoolVar(&opts.All, "all", false, "If true, import all tags from the provided source on creation or if --from is specified")
cmd.Flags().BoolVar(&opts.Insecure, "insecure", false, "If true, allow importing from registries that have invalid HTTPS certificates or are hosted via HTTP")
opts.Insecure = cmd.Flags().Bool("insecure", false, "If true, allow importing from registries that have invalid HTTPS certificates or are hosted via HTTP")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why use this syntax if you're checking later if the flag was changed and setting it to nil? You're effectively going to get the same thing as .BoolVar(opts.Insecure, "insecure", false,...) right?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, you need to be checking whether the flag is set in Complete() and resetting it (or create a new boolean to track the user provided value).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for clarity, that syntax is to prevent those NPE I'm getting right now in tests ;)

@soltysh soltysh force-pushed the issue8452 branch 2 times, most recently from 19054c9 to f4019f1 Compare April 13, 2016 07:58
@soltysh
Copy link
Copy Markdown
Contributor Author

soltysh commented Apr 13, 2016

@pweil- @smarterclayton comments addressed. ptal

@pweil-
Copy link
Copy Markdown

pweil- commented Apr 13, 2016

LGTM - you're getting an error in travis from this bool though

@smarterclayton
Copy link
Copy Markdown
Contributor

Needs update

@soltysh
Copy link
Copy Markdown
Contributor Author

soltysh commented Apr 27, 2016

@smarterclayton @pweil- updated

@soltysh
Copy link
Copy Markdown
Contributor Author

soltysh commented Apr 29, 2016

@smarterclayton last call and if I don't hear from you I assume you're ok with merging this as is.

@smarterclayton
Copy link
Copy Markdown
Contributor

Paul had an outstanding comment

@soltysh
Copy link
Copy Markdown
Contributor Author

soltysh commented Apr 29, 2016

That comment is addressed within the flag description and inside the code where the actual assignment happens.

@smarterclayton
Copy link
Copy Markdown
Contributor

smarterclayton commented Apr 30, 2016 via email

@openshift-bot
Copy link
Copy Markdown
Contributor

openshift-bot commented Apr 30, 2016

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/3491/) (Image: devenv-rhel7_4064)

@openshift-bot
Copy link
Copy Markdown
Contributor

Evaluated for origin merge up to 4d679ac

@openshift-bot
Copy link
Copy Markdown
Contributor

[Test]ing while waiting on the merge queue

@openshift-bot
Copy link
Copy Markdown
Contributor

Evaluated for origin test up to 4d679ac

@openshift-bot
Copy link
Copy Markdown
Contributor

continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/3491/)

@openshift-bot openshift-bot merged commit 5c61cde into openshift:master Apr 30, 2016
@soltysh soltysh deleted the issue8452 branch May 1, 2016 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants