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

Rename CatalogSource to Catalog #60

Merged
merged 7 commits into from
May 15, 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
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,12 @@ install: docker-build-controller kind-load deploy wait ## Install local catalogd
# TODO: When the apiserver is working properly, add this line back after the manager edit:
# cd config/apiserver && $(KUSTOMIZE) edit set image apiserver=${SERVER_IMG}:${IMG_TAG}
.PHONY: deploy
deploy: kustomize ## Deploy CatalogSource controller and ApiServer to the K8s cluster specified in ~/.kube/config.
deploy: kustomize ## Deploy Catalog controller and ApiServer to the K8s cluster specified in ~/.kube/config.
cd config/manager && $(KUSTOMIZE) edit set image controller=${CONTROLLER_IMG}:${IMG_TAG}
$(KUSTOMIZE) build config/default | kubectl apply -f -

.PHONY: undeploy
undeploy: kustomize ## Undeploy CatalogSource controller and ApiServer from the K8s cluster specified in ~/.kube/config.
undeploy: kustomize ## Undeploy Catalog controller and ApiServer from the K8s cluster specified in ~/.kube/config.
$(KUSTOMIZE) build config/default | kubectl delete --ignore-not-found=true -f -

.PHONY: uninstall
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ $ kind create cluster
$ kubectl apply -f https://github.com/operator-framework/catalogd/config/crd/bases/
$ kubectl apply -f https://github.com/operator-framework/catalogd/config/
$ kubectl create ns test
$ kubectl apply -f config/samples/catalogsource.yaml
$ kubectl apply -f config/samples/core_v1beta1_catalog.yaml

$ kubectl get catalogsource -n test
$ kubectl get catalog -n test
NAME AGE
catalogsource-sample 98s
catalog-sample 98s

$ kubectl get bundlemetadata -n test
NAME AGE
Expand Down Expand Up @@ -109,7 +109,7 @@ kubectl apply -f config/crd/bases/
```sh
kubectl apply -f config/
```
- Create the sample CatalogSource (this will trigger the reconciliation loop):
- Create the sample Catalog (this will trigger the reconciliation loop):
```sh
kubectl apply -f config/samples/catalogsource.yaml
kubectl apply -f config/samples/core_v1beta1_catalog.yaml
```
4 changes: 2 additions & 2 deletions cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@ func main() {
os.Exit(1)
}

