Skip to content

Commit

Permalink
add omitempty to optional fields
Browse files Browse the repository at this point in the history
Signed-off-by: Nandor Kracser <[email protected]>
  • Loading branch information
bonifaido committed Jan 14, 2021
1 parent c684713 commit 17a299d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 15 deletions.
9 changes: 3 additions & 6 deletions charts/vault-operator/crds/crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2665,7 +2665,6 @@ spec:
- keyLabel
- modulePath
- pin
- slotId
type: object
kubernetes:
description: KubernetesUnsealConfig holds the parameters for Kubernetes
Expand Down Expand Up @@ -17010,9 +17009,9 @@ spec:
description: 'VolumeClaimTemplates define some extra Kubernetes PersistentVolumeClaim
templates for the Vault Statefulset. default:'
items:
description: EmbeddedPersistentVolumeClaim is an embeddable version
of k8s.io/api/core/v1.PersistentVolumeClaim. It contains TypeMeta
and a reduced ObjectMeta.
description: EmbeddedPersistentVolumeClaim is an embeddable and
controller-gen friendly version of k8s.io/api/core/v1.PersistentVolumeClaim.
It contains TypeMeta and a reduced ObjectMeta.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this
Expand Down Expand Up @@ -18691,8 +18690,6 @@ spec:
type: array
required:
- config
- serviceRegistrationEnabled
- vaultContainerSpec
type: object
status:
description: VaultStatus defines the observed state of Vault
Expand Down
9 changes: 3 additions & 6 deletions operator/deploy/crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2665,7 +2665,6 @@ spec:
- keyLabel
- modulePath
- pin
- slotId
type: object
kubernetes:
description: KubernetesUnsealConfig holds the parameters for Kubernetes
Expand Down Expand Up @@ -17010,9 +17009,9 @@ spec:
description: 'VolumeClaimTemplates define some extra Kubernetes PersistentVolumeClaim
templates for the Vault Statefulset. default:'
items:
description: EmbeddedPersistentVolumeClaim is an embeddable version
of k8s.io/api/core/v1.PersistentVolumeClaim. It contains TypeMeta
and a reduced ObjectMeta.
description: EmbeddedPersistentVolumeClaim is an embeddable and
controller-gen friendly version of k8s.io/api/core/v1.PersistentVolumeClaim.
It contains TypeMeta and a reduced ObjectMeta.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this
Expand Down Expand Up @@ -18691,8 +18690,6 @@ spec:
type: array
required:
- config
- serviceRegistrationEnabled
- vaultContainerSpec
type: object
status:
description: VaultStatus defines the observed state of Vault
Expand Down
6 changes: 3 additions & 3 deletions operator/pkg/apis/vault/v1alpha1/vault_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ type VaultSpec struct {
// VaultContainerSpec is a Kubernetes Container specification snippet that will be merged into the operator generated
// Vault Container specification.
// default:
VaultContainerSpec v1.Container `json:"vaultContainerSpec"`
VaultContainerSpec v1.Container `json:"vaultContainerSpec,omitempty"`

// VaultConfigurerAnnotations define a set of Kubernetes annotations that will be added to the Vault Configurer Pod.
// default:
Expand Down Expand Up @@ -244,7 +244,7 @@ type VaultSpec struct {
// serviceRegistrationEnabled enables the injection of the service_registration Vault stanza.
// This requires elaborated RBAC privileges for updating Pod labels for the Vault Pod.
// default: false
ServiceRegistrationEnabled bool `json:"serviceRegistrationEnabled"`
ServiceRegistrationEnabled bool `json:"serviceRegistrationEnabled,omitempty"`

// RaftLeaderAddress defines the leader address of the raft cluster in multi-cluster deployments.
// (In single cluster (namespace) deployments it is automatically detected).
Expand Down Expand Up @@ -1117,7 +1117,7 @@ type VaultUnsealConfig struct {
type HSMUnsealConfig struct {
Daemon bool `json:"daemon,omitempty"`
ModulePath string `json:"modulePath"`
SlotID uint `json:"slotId"`
SlotID uint `json:"slotId,omitempty"`
TokenLabel string `json:"tokenLabel,omitempty"`
Pin string `json:"pin"`
KeyLabel string `json:"keyLabel"`
Expand Down

0 comments on commit 17a299d

Please sign in to comment.