-
Notifications
You must be signed in to change notification settings - Fork 27
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
feat: migrate operator code base to support new operator-sdk version #404
feat: migrate operator code base to support new operator-sdk version #404
Conversation
b98e8dd
to
991afd8
Compare
f1033fd
to
f60dc51
Compare
description: 'Deploys and Manages Kepler on Kubernetes ' | ||
operators.operatorframework.io/builder: operator-sdk-v1.27.0 | ||
operators.operatorframework.io/builder: operator-sdk-v1.34.2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about we move to 1.35 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIU we can opt-out the internal folder as all the controller code should be in the project root dir https://sdk.operatorframework.io/docs/building-operators/golang/migration/#controllers
Any thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets not keep the controller internal. internal
packages have special meaning - https://go.dev/doc/go1.4#internalpackages
bundle/tests/scorecard/config.yaml
Outdated
@@ -8,7 +8,7 @@ stages: | |||
- entrypoint: | |||
- scorecard-test | |||
- basic-check-spec | |||
image: quay.io/operator-framework/scorecard-test:v1.25.1 | |||
image: quay.io/operator-framework/scorecard-test:v1.34.2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1.35.0 ? :)
hack/bundle.sh
Outdated
@@ -58,7 +58,7 @@ main() { | |||
info "Found old version: $old_bundle_version" | |||
|
|||
info "Building bundle version $VERSION" | |||
run operator-sdk generate kustomize manifests --apis-dir=./pkg/api --verbose | |||
run operator-sdk generate kustomize manifests --apis-dir=./api --verbose |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC, api is the default dir. Could you please check?
f6e9855
to
b15cc21
Compare
Dockerfile
Outdated
# Copy must-gather scripts | ||
COPY must-gather/ must-gather/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets preserve the order based on chance of modifying these files.
config/webhook/service.yaml
Outdated
|
||
# selector: | ||
# control-plane: controller-manager |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete
83c66f7
to
4df0d0b
Compare
PROJECT
Outdated
@@ -9,6 +13,7 @@ repo: github.com/sustainable.computing.io/kepler-operator | |||
resources: | |||
- api: | |||
crdVersion: v1 | |||
namespaced: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this shouldn't marked as namespaced. Our APIs are cluster-scoped.
@@ -3,7 +3,7 @@ kind: ServiceAccount | |||
metadata: | |||
labels: | |||
app.kubernetes.io/name: serviceaccount | |||
app.kubernetes.io/instance: controller-manager | |||
app.kubernetes.io/instance: controller-manager-sa |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you tested upgrade path with this? Will there be 2 SA after we upgrade ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the Operator is upgraded it doesn't change the name of the SA as the name is fixed to controller-manager
This PR updates the code base for compatibility with the latest operator-sdk version(v1.35.0) Key Changes: * Moved API files from `pkg/api` to `api` folder * Relocated `main.go` from `cmd/manager/main.go` to `cmd/main.go` * Shifted controllers from `pkg/controllers` to `internal/controller` folder * Made minor updates to components, utils and tests to use correct import paths * Updated scaffolding config to align with the latest operator-sdk version * Revised Operator, bundle and e2e Dockerfiles * Upgraded operator-sdk to v1.35.0 and controller-gen to v0.13.0 * Updated bundle manifests accordingly Signed-off-by: Vibhu Prashar <vibhu.sharma2929@gmail.com>
This PR updates the code base for compatibility with the latest operator-sdk version(v1.35.0)
Key Changes:
pkg/api
toapi
foldermain.go
fromcmd/manager/main.go
tocmd/main.go
pkg/controllers
tocontrollers
folder