Skip to content

deploy: reconcile streams on config creation/updates - #10456

Merged
openshift-bot merged 2 commits into
openshift:masterfrom
0xmichalis:ic-controller-refactor
Aug 17, 2016
Merged

openshift-bot merged 2 commits into
openshift:masterfrom
0xmichalis:ic-controller-refactor

Conversation

@0xmichalis

@0xmichalis 0xmichalis commented Aug 16, 2016 •

Copy link
Copy Markdown
Contributor

@0xmichalis

Copy link
Copy Markdown
Contributor Author

[test]

Comment thread pkg/client/cache/imagestream.go Outdated
return nil, getErr
}
if !exists {
existsErr := kapierrors.NewNotFound(imageapi.Resource("imagestreams"), name)

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.

squash these two lines to one

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.

ok

@mfojtik

mfojtik commented Aug 16, 2016

Copy link
Copy Markdown
Contributor

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.

Comment thread pkg/client/cache/imagestream.go Outdated
}

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

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.

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

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.

ok

@deads2k

deads2k commented Aug 16, 2016

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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.

@0xmichalis 0xmichalis Aug 17, 2016 •

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.

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

@0xmichalis

Copy link
Copy Markdown
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

deads2k commented Aug 17, 2016

Copy link
Copy Markdown
Contributor

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

deads2k commented Aug 17, 2016

Copy link
Copy Markdown
Contributor

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

Comment thread pkg/client/cache/index.go Outdated
params := trigger.ImageChangeParams
name, _, _ := imageapi.SplitImageStreamTag(params.From.Name)
keys = append(keys, params.From.Namespace+"/"+name)
namespace := params.From.Namespace

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.

@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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

All comments addressed, green tests, [merge]

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

openshift-bot commented Aug 17, 2016 •

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

Evaluated for origin merge up to 7ce9013

@openshift-bot

Copy link
Copy Markdown
Contributor

Evaluated for origin test up to 7ce9013

@mfojtik

mfojtik commented Aug 17, 2016 •

Copy link
Copy Markdown
Contributor

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

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