-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
deploy: reconcile streams on config creation/updates #10456
Conversation
[test] |
return nil, getErr | ||
} | ||
if !exists { | ||
existsErr := kapierrors.NewNotFound(imageapi.Resource("imagestreams"), name) |
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.
squash these two lines to one
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.
ok
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) { |
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.
Refactor to match client interface. .ImageStreams(namespace).Get(name)
. I'm not ready to break that pattern yet.
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.
ok
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) { |
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.
I'd rather see a lister in use.
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.
I would have to parse the key to a namespace and a name in order to use the stream lister.
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. |
… interval" This reverts commit cc7f896.
That makes sense. Can you add that as a comment in the code? I didn't get there just reading it. |
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 |
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.
@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.
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.
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?
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.
Correct but what worries me is that this is a client library and older servers are not defaulting.
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.
anything containing this code will be reading using a client library that does the defaulting, right?
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.
Correct. Then I guess we don't need this change.
All comments addressed, green tests, [merge] |
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/8065/) (Image: devenv-rhel7_4857) |
Evaluated for origin merge up to 7ce9013 |
Evaluated for origin test up to 7ce9013 |
@smarterclayton this should decrease the number of flakes in deployments \o/ |
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/8065/) |
Fixes #9018
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1355976
@mfojtik @deads2k @liggitt