if err = (&corecontrollers.CatalogSourceReconciler{
if err = (&corecontrollers.CatalogReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
Cfg: mgr.GetConfig(),
OpmImage: opmImage,
}).SetupWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "CatalogSource")
setupLog.Error(err, "unable to create controller", "controller", "Catalog")
os.Exit(1)
}
//+kubebuilder:scaffold:builder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ spec:
description: BundleMetadataSpec defines the desired state of BundleMetadata
properties:
catalogSource:
description: CatalogSource is the name of the CatalogSource that provides
description: CatalogSource is the name of the Catalog that provides
this bundle
type: string
image:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.11.4
name: catalogsources.catalogd.operatorframework.io
name: catalogs.catalogd.operatorframework.io
spec:
group: catalogd.operatorframework.io
names:
kind: CatalogSource
listKind: CatalogSourceList
plural: catalogsources
singular: catalogsource
kind: Catalog
listKind: CatalogList
plural: catalogs
singular: catalog
scope: Cluster
versions:
- name: v1beta1
schema:
openAPIV3Schema:
description: CatalogSource is the Schema for the catalogsources API
description: Catalog is the Schema for the Catalogs API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
Expand All @@ -32,7 +32,7 @@ spec:
metadata:
type: object
spec:
description: CatalogSourceSpec defines the desired state of CatalogSource
description: CatalogSpec defines the desired state of Catalog
properties:
image:
description: Image is the Catalog image that contains Operators' metadata
Expand All @@ -49,10 +49,10 @@ spec:
- image
type: object
status:
description: CatalogSourceStatus defines the observed state of CatalogSource
description: CatalogStatus defines the observed state of Catalog
properties:
conditions:
description: Conditions store the status conditions of the CatalogSource
description: Conditions store the status conditions of the Catalog
instances
items:
description: "Condition contains details for one aspect of the current
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ spec:
description: PackageSpec defines the desired state of Package
properties:
catalogSource:
description: CatalogSource is the name of the CatalogSource this package
description: CatalogSource is the name of the Catalog this package
belongs to
type: string
catalogSourceDisplayName:
Expand Down
2 changes: 1 addition & 1 deletion config/crd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
resources:
- bases/catalogd.operatorframework.io_bundlemetadata.yaml
- bases/catalogd.operatorframework.io_packages.yaml
- bases/catalogd.operatorframework.io_catalogsources.yaml
- bases/catalogd.operatorframework.io_catalogs.yaml
#+kubebuilder:scaffold:crdkustomizeresource
6 changes: 3 additions & 3 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ rules:
- apiGroups:
- catalogd.operatorframework.io
resources:
- catalogsources
- catalogs
verbs:
- create
- delete
Expand All @@ -54,13 +54,13 @@ rules:
- apiGroups:
- catalogd.operatorframework.io
resources:
- catalogsources/finalizers
- catalogs/finalizers
verbs:
- update
- apiGroups:
- catalogd.operatorframework.io
resources:
- catalogsources/status
- catalogs/status
verbs:
- get
- patch
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
apiVersion: catalogd.operatorframework.io/v1beta1
kind: CatalogSource
kind: Catalog
metadata:
labels:
app.kubernetes.io/name: catalogsource
app.kubernetes.io/instance: catalogsource-sample
app.kubernetes.io/name: catalog
app.kubernetes.io/instance: catalog-sample
app.kubernetes.io/part-of: catalogd
app.kuberentes.io/managed-by: kustomize
app.kubernetes.io/created-by: catalogd
name: catalogsource-sample
name: catalog-sample
spec:
image: quay.io/operatorhubio/catalog:latest
pollingInterval: 45m
16 changes: 8 additions & 8 deletions hack/scripts/generate-asciidemo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@ function run() {
sleep 10
typeline "make install"
sleep 10
# inspect crds (catalogsource, package, bundlemetadata)
#k get crds catalogsources.catalogd.operatorframework.io
# inspect crds (catalog, package, bundlemetadata)
#k get crds catalogs.catalogd.operatorframework.io
#k get crds packages.catalogd.operatorframework.io
#k get crds bundlemetadata.catalogd.operatorframework.io
#typeline 'kubectl get crds -A| grep -A10 -B10 -E "catalogsources|packages|bundlemetadata"'
#typeline 'kubectl get crds -A| grep -A10 -B10 -E "catalogs|packages|bundlemetadata"'
typeline 'kubectl get crds -A'

typeline -x "# create a catalogsource"
typeline "kubectl apply -f config/samples/core_v1beta1_catalogsource.yaml" # or other
typeline "kubectl get catalogsource -A" # shows catalogsource-sample
typeline -x "# waiting for catalogsource to report ready status"
typeline "kubectl wait --for=condition=Ready catalogsource/catalogsource-sample --timeout=1h"
typeline -x "# create a catalog"
typeline "kubectl apply -f config/samples/core_v1beta1_catalog.yaml" # or other
typeline "kubectl get catalog -A" # shows catalog-sample
typeline -x "# waiting for catalog to report ready status"
typeline "kubectl wait --for=condition=Ready catalog/catalog-sample --timeout=1h"
# inspect packages, and then details on one package CR
typeline -x "# check what 'packages' are available in this catalog and then inspect the content of one of the packages"
typeline "kubectl get packages"
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/core/v1beta1/bundlemetadata_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ type BundleMetadataList struct {

// BundleMetadataSpec defines the desired state of BundleMetadata
type BundleMetadataSpec struct {
// CatalogSource is the name of the CatalogSource that provides this bundle
// CatalogSource is the name of the Catalog that provides this bundle
CatalogSource string `json:"catalogSource"`

// Package is the name of the package that provides this bundle
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,27 +31,27 @@ const (
//+kubebuilder:resource:scope=Cluster
//+kubebuilder:subresource:status

// CatalogSource is the Schema for the catalogsources API
type CatalogSource struct {
// Catalog is the Schema for the Catalogs API
type Catalog struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec CatalogSourceSpec `json:"spec,omitempty"`
Status CatalogSourceStatus `json:"status,omitempty"`
Spec CatalogSpec `json:"spec,omitempty"`
Status CatalogStatus `json:"status,omitempty"`
}

//+kubebuilder:object:root=true

// CatalogSourceList contains a list of CatalogSource
type CatalogSourceList struct {
// CatalogList contains a list of Catalog
type CatalogList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`

Items []CatalogSource `json:"items"`
Items []Catalog `json:"items"`
}

// CatalogSourceSpec defines the desired state of CatalogSource
type CatalogSourceSpec struct {
// CatalogSpec defines the desired state of Catalog
type CatalogSpec struct {

// Image is the Catalog image that contains Operators' metadata in the FBC format
// https://olm.operatorframework.io/docs/reference/file-based-catalogs/#docs
Expand All @@ -64,12 +64,12 @@ type CatalogSourceSpec struct {
PollingInterval *metav1.Duration `json:"pollingInterval,omitempty"`
}

// CatalogSourceStatus defines the observed state of CatalogSource
type CatalogSourceStatus struct {
// Conditions store the status conditions of the CatalogSource instances
// CatalogStatus defines the observed state of Catalog
type CatalogStatus struct {
// Conditions store the status conditions of the Catalog instances
Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
}

func init() {
SchemeBuilder.Register(&CatalogSource{}, &CatalogSourceList{})
SchemeBuilder.Register(&Catalog{}, &CatalogList{})
}
2 changes: 1 addition & 1 deletion pkg/apis/core/v1beta1/package_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ type PackageList struct {

// PackageSpec defines the desired state of Package
type PackageSpec struct {
// CatalogSource is the name of the CatalogSource this package belongs to
// CatalogSource is the name of the Catalog this package belongs to
CatalogSource string `json:"catalogSource"`
CatalogSourceDisplayName string `json:"catalogSourceDisplayName,omitempty"`
CatalogSourcePublisher string `json:"catalogSourcePublisher,omitempty"`
Expand Down
38 changes: 19 additions & 19 deletions pkg/apis/core/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading