Pruning unknown fields (#2187)
* Pruning unknown fields In CRD apiversion v1beta1, default preserveUnknownFields=true. In CRD apiversion v1, the preserveUnknownFields can only be false. Otherwise, the k8s validation bumps out error message for the invalid preserveUnknownFields value. Deploy Velero on k8s 1.16+ with CRD apiversion v1beta1, the k8s cluster converts apiversion from v1beta1 to v1 automatically. Fully backup and restore the cluster, restore bumps out error message due to the preserveUnknownFields=true is not allowed on k8s 1.16+. Since the CRD structural schema had been defined, enable the preserveUnknownFields to false to solves the restore bumps out error message on k8s 1.16+. Signed-off-by: JenTing Hsiao <jenting.hsiao@suse.com> * Add changelog Signed-off-by: JenTing Hsiao <jenting.hsiao@suse.com>pull/2229/head
parent
f00922ddf1
commit
b19097f825
|
@ -0,0 +1 @@
|
|||
Enable pruning unknown CRD fields
|
|
@ -27,7 +27,7 @@ WORKDIR /go/src/k8s.io/code-generator
|
|||
RUN GO111MODULE=on go mod vendor
|
||||
RUN mkdir -p /go/src/sigs.k8s.io
|
||||
WORKDIR /go/src/sigs.k8s.io
|
||||
RUN git clone -b v0.2.2 https://github.com/kubernetes-sigs/controller-tools
|
||||
RUN git clone -b v0.2.4 https://github.com/kubernetes-sigs/controller-tools
|
||||
WORKDIR /go/src/sigs.k8s.io/controller-tools
|
||||
RUN GO111MODULE=on go mod vendor
|
||||
RUN go get golang.org/x/tools/cmd/goimports
|
||||
|
|
|
@ -42,7 +42,7 @@ ${GOPATH}/src/k8s.io/code-generator/generate-groups.sh \
|
|||
$@
|
||||
|
||||
go run ${GOPATH}/src/sigs.k8s.io/controller-tools/cmd/controller-gen/main.go \
|
||||
crd \
|
||||
crd:crdVersions=v1beta1,preserveUnknownFields=false \
|
||||
output:dir=pkg/generated/crds/manifests \
|
||||
paths=./pkg/apis/velero/v1/...
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -14,7 +14,8 @@ spec:
|
|||
listKind: BackupList
|
||||
plural: backups
|
||||
singular: backup
|
||||
scope: ""
|
||||
preserveUnknownFields: false
|
||||
scope: Namespaced
|
||||
validation:
|
||||
openAPIV3Schema:
|
||||
description: Backup is a Velero resource that respresents the capture of Kubernetes
|
||||
|
|
|
@ -14,7 +14,8 @@ spec:
|
|||
listKind: BackupStorageLocationList
|
||||
plural: backupstoragelocations
|
||||
singular: backupstoragelocation
|
||||
scope: ""
|
||||
preserveUnknownFields: false
|
||||
scope: Namespaced
|
||||
validation:
|
||||
openAPIV3Schema:
|
||||
description: BackupStorageLocation is a location where Velero stores backup
|
||||
|
|
|
@ -14,7 +14,8 @@ spec:
|
|||
listKind: DeleteBackupRequestList
|
||||
plural: deletebackuprequests
|
||||
singular: deletebackuprequest
|
||||
scope: ""
|
||||
preserveUnknownFields: false
|
||||
scope: Namespaced
|
||||
validation:
|
||||
openAPIV3Schema:
|
||||
description: DeleteBackupRequest is a request to delete one or more backups.
|
||||
|
|
|
@ -14,7 +14,8 @@ spec:
|
|||
listKind: DownloadRequestList
|
||||
plural: downloadrequests
|
||||
singular: downloadrequest
|
||||
scope: ""
|
||||
preserveUnknownFields: false
|
||||
scope: Namespaced
|
||||
validation:
|
||||
openAPIV3Schema:
|
||||
description: DownloadRequest is a request to download an artifact from backup
|
||||
|
|
|
@ -14,7 +14,8 @@ spec:
|
|||
listKind: PodVolumeBackupList
|
||||
plural: podvolumebackups
|
||||
singular: podvolumebackup
|
||||
scope: ""
|
||||
preserveUnknownFields: false
|
||||
scope: Namespaced
|
||||
validation:
|
||||
openAPIV3Schema:
|
||||
properties:
|
||||
|
|
|
@ -14,7 +14,8 @@ spec:
|
|||
listKind: PodVolumeRestoreList
|
||||
plural: podvolumerestores
|
||||
singular: podvolumerestore
|
||||
scope: ""
|
||||
preserveUnknownFields: false
|
||||
scope: Namespaced
|
||||
validation:
|
||||
openAPIV3Schema:
|
||||
properties:
|
||||
|
|
|
@ -14,7 +14,8 @@ spec:
|
|||
listKind: ResticRepositoryList
|
||||
plural: resticrepositories
|
||||
singular: resticrepository
|
||||
scope: ""
|
||||
preserveUnknownFields: false
|
||||
scope: Namespaced
|
||||
validation:
|
||||
openAPIV3Schema:
|
||||
properties:
|
||||
|
|
|
@ -14,7 +14,8 @@ spec:
|
|||
listKind: RestoreList
|
||||
plural: restores
|
||||
singular: restore
|
||||
scope: ""
|
||||
preserveUnknownFields: false
|
||||
scope: Namespaced
|
||||
validation:
|
||||
openAPIV3Schema:
|
||||
description: Restore is a Velero resource that represents the application of
|
||||
|
|
|
@ -14,7 +14,8 @@ spec:
|
|||
listKind: ScheduleList
|
||||
plural: schedules
|
||||
singular: schedule
|
||||
scope: ""
|
||||
preserveUnknownFields: false
|
||||
scope: Namespaced
|
||||
validation:
|
||||
openAPIV3Schema:
|
||||
description: Schedule is a Velero resource that represents a pre-scheduled or
|
||||
|
|
|
@ -14,7 +14,8 @@ spec:
|
|||
listKind: ServerStatusRequestList
|
||||
plural: serverstatusrequests
|
||||
singular: serverstatusrequest
|
||||
scope: ""
|
||||
preserveUnknownFields: false
|
||||
scope: Namespaced
|
||||
validation:
|
||||
openAPIV3Schema:
|
||||
description: ServerStatusRequest is a request to access current status information
|
||||
|
|
|
@ -14,7 +14,8 @@ spec:
|
|||
listKind: VolumeSnapshotLocationList
|
||||
plural: volumesnapshotlocations
|
||||
singular: volumesnapshotlocation
|
||||
scope: ""
|
||||
preserveUnknownFields: false
|
||||
scope: Namespaced
|
||||
validation:
|
||||
openAPIV3Schema:
|
||||
description: VolumeSnapshotLocation is a location where Velero stores volume
|
||||
|
|
Loading…
Reference in New Issue