-
Notifications
You must be signed in to change notification settings - Fork 7
feat: Updating chart to support CRD struct, Fixes #419 #420
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
base: master
Are you sure you want to change the base?
Conversation
Does the PR have any schema changes?Looking good! No breaking changes found. |
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.
Pull Request Overview
This pull request adds support for the new CRDs configuration in the cert-manager chart while maintaining backward compatibility with the deprecated installCRDs option. Key changes include updating the input structures and APIs in Python, Node.js, Java, Go, and .NET, modifying the schema to include the new deleteOnDestroy field, and implementing CRD deletion functionality in the provider code.
Reviewed Changes
Copilot reviewed 15 out of 18 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| sdk/python/pulumi_kubernetes_cert_manager/cert_manager.py | Added the new crds parameter and corresponding getter/setter, plus updated the deprecation message for install_crds. |
| sdk/python/pulumi_kubernetes_cert_manager/_inputs.py | Introduced CertManagerCrdsArgs and CertManagerCrdsArgsDict for CRD configuration. |
| sdk/nodejs/types/input.ts, sdk/nodejs/certManager.ts | Added the new crds field in the types and component class with updated deprecation handling for installCRDs. |
| sdk/java/... | Updated CertManagerCrdsArgs and CertManagerArgs to incorporate the new CRD configuration. |
| sdk/go/... | Added CertManagerCrds types and updated certManagerArgs to include the new crds property. |
| sdk/dotnet/... | Added new input type CertManagerCrdsArgs and updated CertManager to handle the new crds property. |
| provider/pkg/provider/provider.go, chart.go | Modified provider code to handle backward compatibility and implement CRD deletion using the deleteOnDestroy flag. |
| examples/ | Updated the TypeScript example to showcase the usage of the new CRDs configuration. |
Files not reviewed (3)
- examples/simple-cert-manager-with-crds-ts/package.json: Language not supported
- examples/simple-cert-manager-with-crds-ts/tsconfig.json: Language not supported
- provider/cmd/pulumi-resource-kubernetes-cert-manager/schema.json: Language not supported
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.
Pull Request Overview
This PR updates the CertManager component to support a new CRDs structure while ensuring backward compatibility with the deprecated installCRDs option. Key changes include:
- Introducing the new crds parameter and its getter/setter implementations across Python, Node.js, Java, Go, and .NET SDKs.
- Updating types, input definitions, and examples (in README) to reflect the new CRDs struct.
- Maintaining backward compatibility by keeping the deprecated installCRDs option in the APIs.
Reviewed Changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/python/pulumi_kubernetes_cert_manager/cert_manager.py | Added new crds parameter and getter/setter for CRDs support. |
| sdk/python/pulumi_kubernetes_cert_manager/_inputs.py | Introduced CertManagerCrdsArgs and Dict types for CRDs. |
| sdk/nodejs/types/input.ts | Added CertManagerCrdsArgs interface to support CRDs configuration. |
| sdk/nodejs/certManager.ts | Integrated crds field and updated deprecated installCRDs message. |
| sdk/java/src/main/java/com/pulumi/kubernetescertmanager/inputs/CertManagerCrdsArgs.java & CertManagerArgs.java | Created new Java types and updated builder methods for CRDs. |
| sdk/go/kubernetes-cert-manager/pulumiTypes.go & certManager.go | Extended Go types and structs to include CRDs support. |
| sdk/dotnet/Inputs/CertManagerCrdsArgs.cs & CertManager.cs | Added .NET inputs and updated resource Args for CRDs. |
| provider/pkg/provider/chart.go | Updated chart arguments to include the new crds field. |
| README.md | Updated examples and installation instructions to showcase new CRDs usage. |
Files not reviewed (1)
- provider/cmd/pulumi-resource-kubernetes-cert-manager/schema.json: Language not supported
Comments suppressed due to low confidence (3)
sdk/go/kubernetes-cert-manager/certManager.go:65
- Consider adding logic or documentation on how conflicts between the new 'Crds' field and the deprecated 'InstallCRDs' field are resolved to ensure predictable behavior.
InstallCRDs *bool `pulumi:"installCRDs"`
sdk/java/src/main/java/com/pulumi/kubernetescertmanager/CertManagerArgs.java:218
- [nitpick] Verify that the deprecation messaging and naming for 'installCRDs' remain consistent with other SDK implementations to avoid confusion.
@Import(name="installCRDs")
README.md:18
- Consider adding tests to verify the new CRDs functionality and its backward compatibility with the deprecated 'installCRDs' option.
```bash
4a6c32a to
fe11488
Compare
b6581a6 to
1a5267f
Compare
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.
Pull Request Overview
This pull request introduces CRD customization support for the Pulumi Kubernetes Cert-Manager provider by adding a new crds property to the schema and implementing default logic for its Keep field. Key changes include:
- Adding a new crds property and the CertManagerCrds type in the chart.
- Implementing default value logic for crds in the Construct function.
- Enhancing tests, including unit tests for default behavior and custom value preservation, as well as updating dependencies.
Reviewed Changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| provider/pkg/provider/provider_test.go | Added unit tests for CRDs defaults and custom values; placeholder test for dynamic CRD adoption |
| provider/pkg/provider/provider.go | Updated default handling for crds in the Construct function |
| provider/pkg/provider/chart.go | Added new crds field in CertManagerArgs and defined CertManagerCrds type |
Files not reviewed (2)
- provider/cmd/pulumi-resource-kubernetes-cert-manager/schema.json: Language not supported
- provider/go.mod: Language not supported
Comments suppressed due to low confidence (1)
provider/pkg/provider/provider_test.go:24
- TestFindAndAdoptCertManagerCRDs is currently a placeholder with no assertions. Consider adding tests to validate the dynamic CRD finding and adoption functionality.
func TestFindAndAdoptCertManagerCRDs(t *testing.T) {
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.
Pull Request Overview
This PR updates the Cert-Manager provider to replace the deprecated installCRDs field with a more flexible crds configuration object. Key changes include updating the schema across multiple SDKs (Python, Node.js, Java, Go, .NET), enhancing defaulting logic for CRD installation, and adding new unit tests to verify default and custom CRDs behavior.
Reviewed Changes
Copilot reviewed 16 out of 18 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| sdk/python/* | Added crds parameter and its getter/setter to support the new configuration in Python SDK |
| sdk/nodejs/* | Updated input and output types and added defaulting helper for crds in the Node.js SDK |
| sdk/java/* | Introduced new CertManagerCrdsArgs class for Java with proper defaults |
| sdk/go/* | Implemented CertManagerCrds types and defaulting logic along with updates to constructor logic |
| sdk/dotnet/* | Added the new crds property and its defaulting in the .NET SDK |
| provider/pkg/provider/* | Updated provider construction and chart logic to handle crds defaults and backward compatibility |
| examples/simple-cert-manager-ts/index.ts | Modified example to use new crds field |
Files not reviewed (2)
- provider/cmd/pulumi-resource-kubernetes-cert-manager/schema.json: Language not supported
- provider/go.mod: Language not supported
Comments suppressed due to low confidence (1)
provider/pkg/provider/chart.go:96
- The function 'R()' currently mixes defaulting logic for the 'crds' field with the return of helmOptions. Consider moving the defaulting logic for 'crds' to a dedicated initialization routine or helper method to improve code clarity and maintainability.
func (args *CertManagerArgs) R() **helmbase.ReleaseType {
e7dc4fc to
f50da14
Compare
6484f42 to
9886595
Compare
a2cbb2c to
91249ea
Compare
|
@rshade is there any update regarding this PR please? One of our customer is in need for this. |
4bf9b40 to
3ad98a4
Compare
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.
Pull Request Overview
This PR replaces the deprecated installCRDs boolean with a structured crds object across the provider and all SDKs, adds backward‐compatibility logic, updates tests, and refreshes documentation.
- Introduces
crdsobject (enabled,keep) and defaulting logic in provider code - Updates NodeJS, Go, Java, and .NET SDKs to support
crds - Adds and improves tests; updates examples and README
Reviewed Changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/nodejs/types/output.ts | Added import for utilities |
| sdk/nodejs/types/input.ts | Added CertManagerCrdsArgs and default helper |
| sdk/nodejs/certManager.ts | Wired crds into resourceInputs |
| sdk/java/.../inputs/CertManagerCrdsArgs.java | Generated Java args type for crds |
| sdk/java/.../CertManagerArgs.java | Plumbed crds into Java CertManagerArgs |
| sdk/java/README.md | Documented crds usage |
| sdk/go/.../pulumiTypes.go | Added Go input/output types and defaults |
| sdk/go/.../certManager.go | Applied Defaults() in Go SDK constructor |
| sdk/go.mod | Bumped k8s SDK version |
| sdk/dotnet/Inputs/CertManagerCrdsArgs.cs | Generated .NET CertManagerCrdsArgs |
| sdk/dotnet/CertManager.cs | Added .Crds property to .NET args |
| provider/pkg/provider/provider_test.go | New unit tests for CRDs defaults and legacy |
| provider/pkg/provider/provider.go | Added CRDs defaulting & legacy handling |
| provider/pkg/provider/chart.go | Enhanced R() to configure crds |
| provider/go.mod | Added test dependencies |
| provider/cmd/.../schema.json | Extended schema with crds type |
| examples/simple-cert-manager-ts/index.ts | Migrated example to crds field |
| examples/examples_ts_test.go | Added TypeScript CRDs uninstall test |
| README.md | Documented crds configuration |
| .pulumi.version | Updated Pulumi CLI version |
Comments suppressed due to low confidence (2)
provider/cmd/pulumi-resource-kubernetes-cert-manager/schema.json:891
- The schema for
crds.enabledlacks an explicit default; adding"default": falsewill align it with thekeepfield and SDK defaults.
"type": "boolean"
provider/pkg/provider/provider_test.go:24
- This test is a placeholder without any assertions or logic; either implement the intended behavior checks or remove the empty test.
func TestFindAndAdoptCertManagerCRDs(t *testing.T) {
f7ef25d to
9b5653e
Compare
97304f9 to
f9499fb
Compare
Here's a summary of the changes made to implement the solution for GitHub issue 419:
1. Added the crds structure to the provider schema:
- Introduced a new CertManagerCrds struct in chart.go with two fields:
- Enabled (bool): Controls installation of CRDs
- Keep (bool): Controls if CRDs should remain after chart uninstall
2. Set crds.keep=false as the default:
- Modified the Construct function in provider.go to set a default value of false for Crds.Keep
- This ensures that by default CRDs will be removed when the chart is uninstalled
3. Updated the schema.json file:
- Added the new CertManagerCrds type definition to schema.json
- Added the crds field to the CertManager input properties
- Set the default value for keep to false in the schema
4. Added tests:
- Created unit tests for the new default value behavior
- Verified that the crds.keep property defaults to false
- Verified that user-provided custom values are respected
These changes address GitHub issue 419 by:
1. Replacing the deprecated installCRDs parameter with the newer crds.enabled and crds.keep parameters
2. Setting crds.keep=false by default to provide better cleanup behavior when removing Cert Manager
3. Ensuring backward compatibility by maintaining support for the installCRDs parameter
The implementation aligns with the Helm chart's evolution and gives users more flexibility in managing the Cert Manager CRDs
This will fix #419
…tioning from using installCRDs: boolean to using a structured object crds: { enabled: boolean, keep: boolean }.
2. We implemented fixes in the provider code to handle both formats compatibly:
- In chart.go, we added logic to set crds.enabled when installCRDs is true
- In provider.go, we added similar logic to ensure compatibility
3. The TypeScript test passed with our changes, indicating that the issue has been fixed.
Let's create a more comprehensive solution by updating the other language SDKs to handle both the old and new approaches. Since we already saw the Go, Python, and .NET examples are still using the old
installCRDs approach, there's no urgent need to update them right now.
In summary:
1. We fixed the provider code to handle both installCRDs and the new crds object properly
2. The preview test now passes with our changes
3. The full deployment test may need more time, but the code changes we made should resolve the compatibility issue
This pull request introduces significant changes to the Pulumi Kubernetes Cert-Manager provider, focusing on replacing the deprecated
installCRDsfield with a newcrdsconfiguration object. The changes improve customization and default behavior for CRD installation while maintaining backward compatibility. Additionally, test coverage and dependencies have been updated to support these changes.Key Changes:
CRD Configuration Enhancements:
Replaced the
installCRDsfield with a newcrdsobject, which includesenabledandkeepproperties for more granular control over CRD installation and retention during chart uninstall. (examples/simple-cert-manager-ts/index.ts,provider/pkg/provider/chart.go,provider/cmd/pulumi-resource-kubernetes-cert-manager/schema.json,sdk/dotnet/CertManager.cs,sdk/go/kubernetes-cert-manager/certManager.go,sdk/go/kubernetes-cert-manager/pulumiTypes.go) [1] [2] [3] [4] [5] [6] [7]Added logic to handle default values for the
crdsobject wheninstallCRDsis still used, ensuring backward compatibility. (provider/pkg/provider/chart.go,provider/pkg/provider/provider.go) [1] [2]Testing Improvements:
crdsobject. (provider/pkg/provider/provider_test.go)Dependency Updates:
go.modto include new dependencies for testing (stretchr/testify,davecgh/go-spew,pmezard/go-difflib) and removed an unused dependency (stretchr/objx). (provider/go.mod) [1] [2] [3] [4]SDK Updates:
crdsconfiguration object, with appropriate type definitions and defaults. (sdk/dotnet/Inputs/CertManagerCrdsArgs.cs,sdk/go/kubernetes-cert-manager/pulumiTypes.go) [1] [2] [3] [4]These changes enhance the flexibility and maintainability of the Cert-Manager provider while ensuring compatibility with existing configurations.