8000 ⚠️ Upgrade kubebuilder scaffold from v4.2.0 to v4.5.2 by camilamacedo86 · Pull Request #6928 · operator-framework/operator-sdk · GitHub
[go: up one dir, main page]

Skip to content

⚠️ Upgrade kubebuilder scaffold from v4.2.0 to v4.5.2 #6928

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

camilamacedo86
Copy link
Contributor
@camilamacedo86 camilamacedo86 commented Apr 25, 2025

WIP to help towards: #6927

10000
@@ -134,7 +134,6 @@ func (mh *Memcached) Run() {
"--group", mh.ctx.Group,
"--version", mh.ctx.Version,
"--kind", mh.ctx.Kind,
"--defaulting",
"--defaulting")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@acornett21, it was duplicated. If we want it in the sample, default + validating, then we need to add it here.
But would not be call twice defaulting
I keep only defaulting here. We can add the validating as well in a follow up if we need to

err := kbutil.ReplaceInFile(webhookPath,
"// TODO(user): fill in your defaulting logic.",
"if memcached.Spec.Size == 0 {\n\t\tmemcached.Spec.Size = 3\n\t}")
pkg.CheckError("injecting defaulting logic", err)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@acornett21 just added the code to implement the defaulting logic, but in the right place, ancleaned up all the other staff.

return errors.New("Cluster size must be an odd number")
}
return nil
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@acornett21 if we want the validating webhook here then we need to add the option to scaffold this type and then just replace TODO:(user) implement your logic for the logic that we want instead.

# delimiter: '.'
# index: 1
# create: true
# - source: # Uncomment the following block to enable certificates for metrics
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@acornett21 the changes here mainly happened due bug fixes and enhancements.

New feature

Bug Fixes

  • Fixed CA injection for conversion webhooks. Previously, the CA injection patch was not accurate; The injection should occur only for CRDs, which are conversion types and not for all CRDs when a webhook with --conversion option is scaffolded. The issue goes back to release 3.5.0 (where to replace vars for replacements was done and the kustomize/v2-alpha plugin was introduced). It was not previously found, likely because conversion webhook features were incomplete, which is addressed in this release. Now, users can use the tool to generate the conversion webhooks properly

  • Corrected the generation of manifests under config/crd/patches to ensure the /convert service patch is only created for webhooks configured with --conversion.

@@ -48,11 +48,9 @@ endif

# Set the Operator SDK version to use. By default, what is installed on the system is used.
# This is useful for CI or a project to utilize a specific version of the operator-sdk toolkit.
OPERATOR_SDK_VERSION ?= v1.39.1
OPERATOR_SDK_VERSION ?= v1.39.2
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@acornett21 I do not know why it changed for 2
But was done automatically.

Copy link
Contributor

Choose a reason for hiding this comment

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

I raised a PR for this, you can rebase and get this change. It seems patch releases need post release steps, this is coming from that.

@$(KIND) get clusters | grep -q 'kind' || { \
echo "No Kind cluster is running. Please start a Kind cluster before running the e2e tests."; \
exit 1; \
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@acornett21 just for you be aware of.
It should not be added to the scaffold.
We changed already on master, so it is fixed. I am cleaning up.

@camilamacedo86 camilamacedo86 changed the title ⚠️ Upgrade kubebuilder deps add support for k8s 1.32 ⚠️ Upgrade kubebuilder scaffold from v4.2.0 to v4.5.2 May 14, 2025
Signed-off-by: Camila Macedo <7708031+camilamacedo86@users.noreply.github.com>
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
0