Skip to content

Commit

Permalink
Fixes olm schema validation for the KubeVirt CR api
Browse files Browse the repository at this point in the history
fixes: kubevirt#5608

Signed-off-by: David Vossel <[email protected]>
  • Loading branch information
davidvossel authored and kubevirt-bot committed May 11, 2021
1 parent c8a5db3 commit b0fceb7
Show file tree
Hide file tree
Showing 10 changed files with 221 additions and 51 deletions.
78 changes: 38 additions & 40 deletions api/openapi-spec/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -7862,45 +7862,6 @@
}
},
"definitions": {
"github.com.openshift.api.operator.v1.GenerationStatus": {
"description": "GenerationStatus keeps track of the generation for a given resource so that decisions about forced updates can be made.",
"type": "object",
"required": [
"group",
"resource",
"namespace",
"name",
"lastGeneration",
"hash"
],
"properties": {
"group": {
"description": "group is the group of the thing you're tracking",
"type": "string"
},
"hash": {
"description": "hash is an optional field set for resources without generation that are content sensitive like secrets and configmaps",
"type": "string"
},
"lastGeneration": {
"description": "lastGeneration is the last generation of the workload controller involved",
"type": "integer",
"format": "int64"
},
"name": {
"description": "name is the name of the thing you're tracking",
"type": "string"
},
"namespace": {
"description": "namespace is where the thing you're tracking is",
"type": "string"
},
"resource": {
"description": "resource is the resource type of the thing you're tracking",
"type": "string"
}
}
},
"k8s.io.api.core.v1.Affinity": {
"description": "Affinity is a group of affinity scheduling rules.",
"type": "object",
Expand Down Expand Up @@ -10029,6 +9990,43 @@
}
}
},
"v1.GenerationStatus": {
"description": "GenerationStatus keeps track of the generation for a given resource so that decisions about forced updates can be made.",
"type": "object",
"required": [
"group",
"resource",
"name",
"lastGeneration"
],
"properties": {
"group": {
"description": "group is the group of the thing you're tracking",
"type": "string"
},
"hash": {
"description": "hash is an optional field set for resources without generation that are content sensitive like secrets and configmaps",
"type": "string"
},
"lastGeneration": {
"description": "lastGeneration is the last generation of the workload controller involved",
"type": "integer",
"format": "int64"
},
"name": {
"description": "name is the name of the thing you're tracking",
"type": "string"
},
"namespace": {
"description": "namespace is where the thing you're tracking is",
"type": "string"
},
"resource": {
"description": "resource is the resource type of the thing you're tracking",
"type": "string"
}
}
},
"v1.GuestAgentCommandInfo": {
"description": "List of commands that QEMU guest agent supports",
"type": "object",
Expand Down Expand Up @@ -10517,7 +10515,7 @@
"generations": {
"type": "array",
"items": {
"$ref": "#/definitions/github.com.openshift.api.operator.v1.GenerationStatus"
"$ref": "#/definitions/v1.GenerationStatus"
},
"x-kubernetes-list-type": "atomic"
},
Expand Down
10 changes: 10 additions & 0 deletions manifests/generated/kv-resource.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1112,6 +1112,11 @@ spec:
resource:
description: resource is the resource type of the thing you're tracking
type: string
required:
- group
- lastGeneration
- name
- resource
type: object
type: array
x-kubernetes-list-type: atomic
Expand Down Expand Up @@ -2240,6 +2245,11 @@ spec:
resource:
description: resource is the resource type of the thing you're tracking
type: string
required:
- group
- lastGeneration
- name
- resource
type: object
type: array
x-kubernetes-list-type: atomic
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1334,6 +1334,11 @@ var CRDsValidation map[string]string = map[string]string{
resource:
description: resource is the resource type of the thing you're tracking
type: string
required:
- group
- lastGeneration
- name
- resource
type: object
type: array
x-kubernetes-list-type: atomic
Expand Down
1 change: 0 additions & 1 deletion staging/src/kubevirt.io/client-go/api/v1/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ go_library(
deps = [
"//staging/src/kubevirt.io/client-go/precond:go_default_library",
"//vendor/github.com/go-openapi/spec:go_default_library",
"//vendor/github.com/openshift/api/operator/v1:go_default_library",
"//vendor/github.com/pborman/uuid:go_default_library",
"//vendor/k8s.io/api/core/v1:go_default_library",
"//vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1:go_default_library",
Expand Down
19 changes: 17 additions & 2 deletions staging/src/kubevirt.io/client-go/api/v1/deepcopy_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

61 changes: 59 additions & 2 deletions staging/src/kubevirt.io/client-go/api/v1/openapi_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 21 additions & 3 deletions staging/src/kubevirt.io/client-go/api/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/types"

operatorsv1 "github.com/openshift/api/operator/v1"

cdiv1 "kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1"
)

Expand Down Expand Up @@ -1502,6 +1500,26 @@ const (
KubeVirtUninstallStrategyBlockUninstallIfWorkloadsExist KubeVirtUninstallStrategy = "BlockUninstallIfWorkloadsExist"
)

// GenerationStatus keeps track of the generation for a given resource so that decisions about forced updates can be made.
//
// +k8s:openapi-gen=true
type GenerationStatus struct {
// group is the group of the thing you're tracking
Group string `json:"group"`
// resource is the resource type of the thing you're tracking
Resource string `json:"resource"`
// namespace is where the thing you're tracking is
// +optional
Namespace string `json:"namespace,omitempty" optional:"true"`
// name is the name of the thing you're tracking
Name string `json:"name"`
// lastGeneration is the last generation of the workload controller involved
LastGeneration int64 `json:"lastGeneration"`
// hash is an optional field set for resources without generation that are content sensitive like secrets and configmaps
// +optional
Hash string `json:"hash,omitempty" optional:"true"`
}

// KubeVirtStatus represents information pertaining to a KubeVirt deployment.
//
// +k8s:openapi-gen=true
Expand All @@ -1519,7 +1537,7 @@ type KubeVirtStatus struct {
ObservedDeploymentID string `json:"observedDeploymentID,omitempty" optional:"true"`
OutdatedVirtualMachineInstanceWorkloads *int `json:"outdatedVirtualMachineInstanceWorkloads,omitempty" optional:"true"`
// +listType=atomic
Generations []operatorsv1.GenerationStatus `json:"generations,omitempty" optional:"true"`
Generations []GenerationStatus `json:"generations,omitempty" optional:"true"`
}

// KubeVirtPhase is a label for the phase of a KubeVirt deployment at the current time.
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b0fceb7

Please sign in to comment.