Skip to content

Commit

Permalink
Operator Spec PackageName (#80)
Browse files Browse the repository at this point in the history
* add package name to spec, clear generated comments, run make, update sample CR

* putting back todo to remind devs to add new fields
  • Loading branch information
dtfranz authored Dec 16, 2022
1 parent f29fb01 commit 30416f2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 15 deletions.
16 changes: 4 additions & 12 deletions api/v1alpha1/operator_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,15 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.

// OperatorSpec defines the desired state of Operator
type OperatorSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file

// 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]+)*$
PackageName string `json:"packageName"`
}

// OperatorStatus defines the observed state of Operator
type OperatorStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
}
type OperatorStatus struct{}

//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@ spec:
spec:
description: OperatorSpec defines the desired state of Operator
properties:
foo:
description: Foo is an example field of Operator. Edit operator_types.go
to remove/update
packageName:
maxLength: 48
pattern: ^[a-z0-9]+(-[a-z0-9]+)*$
type: string
required:
- packageName
type: object
status:
description: OperatorStatus defines the observed state of Operator
Expand Down
1 change: 1 addition & 0 deletions config/samples/operators_v1alpha1_operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ metadata:
name: operator-sample
spec:
# TODO(user): Add fields here
packageName: my-operator

0 comments on commit 30416f2

Please sign in to comment.