Skip to content
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

fix: add omitempty to addon strategy #795

Merged
merged 4 commits into from
Jul 15, 2024

Conversation

dkoshkin
Copy link
Contributor

@dkoshkin dkoshkin commented Jul 8, 2024

What problem does this PR solve?:
Saw a failure when using the API to generate a spec and not setting the strategy in Go code:

is invalid: [spec.topology.variables.addons.cni.strategy: Unsupported value: "": supported values: "ClusterResourceSet", "HelmAddon"...

Adding +kubebuilder:validation:Optional didn't change the generated CRDs, but I think we still want them?

Which issue(s) this PR fixes:
Fixes #

How Has This Been Tested?:

Special notes for your reviewer:

@dkoshkin dkoshkin self-assigned this Jul 8, 2024
@dkoshkin dkoshkin changed the title Dkoshkin/fix addon strategy empty fix: add omitempty to addon strategy Jul 8, 2024
@github-actions github-actions bot added the fix label Jul 8, 2024
@dlipovetsky
Copy link
Contributor

dlipovetsky commented Jul 8, 2024

Optional fields have the following properties:
They are a pointer type in the Go definition (e.g. AwesomeFlag *SomeFlag) or have a built-in nil value (e.g. maps and slices).
-- https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#optional-vs-required

Given

Do we want to make uses of AddonStrategy pointers?

@jimmidyson
Copy link
Member

Do we want to make uses of AddonStrategy pointers?

Yes please!

@jimmidyson
Copy link
Member

@dkoshkin

Adding +kubebuilder:validation:Optional didn't change the generated CRDs

That's because the +kubebuilder:validation:Required annotation is on the AddonType type alias. I've updated that now and will push in a minute.

@jimmidyson
Copy link
Member

Switched to pointer field, fixed up handlers and tests, and pushed.

@jimmidyson jimmidyson enabled auto-merge (squash) July 15, 2024 14:50
@jimmidyson jimmidyson merged commit f8d2dce into main Jul 15, 2024
24 checks passed
@jimmidyson jimmidyson deleted the dkoshkin/fix-addon-strategy-empty branch July 15, 2024 14:58
jimmidyson added a commit that referenced this pull request Jul 18, 2024
🤖 I have created a release *beep* *boop*
---


## 0.13.0 (2024-07-18)

<!-- Release notes generated using configuration in .github/release.yaml
at main -->

## What's Changed
### Exciting New Features 🎉
* feat: Secure ciphers, min TLS v1.2, and disable auto TLS for etcd by
@jimmidyson in
#808
* feat: Bump default k8s version for tests to v1.29.6 by @jimmidyson in
#784
### Fixes 🔧
* fix: add omitempty to addon strategy by @dkoshkin in
#795
* fix: update CCM to 0.3.4 to fix sweet32 issue by @tuxtof in
#805
* fix: Clean up MetalLB pod security standards labels by @jimmidyson in
#807
* fix: Fix ownership of ClusterAutoscaler resources by @jimmidyson in
#810
### Other Changes
* ci: Run e2e jobs only if unit-test, lint-*, and pre-commit jobs pass
by @dlipovetsky in
#796
* ci: Enable verbose output for e2e tests by @dlipovetsky in
#797
* test: Verify ServiceLoadBalancer in e2e Docker and Nutanix tests by
@dlipovetsky in
#788
* refactor: Use CAPI conditions check where possible by @dlipovetsky in
#789
* test(e2e): Use parallel tests for providers other than Docker by
@jimmidyson in
#787

## New Contributors
* @tuxtof made their first contribution in
#805

**Full Changelog**:
v0.12.1...v0.13.0

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants