Skip to content

Commit

Permalink
Improve ClusterServiceVersion schema. (#168)
Browse files Browse the repository at this point in the history
Add descriptions for kind, name, and version properties of APIResourceReference type as well as DisplayName, Description, Keywords, Maintainers, Provider, Links, and Icon properties of ClusterServiceVersionSpec.
  • Loading branch information
TheRealJon committed Mar 28, 2023
1 parent 0131a63 commit 36145b1
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 16 deletions.
27 changes: 23 additions & 4 deletions crds/operators.coreos.com_clusterserviceversions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,18 +119,21 @@ spec:
resources:
type: array
items:
description: APIResourceReference is a Kubernetes resource type used by a custom resource
description: APIResourceReference is a reference to a Kubernetes resource type that the referrer utilizes.
type: object
required:
- kind
- name
- version
properties:
kind:
description: Kind of the referenced resource type.
type: string
name:
description: Plural name of the referenced resource type (CustomResourceDefinition.Spec.Names[].Plural). Empty string if the referenced resource type is not a custom resource.
type: string
version:
description: API Version of the referenced resource type.
type: string
specDescriptors:
type: array
Expand Down Expand Up @@ -229,18 +232,21 @@ spec:
resources:
type: array
items:
description: APIResourceReference is a Kubernetes resource type used by a custom resource
description: APIResourceReference is a reference to a Kubernetes resource type that the referrer utilizes.
type: object
required:
- kind
- name
- version
properties:
kind:
description: Kind of the referenced resource type.
type: string
name:
description: Plural name of the referenced resource type (CustomResourceDefinition.Spec.Names[].Plural). Empty string if the referenced resource type is not a custom resource.
type: string
version:
description: API Version of the referenced resource type.
type: string
specDescriptors:
type: array
Expand Down Expand Up @@ -343,18 +349,21 @@ spec:
resources:
type: array
items:
description: APIResourceReference is a Kubernetes resource type used by a custom resource
description: APIResourceReference is a reference to a Kubernetes resource type that the referrer utilizes.
type: object
required:
- kind
- name
- version
properties:
kind:
description: Kind of the referenced resource type.
type: string
name:
description: Plural name of the referenced resource type (CustomResourceDefinition.Spec.Names[].Plural). Empty string if the referenced resource type is not a custom resource.
type: string
version:
description: API Version of the referenced resource type.
type: string
specDescriptors:
type: array
Expand Down Expand Up @@ -445,18 +454,21 @@ spec:
resources:
type: array
items:
description: APIResourceReference is a Kubernetes resource type used by a custom resource
description: APIResourceReference is a reference to a Kubernetes resource type that the referrer utilizes.
type: object
required:
- kind
- name
- version
properties:
kind:
description: Kind of the referenced resource type.
type: string
name:
description: Plural name of the referenced resource type (CustomResourceDefinition.Spec.Names[].Plural). Empty string if the referenced resource type is not a custom resource.
type: string
version:
description: API Version of the referenced resource type.
type: string
specDescriptors:
type: array
Expand Down Expand Up @@ -505,10 +517,13 @@ spec:
version:
type: string
description:
description: Description of the operator. Can include the features, limitations or use-cases of the operator.
type: string
displayName:
description: The name of the operator in display format.
type: string
icon:
description: The icon for this operator.
type: array
items:
type: object
Expand Down Expand Up @@ -4908,6 +4923,7 @@ spec:
description: InstallModeType is a supported type of install mode for CSV installation
type: string
keywords:
description: A list of keywords describing the operator.
type: array
items:
type: string
Expand All @@ -4917,6 +4933,7 @@ spec:
additionalProperties:
type: string
links:
description: A list of links related to the operator.
type: array
items:
type: object
Expand All @@ -4926,6 +4943,7 @@ spec:
url:
type: string
maintainers:
description: A list of organizational entities maintaining the operator.
type: array
items:
type: object
Expand Down Expand Up @@ -4955,6 +4973,7 @@ spec:
version:
type: string
provider:
description: The publishing entity behind the operator.
type: object
properties:
name:
Expand Down
2 changes: 1 addition & 1 deletion crds/zz_defs.go

Large diffs are not rendered by default.

45 changes: 34 additions & 11 deletions pkg/operators/v1alpha1/clusterserviceversion_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,13 @@ type APIServiceDescription struct {
ActionDescriptor []ActionDescriptor `json:"actionDescriptors,omitempty"`
}

// APIResourceReference is a Kubernetes resource type used by a custom resource
// +k8s:openapi-gen=true
// APIResourceReference is a reference to a Kubernetes resource type that the referrer utilizes.
type APIResourceReference struct {
Name string `json:"name"`
Kind string `json:"kind"`
// Plural name of the referenced resource type (CustomResourceDefinition.Spec.Names[].Plural). Empty string if the referenced resource type is not a custom resource.
Name string `json:"name"`
// Kind of the referenced resource type.
Kind string `json:"kind"`
// API Version of the referenced resource type.
Version string `json:"version"`
}

Expand Down Expand Up @@ -279,13 +281,34 @@ type ClusterServiceVersionSpec struct {
WebhookDefinitions []WebhookDescription `json:"webhookdefinitions,omitempty"`
NativeAPIs []metav1.GroupVersionKind `json:"nativeAPIs,omitempty"`
MinKubeVersion string `json:"minKubeVersion,omitempty"`
DisplayName string `json:"displayName"`
Description string `json:"description,omitempty"`
Keywords []string `json:"keywords,omitempty"`
Maintainers []Maintainer `json:"maintainers,omitempty"`
Provider AppLink `json:"provider,omitempty"`
Links []AppLink `json:"links,omitempty"`
Icon []Icon `json:"icon,omitempty"`

// The name of the operator in display format.
DisplayName string `json:"displayName"`

// Description of the operator. Can include the features, limitations or use-cases of the
// operator.
// +optional
Description string `json:"description,omitempty"`

// A list of keywords describing the operator.
// +optional
Keywords []string `json:"keywords,omitempty"`

// A list of organizational entities maintaining the operator.
// +optional
Maintainers []Maintainer `json:"maintainers,omitempty"`

// The publishing entity behind the operator.
// +optional
Provider AppLink `json:"provider,omitempty"`

// A list of links related to the operator.
// +optional
Links []AppLink `json:"links,omitempty"`

// The icon for this operator.
// +optional
Icon []Icon `json:"icon,omitempty"`

// InstallModes specify supported installation types
// +optional
Expand Down

0 comments on commit 36145b1

Please sign in to comment.