Skip to content
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

Operator Spec PackageName #80

Merged
merged 2 commits into from
Dec 16, 2022

Conversation

dtfranz
Copy link
Contributor

@dtfranz dtfranz commented Dec 14, 2022

Addresses Issue #69
Add package name to spec with validation, clear generated comments, run make, update sample CR

Tested by running:

kind create cluster
make install
kubectl apply -f config/samples/operators_v1alpha1_operator.yaml

@@ -9,4 +9,4 @@ metadata:
app.kubernetes.io/created-by: operator-controller
name: operator-sample
spec:
# TODO(user): Add fields here
Copy link
Contributor

Choose a reason for hiding this comment

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

Keep the TODO comment for future field adders?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

to remove/update
packageName:
maxLength: 48
pattern: ^[a-z0-9]+(-[a-z0-9]+)*$
Copy link
Contributor

Choose a reason for hiding this comment

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

Rules out camelCase, but I did see the discussion that this matches all current catalogs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True, but I think there's a good chance we'll be generating cluster resources with these names, and if that's the case we'd need to restrict camel case anyway

Copy link
Contributor

@tmshort tmshort left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Dec 15, 2022
@tmshort
Copy link
Contributor

tmshort commented Dec 15, 2022

/approve

@tmshort tmshort added approved Indicates a PR has been approved by an approver from all required OWNERS files. and removed lgtm Indicates that a PR is ready to be merged. labels Dec 15, 2022
// Foo is an example field of Operator. Edit operator_types.go to remove/update
Foo string `json:"foo,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.

Should we support a packageName that starts with a number?

Copy link
Member

Choose a reason for hiding this comment

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

hmm, 3scale operator jumps to mind.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup, that's exactly why I allowed the numeral in there

@tmshort
Copy link
Contributor

tmshort commented Dec 15, 2022

Any other approval needed? @awgreene ?

@tmshort tmshort merged commit 30416f2 into operator-framework:main Dec 16, 2022
@tmshort
Copy link
Contributor

tmshort commented Dec 16, 2022

Merged. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants