Skip to content

deploy: reconcile streams on config creation/updates #10456

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

Merged
merged 2 commits into from
Aug 17, 2016
Merged

deploy: reconcile streams on config creation/updates #10456

merged 2 commits into from
Aug 17, 2016

Conversation

0xmichalis
Copy link
Contributor

@0xmichalis 0xmichalis commented Aug 16, 2016

@0xmichalis
Copy link
Contributor Author

[test]

return nil, getErr
}
if !exists {
existsErr := kapierrors.NewNotFound(imageapi.Resource("imagestreams"), name)
Copy link
Contributor

Choose a reason for hiding this comment

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

squash these two lines to one

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

@mfojtik
Copy link
Contributor

mfojtik commented Aug 16, 2016

This looks pretty cool and cleaner than what we have now. @bparees you might put this on your radar for image change trigger in builds.

@@ -14,6 +17,19 @@ type StoreToImageStreamLister struct {
cache.Indexer
}

// Get returns the image stream with the provided namespace and name.
func (s *StoreToImageStreamLister) Get(namespace, name string) (*imageapi.ImageStream, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Refactor to match client interface. .ImageStreams(namespace).Get(name). I'm not ready to break that pattern yet.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

@deads2k
Copy link
Contributor

deads2k commented Aug 16, 2016

I'm missing something fundamental. Why would an update to a DC cause our image change trigger to fire?

return false
}

func (c *ImageChangeController) getByKey(key string) (*imageapi.ImageStream, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd rather see a lister in use.

Copy link
Contributor Author

@0xmichalis 0xmichalis Aug 17, 2016

Choose a reason for hiding this comment

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

I would have to parse the key to a namespace and a name in order to use the stream lister.

@0xmichalis
Copy link
Contributor Author

I'm missing something fundamental. Why would an update to a DC cause our image change trigger to fire?

You just added a new ICT to your DC. If the image stream exists, it should be reconciled for the image to be picked up by your DC, no?

Remember that we are going to remove the controller in 1.3.1 in favor of /instantiate.

@deads2k
Copy link
Contributor

deads2k commented Aug 17, 2016

You just added a new ICT to your DC. If the image stream exists, it should be reconciled for the image to be picked up by your DC, no?

That makes sense. Can you add that as a comment in the code? I didn't get there just reading it.

@deads2k
Copy link
Contributor

deads2k commented Aug 17, 2016

One comment to add, might have one //TODO outstanding, one comment to add, and a squash. Then lgtm.

@@ -24,7 +24,11 @@ func ImageStreamReferenceIndexFunc(obj interface{}) ([]string, error) {
}
params := trigger.ImageChangeParams
name, _, _ := imageapi.SplitImageStreamTag(params.From.Name)
keys = append(keys, params.From.Namespace+"/"+name)
namespace := params.From.Namespace
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@deads2k last thing that needs review. On master we currently default empty namespaces for ICT references to the config namespace but this is not true for older versions so our index needs to take empty namespace into account and use the config ns.

Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't that happen in defaulting? If so, it'll happen client-side in the controller if a namespaceless ICT is read from the API, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct but what worries me is that this is a client library and older servers are not defaulting.

Copy link
Contributor

Choose a reason for hiding this comment

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

anything containing this code will be reading using a client library that does the defaulting, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct. Then I guess we don't need this change.

@0xmichalis
Copy link
Contributor Author

All comments addressed, green tests, [merge]

@0xmichalis 0xmichalis added this to the 1.3.0 milestone Aug 17, 2016
@openshift-bot
Copy link
Contributor

openshift-bot commented Aug 17, 2016

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

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to 7ce9013

@openshift-bot
Copy link
Contributor

Evaluated for origin test up to 7ce9013

@mfojtik
Copy link
Contributor

mfojtik commented Aug 17, 2016

@smarterclayton this should decrease the number of flakes in deployments \o/

@openshift-bot
Copy link
Contributor

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

@openshift-bot openshift-bot merged commit 3234c5c into openshift:master Aug 17, 2016
@0xmichalis 0xmichalis deleted the ic-controller-refactor branch August 18, 2016 07:19
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.

5 participants