Skip to content

Commit

Permalink
final walkthrough before resubmission
Browse files Browse the repository at this point in the history
Signed-off-by: everettraven <[email protected]>
  • Loading branch information
everettraven committed Nov 4, 2024
1 parent 399a851 commit 671ff24
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 14 deletions.
32 changes: 21 additions & 11 deletions api/core/v1alpha1/clustercatalog_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ type ClusterCatalog struct {
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
metav1.ObjectMeta `json:"metadata"`

// spec is the desired state of the ClusterCatalog. The controller will work
// to ensure that the desired catalog is unpacked and served over the catalog content HTTP server.
// spec is the desired state of the ClusterCatalog.
// spec is required.
// The controller will work to ensure that the desired
// catalog is unpacked and served over the catalog content HTTP server.
// +kubebuilder:validation:Required
Spec ClusterCatalogSpec `json:"spec"`

Expand All @@ -88,7 +90,8 @@ type ClusterCatalogList struct {
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
metav1.ListMeta `json:"metadata"`

// items is a list of ClusterCatalogs
// items is a list of ClusterCatalogs.
// items is required.
// +kubebuilder:validation:Required
Items []ClusterCatalog `json:"items"`
}
Expand All @@ -99,6 +102,8 @@ type ClusterCatalogSpec struct {
// A "catalog" contains information on content that can be installed on a cluster.
// Providing a catalog source makes the contents of the catalog discoverable and usable by
// other on-cluster components.
// These on-cluster components may do a variety of things with this information, such as
// presenting the content in a GUI dashboard or installing content from the catalog on the cluster.
// The catalog source must contain catalog metadata in the File-Based Catalog (FBC) format.
// For more information on FBC, see https://olm.operatorframework.io/docs/reference/file-based-catalogs/#docs.
// source is a required field.
Expand All @@ -117,7 +122,7 @@ type ClusterCatalogSpec struct {
// priority is optional.
//
// A ClusterCatalog's priority is used by clients as a tie-breaker between ClusterCatalogs that meet the client's requirements.
// It is up to clients to decide how to handle scenarios where multiple ClusterCatalogs with the same priority meet
// It is up to clients to decide how to handle scenarios where multiple ClusterCatalogs with the same priority meet their requirements.
// For example, in the case where multiple ClusterCatalogs provide the same bundle.
// A higher number means higher priority.
//
Expand All @@ -126,7 +131,12 @@ type ClusterCatalogSpec struct {
// Negative numbers can be used to specify a priority lower than the default.
// Positive numbers can be used to specify a priority higher than the default.
//
// The lowest possible value is -2147483648.
// The highest possible value is 214748647.
//
// +kubebuilder:default:=0
// +kubebuilder:validation:minimum:=-2147483648
// +kubebuilder:validation:maximum:=214748647
// +optional
Priority int32 `json:"priority"`

Expand All @@ -146,8 +156,8 @@ type ClusterCatalogSpec struct {
// Setting the availabilityMode to "Unavailable" can be useful in scenarios where a user may not want
// to delete the ClusterCatalog all together, but would still like it to be treated as if it doesn't exist.
//
// +kubebuilder:validation:Enum="Unavailable";"Available"
// +kubebuilder:default="Available"
// +kubebuilder:validation:Enum:="Unavailable";"Available"
// +kubebuilder:default:="Available"
// +optional
AvailabilityMode AvailabilityMode `json:"availabilityMode,omitempty"`
}
Expand Down Expand Up @@ -183,7 +193,7 @@ type ClusterCatalogStatus struct {
// urls contains the URLs that can be used to access the catalog.
// +optional
URLs *ClusterCatalogURLs `json:"urls,omitempty"`
// lastUnpacked represents the time when the contents of the
// lastUnpacked represents the last time the contents of the
// catalog were extracted from their source format. As an example,
// when using an Image source, the OCI image will be pulled and the
// image layers written to a file-system backed cache. We refer to the
Expand Down Expand Up @@ -213,7 +223,7 @@ type ClusterCatalogURLs struct {
// REST API may be added.
//
// +kubebuilder:validation:Required
// +kubebuilder:validation:MaxLength:525
// +kubebuilder:validation:MaxLength:=525
Base string `json:"base"`
}

Expand Down Expand Up @@ -270,7 +280,7 @@ type ResolvedImageSource struct {
// The digest format is used so users can use other tooling to fetch the exact
// OCI manifests that were used to extract the catalog contents.
// +kubebuilder:validation:Required
// +kubebuilder:validation:MaxLength:1000
// +kubebuilder:validation:MaxLength:=1000
Ref string `json:"ref"`
}

Expand Down Expand Up @@ -320,15 +330,15 @@ type ImageSource struct {
// An example of a valid tag-based image reference is "quay.io/operatorhubio/catalog:latest"
//
// +kubebuilder:validation:Required
// +kubebuilder:validation:MaxLength:1000
// +kubebuilder:validation:MaxLength:=1000
Ref string `json:"ref"`

// pollIntervalMinutes allows the user to set the interval, in minutes, at which the image source should be polled for new content.
// pollIntervalMinutes is optional.
// pollIntervalMinutes can not be specified when ref is a digest-based reference.
//
// When omitted, the image will not be polled for new content.
// +kubebuilder:validation:Minimum:1
// +kubebuilder:validation:Minimum:=1
// +optional
PollIntervalMinutes *int `json:"pollIntervalMinutes,omitempty"`
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ spec:
type: object
spec:
description: |-
spec is the desired state of the ClusterCatalog. The controller will work
to ensure that the desired catalog is unpacked and served over the catalog content HTTP server.
spec is the desired state of the ClusterCatalog.
spec is required.
The controller will work to ensure that the desired
catalog is unpacked and served over the catalog content HTTP server.
properties:
availabilityMode:
default: Available
Expand Down Expand Up @@ -82,14 +84,17 @@ spec:
priority is optional.
A ClusterCatalog's priority is used by clients as a tie-breaker between ClusterCatalogs that meet the client's requirements.
It is up to clients to decide how to handle scenarios where multiple ClusterCatalogs with the same priority meet
It is up to clients to decide how to handle scenarios where multiple ClusterCatalogs with the same priority meet their requirements.
For example, in the case where multiple ClusterCatalogs provide the same bundle.
A higher number means higher priority.
When omitted, the default priority is 0 because that is the zero value of integers.
Negative numbers can be used to specify a priority lower than the default.
Positive numbers can be used to specify a priority higher than the default.
The lowest possible value is -2147483648.
The highest possible value is 214748647.
format: int32
type: integer
source:
Expand All @@ -98,6 +103,8 @@ spec:
A "catalog" contains information on content that can be installed on a cluster.
Providing a catalog source makes the contents of the catalog discoverable and usable by
other on-cluster components.
These on-cluster components may do a variety of things with this information, such as
presenting the content in a GUI dashboard or installing content from the catalog on the cluster.
The catalog source must contain catalog metadata in the File-Based Catalog (FBC) format.
For more information on FBC, see https://olm.operatorframework.io/docs/reference/file-based-catalogs/#docs.
source is a required field.
Expand All @@ -121,6 +128,7 @@ spec:
pollIntervalMinutes can not be specified when ref is a digest-based reference.
When omitted, the image will not be polled for new content.
minimum: 1
type: integer
ref:
description: |-
Expand Down Expand Up @@ -161,6 +169,7 @@ spec:
An example of a valid digest-based image reference is "quay.io/operatorhubio/catalog@sha256:200d4ddb2a73594b91358fe6397424e975205bfbe44614f5846033cad64b3f05"
An example of a valid tag-based image reference is "quay.io/operatorhubio/catalog:latest"
maxLength: 1000
type: string
required:
- ref
Expand Down Expand Up @@ -311,6 +320,7 @@ spec:
ref contains the resolved image digest-based reference.
The digest format is used so users can use other tooling to fetch the exact
OCI manifests that were used to extract the catalog contents.
maxLength: 1000
type: string
required:
- ref
Expand Down Expand Up @@ -364,6 +374,7 @@ spec:
As the needs of users and clients of the REST API evolve, new versions of the
REST API may be added.
maxLength: 525
type: string
required:
- base
Expand Down

0 comments on commit 671ff24

Please sign in to comment.