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

add internal and external URL handling for the docker pull secret #19838

Merged

Conversation

deads2k
Copy link
Contributor

@deads2k deads2k commented May 24, 2018

This plumbs the information from the master config down to the controllers for internal and external registry values.

@smarterclayton it's small in case you change your mind.
@mfojtik we'll want test coverage on this (beyond my unit test). We need a card?
@bparees I saw your name somewhere

@openshift-ci-robot openshift-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 24, 2018
@smarterclayton
Copy link
Contributor

This is super small.

/approve

@smarterclayton
Copy link
Contributor

But needs tests to make sure it doesn't break.

}
if len(in.ImagePolicyConfig.InternalRegistryHostname) > 0 {
registryURLs = append(registryURLs, in.ImagePolicyConfig.InternalRegistryHostname)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

should this also check OPENSHIFT_DEFAULT_REGISTRY since that is also a valid (if deprecated?) way to set the url on the master?

Copy link
Contributor

Choose a reason for hiding this comment

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

(that's an env var, sorry i wasn't clearer)

Copy link
Contributor

Choose a reason for hiding this comment

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

no, we should never use it again. That's supposed to be set up front. Ansible forcibly upgrades you away.

Copy link
Contributor

Choose a reason for hiding this comment

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

k

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 OPENSHIFT_DEFAULT_REGISTRY is handled by the logic that sets the ImagePolicyConfig already if I remember correctly

@deads2k
Copy link
Contributor Author

deads2k commented May 24, 2018

But needs tests to make sure it doesn't break.

More than the unit test that makes sure the controller works?

@@ -1574,6 +1575,11 @@ type ServiceAccountControllerConfig struct {
ManagedNames []string
}

type DockerPullSecretControllerConfig struct {
// RegistryURLs is a list of urls that the docker pull secrets should be valid for.
RegistryURLs []string
Copy link
Contributor

@mfojtik mfojtik May 25, 2018

Choose a reason for hiding this comment

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

nit: optional: can we call this AdditionalRegistryURLs to match the controller field?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nit: optional: can we call this AdditionalRegistryURLs to match the controller field?

I think from the config side, the user see this as his spot to specify the registry urls, not to set extra ones. From his point of view, we're the ones adding extras. The API is for them, not us.

@@ -98,6 +102,9 @@ func NewDockerRegistryServiceController(secrets informers.SecretInformer, servic
type DockerRegistryServiceController struct {
client kclientset.Interface

// AdditionalRegistryURLs is a list of URLs that are always included
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: lowercase

@@ -218,7 +225,7 @@ func (e *DockerRegistryServiceController) watchForDockerURLChanges() {

// getDockerRegistryLocations returns the dns form and the ip form of the secret
func (e *DockerRegistryServiceController) getDockerRegistryLocations() []string {
ret := []string{}
ret := append([]string{}, e.additionalRegistryURLs...)
Copy link
Contributor

Choose a reason for hiding this comment

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

why not start with ret := e.additionalRegistryURLs ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

why not start with ret := e.additionalRegistryURLs ?

fear of accidental mutation.

@deads2k deads2k force-pushed the controller-25-pullsecret branch from 6abb9e4 to dad692c Compare May 25, 2018 13:37
@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: deads2k, smarterclayton

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 25, 2018
@deads2k deads2k force-pushed the controller-25-pullsecret branch from dad692c to 8558ecf Compare May 25, 2018 13:39
@deads2k
Copy link
Contributor Author

deads2k commented May 25, 2018

comments addressed, integration test added.

@deads2k
Copy link
Contributor Author

deads2k commented May 25, 2018

/retest

2 similar comments
@deads2k
Copy link
Contributor Author

deads2k commented May 25, 2018

/retest

@deads2k
Copy link
Contributor Author

deads2k commented May 25, 2018

/retest

@mfojtik
Copy link
Contributor

mfojtik commented May 28, 2018

@deads2k the integration failure seems real.

@openshift-bot openshift-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 29, 2018
@deads2k deads2k force-pushed the controller-25-pullsecret branch from 8558ecf to f3ceaee Compare May 29, 2018 17:57
@openshift-bot openshift-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 29, 2018
@openshift-ci-robot
Copy link

New changes are detected. LGTM label has been removed.

@deads2k deads2k added the lgtm Indicates that a PR is ready to be merged. label May 29, 2018
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label May 29, 2018
@deads2k deads2k added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 29, 2018
@deads2k
Copy link
Contributor Author

deads2k commented May 29, 2018

/retest

@deads2k deads2k added lgtm Indicates that a PR is ready to be merged. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels May 29, 2018
@deads2k
Copy link
Contributor Author

deads2k commented May 29, 2018

/retest

1 similar comment
@deads2k
Copy link
Contributor Author

deads2k commented May 29, 2018

/retest

@openshift-merge-robot openshift-merge-robot merged commit 4e2e05d into openshift:master May 29, 2018
@deads2k deads2k deleted the controller-25-pullsecret branch July 3, 2018 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants