Skip to content

Commit 4f1219c

Browse files
authored
rename Catalog to ClusterCatalog (#268)
Signed-off-by: everettraven <[email protected]>
1 parent b68cda4 commit 4f1219c

20 files changed

+241
-241
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ clean: ## Remove binaries and test artifacts
5555
.PHONY: generate
5656
generate: $(CONTROLLER_GEN) ## Generate code and manifests.
5757
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."
58-
$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/base/crd/bases
58+
$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/base/crd/bases output:rbac:artifacts:config=config/base/rbac
5959

6060
.PHONY: fmt
6161
fmt: ## Run go fmt against code.

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ Procedure steps marked with an asterisk (`*`) are likely to change with future A
1414

1515
1. To install catalogd, navigate to the [releases](https://github.com/operator-framework/catalogd/releases/) page, and follow the install instructions included in the release you want to install.
1616

17-
1. Create a `Catalog` object that points to the OperatorHub Community catalog by running the following command:
17+
1. Create a `ClusterCatalog` object that points to the OperatorHub Community catalog by running the following command:
1818

1919
```sh
2020
$ kubectl apply -f - << EOF
2121
apiVersion: catalogd.operatorframework.io/v1alpha1
22-
kind: Catalog
22+
kind: ClusterCatalog
2323
metadata:
2424
name: operatorhubio
2525
spec:
@@ -30,10 +30,10 @@ Procedure steps marked with an asterisk (`*`) are likely to change with future A
3030
EOF
3131
```
3232
33-
1. Verify the `Catalog` object was created successfully by running the following command:
33+
1. Verify the `ClusterCatalog` object was created successfully by running the following command:
3434
3535
```sh
36-
$ kubectl describe catalog/operatorhubio
36+
$ kubectl describe clustercatalog/operatorhubio
3737
```
3838
3939
*Example output*
@@ -43,7 +43,7 @@ Procedure steps marked with an asterisk (`*`) are likely to change with future A
4343
Labels: <none>
4444
Annotations: <none>
4545
API Version: catalogd.operatorframework.io/v1alpha1
46-
Kind: Catalog
46+
Kind: ClusterCatalog
4747
Metadata:
4848
Creation Timestamp: 2023-06-23T18:35:13Z
4949
Generation: 1

api/core/v1alpha1/catalog_types.go renamed to api/core/v1alpha1/clustercatalog_types.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -50,36 +50,36 @@ const (
5050
//+kubebuilder:printcolumn:name="Phase",type=string,JSONPath=`.status.phase`
5151
//+kubebuilder:printcolumn:name=Age,type=date,JSONPath=`.metadata.creationTimestamp`
5252

53-
// Catalog is the Schema for the Catalogs API
54-
type Catalog struct {
53+
// ClusterCatalog is the Schema for the ClusterCatalogs API
54+
type ClusterCatalog struct {
5555
metav1.TypeMeta `json:",inline"`
5656
metav1.ObjectMeta `json:"metadata,omitempty"`
5757

58-
Spec CatalogSpec `json:"spec,omitempty"`
59-
Status CatalogStatus `json:"status,omitempty"`
58+
Spec ClusterCatalogSpec `json:"spec,omitempty"`
59+
Status ClusterCatalogStatus `json:"status,omitempty"`
6060
}
6161

6262
//+kubebuilder:object:root=true
6363

64-
// CatalogList contains a list of Catalog
65-
type CatalogList struct {
64+
// ClusterCatalogList contains a list of ClusterCatalog
65+
type ClusterCatalogList struct {
6666
metav1.TypeMeta `json:",inline"`
6767
metav1.ListMeta `json:"metadata,omitempty"`
6868

69-
Items []Catalog `json:"items"`
69+
Items []ClusterCatalog `json:"items"`
7070
}
7171

72-
// CatalogSpec defines the desired state of Catalog
72+
// ClusterCatalogSpec defines the desired state of ClusterCatalog
7373
// +kubebuilder:validation:XValidation:rule="!has(self.source.image.pollInterval) || (self.source.image.ref.find('@sha256:') == \"\")",message="cannot specify PollInterval while using digest-based image"
74-
type CatalogSpec struct {
74+
type ClusterCatalogSpec struct {
7575
// Source is the source of a Catalog that contains Operators' metadata in the FBC format
7676
// https://olm.operatorframework.io/docs/reference/file-based-catalogs/#docs
7777
Source CatalogSource `json:"source"`
7878
}
7979

80-
// CatalogStatus defines the observed state of Catalog
81-
type CatalogStatus struct {
82-
// Conditions store the status conditions of the Catalog instances
80+
// ClusterCatalogStatus defines the observed state of ClusterCatalog
81+
type ClusterCatalogStatus struct {
82+
// Conditions store the status conditions of the ClusterCatalog instances
8383
Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
8484

8585
// ResolvedSource contains information about the resolved source
@@ -90,8 +90,8 @@ type CatalogStatus struct {
9090
// ContentURL is a cluster-internal address that on-cluster components
9191
// can read the content of a catalog from
9292
ContentURL string `json:"contentURL,omitempty"`
93-
// observedGeneration is the most recent generation observed for this Catalog. It corresponds to the
94-
// Catalog's generation, which is updated on mutation by the API Server.
93+
// observedGeneration is the most recent generation observed for this ClusterCatalog. It corresponds to the
94+
// ClusterCatalog's generation, which is updated on mutation by the API Server.
9595
// +optional
9696
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
9797
}
@@ -145,5 +145,5 @@ type ImageSource struct {
145145
}
146146

147147
func init() {
148-
SchemeBuilder.Register(&Catalog{}, &CatalogList{})
148+
SchemeBuilder.Register(&ClusterCatalog{}, &ClusterCatalogList{})
149149
}

api/core/v1alpha1/catalog_types_test.go renamed to api/core/v1alpha1/clustercatalog_types_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ import (
2020
)
2121

2222
func TestPollIntervalCELValidationRules(t *testing.T) {
23-
validators := fieldValidatorsFromFile(t, "../../../config/base/crd/bases/catalogd.operatorframework.io_catalogs.yaml")
23+
validators := fieldValidatorsFromFile(t, "../../../config/base/crd/bases/catalogd.operatorframework.io_clustercatalogs.yaml")
2424
pth := "openAPIV3Schema.properties.spec"
2525
validator, found := validators["v1alpha1"][pth]
2626
assert.True(t, found)
2727

2828
for name, tc := range map[string]struct {
29-
spec CatalogSpec
29+
spec ClusterCatalogSpec
3030
wantErrs []string
3131
}{
3232
"digest based image ref, poll interval not allowed, poll interval specified": {
33-
spec: CatalogSpec{
33+
spec: ClusterCatalogSpec{
3434
Source: CatalogSource{
3535
Type: SourceTypeImage,
3636
Image: &ImageSource{
@@ -44,7 +44,7 @@ func TestPollIntervalCELValidationRules(t *testing.T) {
4444
},
4545
},
4646
"digest based image ref, poll interval not allowed, poll interval not specified": {
47-
spec: CatalogSpec{
47+
spec: ClusterCatalogSpec{
4848
Source: CatalogSource{
4949
Type: SourceTypeImage,
5050
Image: &ImageSource{

api/core/v1alpha1/zz_generated.deepcopy.go

Lines changed: 39 additions & 39 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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,12 +180,12 @@ func main() {
180180
os.Exit(1)
181181
}
182182

183-
if err = (&corecontrollers.CatalogReconciler{
183+
if err = (&corecontrollers.ClusterCatalogReconciler{
184184
Client: mgr.GetClient(),
185185
Unpacker: unpacker,
186186
Storage: localStorage,
187187
}).SetupWithManager(mgr); err != nil {
188-
setupLog.Error(err, "unable to create controller", "controller", "Catalog")
188+
setupLog.Error(err, "unable to create controller", "controller", "ClusterCatalog")
189189
os.Exit(1)
190190
}
191191
//+kubebuilder:scaffold:builder

config/base/crd/bases/catalogd.operatorframework.io_catalogs.yaml renamed to config/base/crd/bases/catalogd.operatorframework.io_clustercatalogs.yaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ kind: CustomResourceDefinition
44
metadata:
55
annotations:
66
controller-gen.kubebuilder.io/version: v0.14.0
7-
name: catalogs.catalogd.operatorframework.io
7+
name: clustercatalogs.catalogd.operatorframework.io
88
spec:
99
group: catalogd.operatorframework.io
1010
names:
11-
kind: Catalog
12-
listKind: CatalogList
13-
plural: catalogs
14-
singular: catalog
11+
kind: ClusterCatalog
12+
listKind: ClusterCatalogList
13+
plural: clustercatalogs
14+
singular: clustercatalog
1515
scope: Cluster
1616
versions:
1717
- additionalPrinterColumns:
@@ -24,7 +24,7 @@ spec:
2424
name: v1alpha1
2525
schema:
2626
openAPIV3Schema:
27-
description: Catalog is the Schema for the Catalogs API
27+
description: ClusterCatalog is the Schema for the ClusterCatalogs API
2828
properties:
2929
apiVersion:
3030
description: |-
@@ -44,7 +44,7 @@ spec:
4444
metadata:
4545
type: object
4646
spec:
47-
description: CatalogSpec defines the desired state of Catalog
47+
description: ClusterCatalogSpec defines the desired state of ClusterCatalog
4848
properties:
4949
source:
5050
description: |-
@@ -96,10 +96,10 @@ spec:
9696
rule: '!has(self.source.image.pollInterval) || (self.source.image.ref.find(''@sha256:'')
9797
== "")'
9898
status:
99-
description: CatalogStatus defines the observed state of Catalog
99+
description: ClusterCatalogStatus defines the observed state of ClusterCatalog
100100
properties:
101101
conditions:
102-
description: Conditions store the status conditions of the Catalog
102+
description: Conditions store the status conditions of the ClusterCatalog
103103
instances
104104
items:
105105
description: "Condition contains details for one aspect of the current
@@ -176,8 +176,8 @@ spec:
176176
type: string
177177
observedGeneration:
178178
description: |-
179-
observedGeneration is the most recent generation observed for this Catalog. It corresponds to the
180-
Catalog's generation, which is updated on mutation by the API Server.
179+
observedGeneration is the most recent generation observed for this ClusterCatalog. It corresponds to the
180+
ClusterCatalog's generation, which is updated on mutation by the API Server.
181181
format: int64
182182
type: integer
183183
phase:

config/base/crd/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# since it depends on service name and namespace that are out of this kustomize package.
33
# It should be run by config/default
44
resources:
5-
- bases/catalogd.operatorframework.io_catalogs.yaml
5+
- bases/catalogd.operatorframework.io_clustercatalogs.yaml
66
#+kubebuilder:scaffold:crdkustomizeresource
77

88
patches:

0 commit comments

Comments
 (0)