Skip to content

Commit

Permalink
fix(crd): use optional in place of omitempty for authentication.enabl…
Browse files Browse the repository at this point in the history
…ed (#652)

omitempty triggers a strange behaviour: even if enabled is set
to false in the yaml, it will get the default value on initial
apply call.

Using the optional markers keeps the same effect without that
behaviour.
  • Loading branch information
sgaist authored Jul 25, 2024
1 parent 6f489fb commit 47f026d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion api/v1alpha1/amaltheasession_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,10 @@ const Token AuthenticationType = "token"
const Oidc AuthenticationType = "oauth2proxy"

type Authentication struct {
// +optional
// +kubebuilder:validation:Optional
// +kubebuilder:default:=true
Enabled bool `json:"enabled,omitempty"`
Enabled bool `json:"enabled"`
Type AuthenticationType `json:"type"`
// Kubernetes secret that contains the authentication configuration
// For `token` generate a hard to guess string / password-like string.
Expand Down

0 comments on commit 47f026d

Please sign in to comment.