Skip to content

Conversation

@camilamacedo86
Copy link
Contributor

@camilamacedo86 camilamacedo86 commented Apr 25, 2025

Update the scaffolds as part of: #6927

"--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.

@camilamacedo86 camilamacedo86 mentioned this pull request Apr 25, 2025
10 tasks
camilamacedo86 and others added 4 commits May 23, 2025 13:39
Signed-off-by: Adam D. Cornett <[email protected]>
Signed-off-by: Camila Macedo <[email protected]>
Comment kustomize code to pass certs for the metric server for tests with packagemanifest

Signed-off-by: Camila Macedo <[email protected]>
Signed-off-by: Camila Macedo <[email protected]>
@camilamacedo86
Copy link
Contributor Author

Hi @acornett21

Please feel free to take a look at this one.
I think we are good now regarding the scaffold changes.
As a follow-up we need to change the k8s version for SDK itself: https://github.com/operator-framework/operator-sdk/pull/6941/files

@acornett21 acornett21 merged commit e651b0f into operator-framework:master May 27, 2025
22 of 23 checks passed
@camilamacedo86 camilamacedo86 deleted the upgrade-kubebuilder branch May 27, 2025 14:54
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.

3 participants