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

api: mark spec field of CRs as required #288

Merged
merged 1 commit into from
Jan 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion apis/csiaddons/v1alpha1/csiaddonsnode_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ type CSIAddonsNode struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec CSIAddonsNodeSpec `json:"spec,omitempty"`
// +kubebuilder:validation:Required
Spec CSIAddonsNodeSpec `json:"spec"`

Status CSIAddonsNodeStatus `json:"status,omitempty"`
}

Expand Down
4 changes: 3 additions & 1 deletion apis/csiaddons/v1alpha1/networkfence_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ type NetworkFence struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec NetworkFenceSpec `json:"spec,omitempty"`
// +kubebuilder:validation:Required
Spec NetworkFenceSpec `json:"spec"`

Status NetworkFenceStatus `json:"status,omitempty"`
}

Expand Down
6 changes: 4 additions & 2 deletions apis/csiaddons/v1alpha1/reclaimspacecronjob_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
package v1alpha1

import (
"k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

Expand Down Expand Up @@ -123,7 +123,9 @@ type ReclaimSpaceCronJob struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec ReclaimSpaceCronJobSpec `json:"spec,omitempty"`
// +kubebuilder:validation:Required
Spec ReclaimSpaceCronJobSpec `json:"spec"`

Status ReclaimSpaceCronJobStatus `json:"status,omitempty"`
}

Expand Down
4 changes: 3 additions & 1 deletion apis/csiaddons/v1alpha1/reclaimspacejob_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ type ReclaimSpaceJob struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec ReclaimSpaceJobSpec `json:"spec,omitempty"`
// +kubebuilder:validation:Required
Spec ReclaimSpaceJobSpec `json:"spec"`

Status ReclaimSpaceJobStatus `json:"status,omitempty"`
}

Expand Down
4 changes: 3 additions & 1 deletion apis/replication.storage/v1alpha1/volumereplication_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ type VolumeReplication struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec VolumeReplicationSpec `json:"spec,omitempty"`
// +kubebuilder:validation:Required
Spec VolumeReplicationSpec `json:"spec"`

Status VolumeReplicationStatus `json:"status,omitempty"`
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ type VolumeReplicationClass struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec VolumeReplicationClassSpec `json:"spec,omitempty"`
// +kubebuilder:validation:Required
Spec VolumeReplicationClassSpec `json:"spec"`

Status VolumeReplicationClassStatus `json:"status,omitempty"`
}

Expand Down
2 changes: 2 additions & 0 deletions config/crd/bases/csiaddons.openshift.io_csiaddonsnodes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ spec:
CSI Driver.
type: string
type: object
required:
- spec
type: object
served: true
storage: true
Expand Down
2 changes: 2 additions & 0 deletions config/crd/bases/csiaddons.openshift.io_networkfences.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ spec:
operation.
type: string
type: object
required:
- spec
type: object
served: true
storage: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ spec:
format: date-time
type: string
type: object
required:
- spec
type: object
served: true
storage: true
Expand Down
2 changes: 2 additions & 0 deletions config/crd/bases/csiaddons.openshift.io_reclaimspacejobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ spec:
format: date-time
type: string
type: object
required:
- spec
type: object
served: true
storage: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ spec:
description: VolumeReplicationClassStatus defines the observed state of
VolumeReplicationClass.
type: object
required:
- spec
type: object
served: true
storage: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ spec:
description: State captures the latest state of the replication operation.
type: string
type: object
required:
- spec
type: object
served: true
storage: true
Expand Down
12 changes: 12 additions & 0 deletions deploy/controller/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ spec:
CSI Driver.
type: string
type: object
required:
- spec
type: object
served: true
storage: true
Expand Down Expand Up @@ -272,6 +274,8 @@ spec:
operation.
type: string
type: object
required:
- spec
type: object
served: true
storage: true
Expand Down Expand Up @@ -476,6 +480,8 @@ spec:
format: date-time
type: string
type: object
required:
- spec
type: object
served: true
storage: true
Expand Down Expand Up @@ -664,6 +670,8 @@ spec:
format: date-time
type: string
type: object
required:
- spec
type: object
served: true
storage: true
Expand Down Expand Up @@ -741,6 +749,8 @@ spec:
description: VolumeReplicationClassStatus defines the observed state of
VolumeReplicationClass.
type: object
required:
- spec
type: object
served: true
storage: true
Expand Down Expand Up @@ -941,6 +951,8 @@ spec:
description: State captures the latest state of the replication operation.
type: string
type: object
required:
- spec
type: object
served: true
storage: true
Expand Down
12 changes: 12 additions & 0 deletions deploy/controller/install-all-in-one.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ spec:
CSI Driver.
type: string
type: object
required:
- spec
type: object
served: true
storage: true
Expand Down Expand Up @@ -279,6 +281,8 @@ spec:
operation.
type: string
type: object
required:
- spec
type: object
served: true
storage: true
Expand Down Expand Up @@ -483,6 +487,8 @@ spec:
format: date-time
type: string
type: object
required:
- spec
type: object
served: true
storage: true
Expand Down Expand Up @@ -671,6 +677,8 @@ spec:
format: date-time
type: string
type: object
required:
- spec
type: object
served: true
storage: true
Expand Down Expand Up @@ -748,6 +756,8 @@ spec:
description: VolumeReplicationClassStatus defines the observed state of
VolumeReplicationClass.
type: object
required:
- spec
type: object
served: true
storage: true
Expand Down Expand Up @@ -948,6 +958,8 @@ spec:
description: State captures the latest state of the replication operation.
type: string
type: object
required:
- spec
type: object
served: true
storage: true
Expand Down