Skip to content
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

update image policy API for first class resolution #10451

Merged
merged 1 commit into from
Aug 19, 2016

Conversation

deads2k
Copy link
Contributor

@deads2k deads2k commented Aug 16, 2016

Change the image policy API to resolve separately. Image resolution is logically a separate step and the resolution would be shared by every test after this. Setting it globally makes sense.

@smarterclayton I think you agreed in concept, make sure you agree in the particulars.

@@ -13,18 +13,34 @@ const IgnorePolicyRulesAnnotation = "alpha.image.policy.openshift.io/ignore-rule
type ImagePolicyConfig struct {
unversioned.TypeMeta

// ResolveImages indicates what kind of image resolution should be done. If a rewriting policy is chosen,
// then the image pull specs will be updated.
ResolveImages ImageResolutionType
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@smarterclayton API changes here.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think I'm fine with this. Since only things that are either in the integrated registry or have a digest can be resolved, it's not like this takes options away.

@deads2k
Copy link
Contributor Author

deads2k commented Aug 17, 2016

@mfojtik can you review this one?

@mfojtik
Copy link
Contributor

mfojtik commented Aug 17, 2016

@deads2k will tomorrow morning

case err != nil && imagepolicyapi.FailOnResolutionFailure(imageResolutionType):
// if we had a resolution error and we're supposed to fail, fail
decision.err = err
decision.tested = true
Copy link
Contributor

Choose a reason for hiding this comment

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

if you return at bottom, are these lost? I don't see you returning them

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if you return at bottom, are these lost? I don't see you returning them

added to cache here. The value is scoped high up, so returning down below (if we tested) will store in the cache.

@mfojtik
Copy link
Contributor

mfojtik commented Aug 18, 2016

[test]

LGTM (will appreciate more tests, but we can always add them later ;-)

@deads2k
Copy link
Contributor Author

deads2k commented Aug 18, 2016

LGTM (will appreciate more tests, but we can always add them later ;-)

This a refactor of existing types, so all the old tests continuing to pass indicates success.

@deads2k
Copy link
Contributor Author

deads2k commented Aug 18, 2016

Comments addressed

@deads2k
Copy link
Contributor Author

deads2k commented Aug 18, 2016

@simon3z @moolitayer The API for the ImagePolicy admission plugin is changing before 3.3. I'm updating the doc the pull today to match this API. Image pull spec resolution is changing.

@deads2k
Copy link
Contributor Author

deads2k commented Aug 18, 2016

[merge]

@openshift-bot
Copy link
Contributor

openshift-bot commented Aug 19, 2016

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

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to ed79340

@openshift-bot
Copy link
Contributor

Evaluated for origin test up to ed79340

@openshift-bot
Copy link
Contributor

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

@openshift-bot openshift-bot merged commit 0a88741 into openshift:master Aug 19, 2016
@deads2k deads2k deleted the change-image-api branch September 6, 2016 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants