Skip to content
This repository was archived by the owner on Nov 9, 2022. It is now read-only.
This repository is currently being migrated. It's locked while the migration is in progress.

Add webhook resource migration#325

Merged
croomes merged 1 commit intomasterfrom
webhook-migration
Apr 23, 2021
Merged

Add webhook resource migration#325
croomes merged 1 commit intomasterfrom
webhook-migration

Conversation

@darkowlzz
Copy link
Contributor

@darkowlzz darkowlzz commented Apr 21, 2021

The webhook resource migration runs at operator startup, before the
controllers are started and ensures that the old webhook related
resources are deleted if they are found. The migration has a timeout of
20 seconds. If the migration gets stuck for some reason, the context
timeout will help cancel the migration operations and return failure.

Log message when some legacy resource is found and deleted:

2021-04-22T18:27:35.240Z        INFO    storageos.setup.migration       deleted legacy resource {"kind": "MutatingWebhookConfiguration", "key": "/storageos-scheduler-webhook"}
2021-04-22T18:27:35.268Z        INFO    storageos.setup.migration       deleted legacy resource {"kind": "Service", "key": "storageos-operator/storageos-scheduler-webhook"}

Nothing is logged when no legacy resource is found.

Also adds fake k8s client based test and kind based e2e tests.

The operator-sdk local run command is updated to have valid options and
the go.sum file is updated with make tidy.

@darkowlzz darkowlzz requested review from Arau, avestuk, croomes and mhmxs April 21, 2021 23:04
Copy link
Contributor

@croomes croomes left a comment

Choose a reason for hiding this comment

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

Thanks, just a suggestion about the logging, but fine to merge as-is if preferred.

The webhook resource migration runs at operator startup, before the
controllers are started and ensures that the old webhook related
resources are deleted if they are found. The migration has a timeout of
20 seconds. If the migration gets stuck for some reason, the timeout
context will help cancel the migration operations and return failure.

Also adds fake k8s client based test and kind based e2e tests.
@croomes croomes merged commit 4997778 into master Apr 23, 2021
@croomes croomes deleted the webhook-migration branch April 23, 2021 09:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants