Skip to content

Commit 9316012

Browse files
authored
rename Operator API to ClusterExtension API (#568)
Signed-off-by: Joe Lanford <joe.lanford@gmail.com>
1 parent 8d428a5 commit 9316012

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1147
-1159
lines changed

.github/workflows/deploy.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ jobs:
2222
run: |
2323
make kind-cluster
2424
make deploy
25-
kubectl get crds operators.operators.operatorframework.io
25+
kubectl get crds clusterextensions.olm.operatorframework.io
2626
kubectl get ns operator-controller-system
2727
make undeploy
2828
! kubectl get ns operator-controller-system
29-
! kubectl get crds operators.operators.operatorframework.io
29+
! kubectl get crds clusterextensions.olm.operatorframework.io

.github/workflows/operator-developer-e2e.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: operator-developer-e2e
1+
name: extension-developer-e2e
22

33
on:
44
workflow_dispatch:
@@ -18,6 +18,6 @@ jobs:
1818
with:
1919
go-version-file: go.mod
2020

21-
- name: Run the operator framework e2e test
21+
- name: Run the extension developer e2e test
2222
run: |
23-
make operator-developer-e2e
23+
make extension-developer-e2e

Makefile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,10 @@ e2e: $(SETUP_ENVTEST) #EXHELP Run the e2e tests.
111111
export REG_PKG_NAME=registry-operator
112112
export PLAIN_PKG_NAME=plain-operator
113113
export CATALOG_IMG=${E2E_REGISTRY_NAME}.${E2E_REGISTRY_NAMESPACE}.svc:5000/test-catalog:e2e
114-
.PHONY: test-op-dev-e2e
115-
test-op-dev-e2e: $(SETUP_ENVTEST) $(OPERATOR_SDK) $(KUSTOMIZE) $(KIND) #HELP Run operator create, upgrade and delete tests.
116-
test/operator-framework-e2e/setup.sh $(OPERATOR_SDK) $(CONTAINER_RUNTIME) $(KUSTOMIZE) $(KIND) $(KIND_CLUSTER_NAME) ${E2E_REGISTRY_NAMESPACE}
117-
eval $$($(SETUP_ENVTEST) use -p env $(ENVTEST_VERSION)) && go test -tags $(GO_BUILD_TAGS) -v ./test/operator-framework-e2e/...
114+
.PHONY: test-ext-dev-e2e
115+
test-ext-dev-e2e: $(SETUP_ENVTEST) $(OPERATOR_SDK) $(KUSTOMIZE) $(KIND) #HELP Run extension create, upgrade and delete tests.
116+
test/extension-developer-e2e/setup.sh $(OPERATOR_SDK) $(CONTAINER_RUNTIME) $(KUSTOMIZE) $(KIND) $(KIND_CLUSTER_NAME) ${E2E_REGISTRY_NAMESPACE}
117+
eval $$($(SETUP_ENVTEST) use -p env $(ENVTEST_VERSION)) && go test -tags $(GO_BUILD_TAGS) -v ./test/extension-developer-e2e/...
118118

119119
.PHONY: test-unit
120120
ENVTEST_VERSION = $(shell go list -m k8s.io/client-go | cut -d" " -f2 | sed 's/^v0\.\([[:digit:]]\{1,\}\)\.[[:digit:]]\{1,\}$$/1.\1.x/')
@@ -136,9 +136,9 @@ test-e2e: KUSTOMIZE_BUILD_DIR=config/e2e
136136
test-e2e: GO_BUILD_FLAGS=-cover
137137
test-e2e: run image-registry build-push-e2e-catalog kind-load-test-artifacts e2e e2e-coverage undeploy kind-clean #HELP Run e2e test suite on local kind cluster
138138

139-
.PHONY: operator-developer-e2e
140-
operator-developer-e2e: KIND_CLUSTER_NAME=operator-controller-op-dev-e2e #EXHELP Run operator-developer e2e on local kind cluster
141-
operator-developer-e2e: run image-registry test-op-dev-e2e kind-clean
139+
.PHONY: extension-developer-e2e
140+
extension-developer-e2e: KIND_CLUSTER_NAME=operator-controller-ext-dev-e2e #EXHELP Run extension-developer e2e on local kind cluster
141+
extension-developer-e2e: run image-registry test-ext-dev-e2e kind-clean
142142

143143
.PHONY: e2e-coverage
144144
e2e-coverage:

PROJECT

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ resources:
99
namespaced: true
1010
controller: true
1111
domain: operatorframework.io
12-
group: operators
13-
kind: Operator
12+
group: olm
13+
kind: ClusterExtension
1414
path: github.com/operator-framework/operator-controller/api/v1alpha1
1515
version: v1alpha1
1616
version: "3"

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# operator-controller
2-
The operator-controller is the central component of Operator Lifecycle Manager (OLM) v1. It extends Kubernetes with an API through which users can install Operators.
2+
The operator-controller is the central component of Operator Lifecycle Manager (OLM) v1. It extends Kubernetes with an API through which users can install extensions.
33

44
## Description
55
OLM v1 is the follow-up to OLM v0, located [here](https://github.com/operator-framework/operator-lifecycle-manager). It consists of four different components, including this one, which are as follows:
@@ -90,4 +90,3 @@ distributed under the License is distributed on an "AS IS" BASIS,
9090
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9191
See the License for the specific language governing permissions and
9292
limitations under the License.
93-

api/v1alpha1/operator_types.go renamed to api/v1alpha1/clusterextension_types.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ import (
2525
type UpgradeConstraintPolicy string
2626

2727
const (
28-
// The operator will only upgrade if the new version satisfies
28+
// The extension will only upgrade if the new version satisfies
2929
// the upgrade constraints set by the package author.
3030
UpgradeConstraintPolicyEnforce UpgradeConstraintPolicy = "Enforce"
3131

32-
// Unsafe option which allows an operator to be
32+
// Unsafe option which allows an extension to be
3333
// upgraded or downgraded to any available version of the package and
3434
// ignore the upgrade path designed by package authors.
3535
// This assumes that users independently verify the outcome of the changes.
@@ -38,8 +38,8 @@ const (
3838
UpgradeConstraintPolicyIgnore UpgradeConstraintPolicy = "Ignore"
3939
)
4040

41-
// OperatorSpec defines the desired state of Operator
42-
type OperatorSpec struct {
41+
// ClusterExtensionSpec defines the desired state of ClusterExtension
42+
type ClusterExtensionSpec struct {
4343
//+kubebuilder:validation:MaxLength:=48
4444
//+kubebuilder:validation:Pattern:=^[a-z0-9]+(-[a-z0-9]+)*$
4545
PackageName string `json:"packageName"`
@@ -101,8 +101,8 @@ func init() {
101101
)
102102
}
103103

104-
// OperatorStatus defines the observed state of Operator
105-
type OperatorStatus struct {
104+
// ClusterExtensionStatus defines the observed state of ClusterExtension
105+
type ClusterExtensionStatus struct {
106106
// +optional
107107
InstalledBundleResource string `json:"installedBundleResource,omitempty"`
108108
// +optional
@@ -119,24 +119,24 @@ type OperatorStatus struct {
119119
//+kubebuilder:resource:scope=Cluster
120120
//+kubebuilder:subresource:status
121121

122-
// Operator is the Schema for the operators API
123-
type Operator struct {
122+
// ClusterExtension is the Schema for the clusterextensions API
123+
type ClusterExtension struct {
124124
metav1.TypeMeta `json:",inline"`
125125
metav1.ObjectMeta `json:"metadata,omitempty"`
126126

127-
Spec OperatorSpec `json:"spec,omitempty"`
128-
Status OperatorStatus `json:"status,omitempty"`
127+
Spec ClusterExtensionSpec `json:"spec,omitempty"`
128+
Status ClusterExtensionStatus `json:"status,omitempty"`
129129
}
130130

131131
//+kubebuilder:object:root=true
132132

133-
// OperatorList contains a list of Operator
134-
type OperatorList struct {
133+
// ClusterExtensionList contains a list of ClusterExtension
134+
type ClusterExtensionList struct {
135135
metav1.TypeMeta `json:",inline"`
136136
metav1.ListMeta `json:"metadata,omitempty"`
137-
Items []Operator `json:"items"`
137+
Items []ClusterExtension `json:"items"`
138138
}
139139

140140
func init() {
141-
SchemeBuilder.Register(&Operator{}, &OperatorList{})
141+
SchemeBuilder.Register(&ClusterExtension{}, &ClusterExtensionList{})
142142
}

api/v1alpha1/operator_types_test.go renamed to api/v1alpha1/clusterextension_types_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
"golang.org/x/exp/slices" // replace with "slices" in go 1.21
1616
)
1717

18-
func TestOperatorTypeRegistration(t *testing.T) {
18+
func TestClusterExtensionTypeRegistration(t *testing.T) {
1919
types, err := parseConstants("Type")
2020
if err != nil {
2121
t.Fatalf("unable to parse Type constants %v", err)
@@ -34,7 +34,7 @@ func TestOperatorTypeRegistration(t *testing.T) {
3434
}
3535
}
3636

37-
func TestOperatorReasonRegistration(t *testing.T) {
37+
func TestClusterExtensionReasonRegistration(t *testing.T) {
3838
reasons, err := parseConstants("Reason")
3939
if err != nil {
4040
t.Fatalf("unable to parse Reason constants %v", err)

api/v1alpha1/groupversion_info.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
// Package v1alpha1 contains API Schema definitions for the operators v1alpha1 API group
17+
// Package v1alpha1 contains API Schema definitions for the olm v1alpha1 API group
1818
// +kubebuilder:object:generate=true
19-
// +groupName=operators.operatorframework.io
19+
// +groupName=olm.operatorframework.io
2020
package v1alpha1
2121

2222
import (
@@ -26,7 +26,7 @@ import (
2626

2727
var (
2828
// GroupVersion is group version used to register these objects
29-
GroupVersion = schema.GroupVersion{Group: "operators.operatorframework.io", Version: "v1alpha1"}
29+
GroupVersion = schema.GroupVersion{Group: "olm.operatorframework.io", Version: "v1alpha1"}
3030

3131
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
3232
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 19 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/manager/main.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import (
3636
"github.com/operator-framework/deppy/pkg/deppy/solver"
3737
rukpakv1alpha1 "github.com/operator-framework/rukpak/api/v1alpha1"
3838

39-
operatorsv1alpha1 "github.com/operator-framework/operator-controller/api/v1alpha1"
39+
ocv1alpha1 "github.com/operator-framework/operator-controller/api/v1alpha1"
4040
"github.com/operator-framework/operator-controller/internal/catalogmetadata/cache"
4141
catalogclient "github.com/operator-framework/operator-controller/internal/catalogmetadata/client"
4242
"github.com/operator-framework/operator-controller/internal/controllers"
@@ -51,7 +51,7 @@ var (
5151
func init() {
5252
utilruntime.Must(clientgoscheme.AddToScheme(scheme))
5353

54-
utilruntime.Must(operatorsv1alpha1.AddToScheme(scheme))
54+
utilruntime.Must(ocv1alpha1.AddToScheme(scheme))
5555
utilruntime.Must(rukpakv1alpha1.AddToScheme(scheme))
5656
utilruntime.Must(catalogd.AddToScheme(scheme))
5757

@@ -115,13 +115,13 @@ func main() {
115115
os.Exit(1)
116116
}
117117

118-
if err = (&controllers.OperatorReconciler{
118+
if err = (&controllers.ClusterExtensionReconciler{
119119
Client: cl,
120120
BundleProvider: catalogClient,
121121
Scheme: mgr.GetScheme(),
122122
Resolver: resolver,
123123
}).SetupWithManager(mgr); err != nil {
124-
setupLog.Error(err, "unable to create controller", "controller", "Operator")
124+
setupLog.Error(err, "unable to create controller", "controller", "ClusterExtension")
125125
os.Exit(1)
126126
}
127127
//+kubebuilder:scaffold:builder

0 commit comments

Comments
 (0)