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

use latest Operator SDK (0.15.2) #282

Merged
merged 13 commits into from
Mar 23, 2020
Merged

Conversation

joel-bluedata
Copy link
Member

@joel-bluedata joel-bluedata commented Mar 10, 2020

Putting this PR here to air out a bit while we test it more.

Lots of go source files got touched in the "imports" section because of the directory name change from "pkg/apis/kubedirector.hpe.com" to "pkg/apis/kubedirector". Other changes listed below.

.gitignore

Removing "dep"-related stuff.

Some formatting changes in the autogenerated part.

.travis.yml

New golang version requirement.

Switching from dep to go modules.

Gopkg.{lock,toml} and go.{mod,sum}

Switching from dep to go modules.

Makefile

Updating the golang version requirement & adding an operator-sdk version requirement.

Removing "dep"-related stuff.

Directory name change pkg/apis/kubedirector.hpe.com -> pkg/apis/kubedirector.

Make clean should also remove configcli.tgz.

Fixes for .PHONY.

build/*

Slightly different skeleton generated by current SDK -- user setup is done at image build time. Not 100% sure this will still be fine under OpenShift strictness but it is what the SDK now recommends.

doc/*

Updating docs for changes to supported/suggested K8s platforms and changes in build process.

Adding upgrade.md to contain notes about moving to the new version.

main.go

Re-enabling leader election, but "with lease" rather than "for life"; cf. issue #265.

New Prometheus metrics stuff. Commented out for now until we can actually test this.

deployment-prebuilt.yaml and operator.yaml

No predefined metrics port anymore.

WATCH_NAMESPACE really should be empty (since we're cluster scope), even though we don't use this.

rbac-default.yaml

Adding privs for services/finalizers since the new generated role includes that.

Also adding get/watch/list privs for daemonsets.

Adding privs for deployments/finalizers on our own deployment.

Adding Prometheus-related privs (monitoring.coreos.com).

cert.go

Had to pull in these functions we use that have been removed from latest client-go. We could/should move to using the tls module now provided by the SDK... however, its interface requires storing the various certs/keys in two secrets and a configmap, while our current method uses one secret. Since there are now some existing deployments of KD, we would need a migration strategy.

shared/client.go

Handling changes in the signatures for List and Delete.

Handling cases where the split client now can return ErrCacheNotStarted.

validator/util.go

For the Webhooks list element inside our MutatingWebhookConfiguration: instead of a Webhookobject we now are required to use MutatingWebhook. Even though the API version of MutatingWebhookConfiguration has not changed. This is a compatible change i.e. MutatingWebhook is a superset of the old Webhook.

Compiles/lints/builds. Untested. Still need to test and also update docs of course... committing at this point for safekeeping.

Lots of go source files got touched in the "imports" section because of the directory name change from "pkg/apis/kubedirector.hpe.com" to "pkg/apis/kubedirector". Other changes listed below.

#### .gitignore

Removing "dep"-related stuff.

Some formatting changes in the autogenerated part.

#### .travis.yml

New golang version requirement.

First cut at changes for switching from dep to go modules.

#### Gopkg.{lock,toml} and go.{mod,sum}

Switching from dep to go modules.

#### Makefile

New golang version requirement.

Removing "dep"-related stuff.

Directory name change pkg/apis/kubedirector.hpe.com -> pkg/apis/kubedirector.

Make clean should also remove configcli.tgz.

Fixes for .PHONY.

#### build/*

Slightly different skeleton generated by current SDK -- user setup is done at image build time. Not 100% sure this will still be fine under OpenShift strictness but it is what the SDK now recommends.

#### main.go

Uncommenting leader election as it should work now, knock on wood.

New Prometheus metrics stuff. Commented out for now until we can actually test this.

#### deployment-prebuilt.yaml and operator.yaml

No predefined metrics port anymore.

WATCH_NAMESPACE really should be empty (since we're cluster scope), even though we don't use this.

#### rbac-default.yaml

Adding privs for services/finalizers since the new generated role includes that. Not sure we need it but eh.

Also adding get/watch/list privs for daemonsets (again, probably don't need).

Adding privs for deployments/finalizers on our own deployment.

Adding Prometheus-related privs (monitoring.coreos.com).

#### cert.go

Had to pull in these functions we use that have been removed from latest client-go. We could/should move to using the tls module now provided by the SDK... however, its interface requires storing the various certs/keys in two secrets and a configmap, while our current method uses one secret. Since there are now some existing deployments of KD, we would need a migration strategy.

#### shared/client.go

Handling changes in the signatures for List and Delete.

#### validator/util.go

For the Webhooks list element inside our MutatingWebhookConfiguration: instead of a Webhookobject we now are required to use MutatingWebhook. Even though the API version of MutatingWebhookConfiguration has not changed. I think this is a compatible change i.e. MutatingWebhook is a superset of the old Webhook.
I think it used to just return 404 in this case, now it's a special error.
KD can come up successfully now and create a simple kdcluster.
Helps finding detritus when paths change.
@joel-bluedata
Copy link
Member Author

joel-bluedata commented Mar 10, 2020

Note that this change does not take advantage of any new capabilities of the new SDK yet. Some things to investigate: using markup to help generate validation schema, secondary resources, CR status conditions, and the metrics stuff mentioned above.

Also of course we can now use PATCH, and we have access to more recent K8s API versions.

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.

2 participants