Skip to content

Add Channel to Operator API #171

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

Merged
merged 1 commit into from
Apr 17, 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
5 changes: 5 additions & 0 deletions api/v1alpha1/operator_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ type OperatorSpec struct {
//
// For more information on semver, please see https://semver.org/
Version string `json:"version,omitempty"`

//+kubebuilder:validation:MaxLength:=48
//+kubebuilder:validation:Pattern:=^[a-z0-9]+(-[a-z0-9]+)*$
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 on a super-well-defined pattern for channel name. Not important for this particular PR, but we should probably make sure opm agrees with this pattern (e.g. as part of opm validate)

// Channel constraint defintion
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: it might be nice to beef this up a little bit with a narrative about how the channel constraint works.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can do that once I actually implement it in the next PR

Channel string `json:"channel,omitempty"`
}

const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ spec:
spec:
description: OperatorSpec defines the desired state of Operator
properties:
channel:
description: Channel constraint defintion
maxLength: 48
pattern: ^[a-z0-9]+(-[a-z0-9]+)*$
type: string
packageName:
maxLength: 48
pattern: ^[a-z0-9]+(-[a-z0-9]+)*$
Expand Down