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

Reverse order of CRD init operations #155

Merged
merged 1 commit into from Apr 2, 2019
Merged

Reverse order of CRD init operations #155

merged 1 commit into from Apr 2, 2019

Conversation

schancel
Copy link
Contributor

@schancel schancel commented Apr 1, 2019

This commit reverses the order of CRD init operations. The reason for
doing CRD init operations in this new order, is so that k8s admins
can manually create the expected CRDs. By creating the CRDs by hand,
create CRD permission does not need to be granted to the nats-operator SA.
Only read permission is required.

pkg/util/kubernetes/crd.go Outdated Show resolved Hide resolved
pkg/util/kubernetes/crd.go Outdated Show resolved Hide resolved
@wallyqs
Copy link
Member

wallyqs commented Apr 1, 2019

Thanks @schancel for the PR! Left a couple of suggestions that I think will fix the error in the build.

@schancel
Copy link
Contributor Author

schancel commented Apr 1, 2019

@wallyqs Should be fixed. Any chance you're willing to switch to go mod? It would make it easier to build. I can't actually build this right now, without changing my go setup.

// Attempt to update the CRD by setting its spec to the expected value.
d.Spec = crd.Spec
if _, err := extsClient.ApiextensionsV1beta1().CustomResourceDefinitions().Update(d); err != nil {
// Registration failed
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually this is silly...

This commit reverses the order of CRD init operations. The reason for
doing CRD init operations in this new order, is so that k8s admins
can manually create the expected CRDs. By creating the CRDs by hand,
create CRD permission does not need to be granted to the nats-operator SA.
Only read permission is required.
@wallyqs
Copy link
Member

wallyqs commented Apr 1, 2019

Sorry about the inconvenience, will switch to use go modules after this.

Copy link
Member

@wallyqs wallyqs left a comment

Choose a reason for hiding this comment

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

LGTM

@wallyqs wallyqs merged commit 9fa945f into nats-io:master Apr 2, 2019
@wallyqs wallyqs mentioned this pull request Apr 5, 2019
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.

None yet

2 participants