Skip to content

Conversation

@rtkypoeluev
Copy link

@rtkypoeluev rtkypoeluev commented Jan 3, 2024

Updating the statefulset scaledown controller code to use newer k8s.io API, version 0.29

Changes:

  • updated k8s.io API calls, params
  • removed vendors dir
  • using local pkg/controller and pkg/signals (instead of github.com/jboss-openshift/statefulset-scaledown-controller)
  • updated unit tests

Testing:

  • running make build
  • running make image
  • running go build ./...
  • running go test ./...

@rtkypoeluev
Copy link
Author

not ready for review yet, work in progress

@rtkypoeluev
Copy link
Author

It's ready for review now

@rtkypoeluev
Copy link
Author

@luksa, it would be great if you could review and approve, so that other people can take use of this PR, thanks!

flag.StringVar(&config.LeaderElection.ResourceLock, "leader-elect-resource-lock", resourcelock.LeasesResourceLock, ""+
"The type of resource object that is used for locking during "+
"leader election. Supported options are `configmaps` (default) and `endpoints`.")
"leader election. Supported option is `leases`.")
Copy link
Author

Choose a reason for hiding this comment

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

ConfigMaps was replaced by Leases

if config.localOnly {
if config.namespace == "" {
bytes, err := ioutil.ReadFile("/var/run/secrets/kubernetes.io/serviceaccount/namespace")
bytes, err := os.ReadFile("/var/run/secrets/kubernetes.io/serviceaccount/namespace")
Copy link
Author

Choose a reason for hiding this comment

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

ioutil.ReadFile was replaced with os.ReadFile

"os"

"statefulset-scaledown-controller/pkg/controller"
"statefulset-scaledown-controller/pkg/signals"
Copy link
Author

Choose a reason for hiding this comment

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

using local controller/signals packages instead of github.com/jboss-openshift

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.

1 participant