Skip to content

Conversation

@mandre
Copy link
Collaborator

@mandre mandre commented Jan 26, 2026

Some API changes, still WIP.

Also disable new failing linters. We'll look into them separately.
This was a gap in our testing. Disable the failing linters, that will
fix in later commits.
Fix the missing `omitzero` marker for CloudCredentialsRef. According to
the kubernetes API conventions [1]:

> Required structs should use omitzero to avoid marshalling the zero value.

Also add a missing `omitempty` for the image Download. I left it as
a pointer due to reasons explained here [2].

[1] https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#optional-vs-required
[2] k-orc#270 (comment)
kube-api-linter prefers using the `+default` marker and will warn about
our use of `+kubebuilder:default`. We could switch the API to use
`+default`, however `elastic/crd-ref-docs` doesn't yet understand this
marker. A patch merged to add support but it's not yet in a release.

Let's stick to `+kubebuilder:default` for now.
The `arrayofstruct` linter flags the struct we're using for the
Statuses, were we report _exactly_ what OpenStack returns and don't do
validation on purpose.

From the things this new linter warns about, there's only one struct
that is not a struct used in Status, however this struct has validation
to ensure it has at least one element.

More context on the new check at
https://github.com/kubernetes-sigs/kube-api-linter/blob/main/docs/linters.md#arrayofstruct
Non-pointer structs with required fields must be marked as required
themselves. Also use omitzero instead of omitempty to properly handle
the zero value for the struct.
@github-actions github-actions bot added the semver:patch No API change label Jan 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver:patch No API change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant