Skip to content

Commit

Permalink
api: rename Cluster kind to ScyllaCluster in missing places
Browse files Browse the repository at this point in the history
Problems sovled:
- webhooks were watching old "Cluster" resource
- controller wasn't able to update cluster status
- controller watch on owned StatefulSet events was registered on old "Cluster" resource

Fixes #144
  • Loading branch information
zimnx committed Nov 3, 2020
1 parent ab7b235 commit 978b5fd
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion PROJECT
Expand Up @@ -2,6 +2,6 @@ domain: scylla.scylladb.com
repo: github.com/scylladb/scylla-operator
resources:
- group: scylla
kind: Cluster
kind: ScyllaCluster
version: v1alpha1
version: "2"
4 changes: 2 additions & 2 deletions config/manager/cluster/cluster.yaml
Expand Up @@ -32,7 +32,7 @@ rules:
- apiGroups:
- scylla.scylladb.com
resources:
- clusters
- scyllaclusters
verbs:
- get

Expand Down Expand Up @@ -64,7 +64,7 @@ subjects:
---
# Scylla Manager Cluster
apiVersion: scylla.scylladb.com/v1alpha1
kind: Cluster
kind: ScyllaCluster
metadata:
name: cluster
namespace: scylla-manager
Expand Down
8 changes: 4 additions & 4 deletions config/manager/default/kustomization.yaml
Expand Up @@ -15,30 +15,30 @@ vars:
- name: MANAGER_CLUSTER_NAME
objref:
group: scylla.scylladb.com
kind: Cluster
kind: ScyllaCluster
version: v1alpha1
name: cluster
fieldref:
fieldpath: metadata.name
- name: MANAGER_CLUSTER_DC
objref:
kind: Cluster
kind: ScyllaCluster
group: scylla.scylladb.com
version: v1alpha1
name: cluster
fieldref:
fieldpath: spec.datacenter.name
- name: MANAGER_CLUSTER_RACK
objref:
kind: Cluster
kind: ScyllaCluster
group: scylla.scylladb.com
version: v1alpha1
name: cluster
fieldref:
fieldpath: spec.datacenter.racks[0].name
- name: MANAGER_CLUSTER_NAMESPACE
objref:
kind: Cluster
kind: ScyllaCluster
group: scylla.scylladb.com
version: v1alpha1
name: cluster
Expand Down
2 changes: 1 addition & 1 deletion docs/source/scylla_cluster_crd.md
Expand Up @@ -9,7 +9,7 @@ This page will explain all the available configuration options on the Scylla CRD

```yaml
apiVersion: scylla.scylladb.com/v1alpha1
kind: Cluster
kind: ScyllaCluster
metadata:
name: simple-cluster
namespace: scylla
Expand Down
4 changes: 2 additions & 2 deletions examples/eks/cluster.yaml
Expand Up @@ -40,7 +40,7 @@ rules:
- apiGroups:
- scylla.scylladb.com
resources:
- clusters
- scyllaclusters
verbs:
- get

Expand Down Expand Up @@ -74,7 +74,7 @@ subjects:

# Scylla Cluster
apiVersion: scylla.scylladb.com/v1alpha1
kind: Cluster
kind: ScyllaCluster
metadata:
name: scylla-cluster
namespace: scylla
Expand Down
4 changes: 2 additions & 2 deletions examples/generic/cluster.yaml
Expand Up @@ -40,7 +40,7 @@ rules:
- apiGroups:
- scylla.scylladb.com
resources:
- clusters
- scyllaclusters
verbs:
- get

Expand Down Expand Up @@ -74,7 +74,7 @@ subjects:

# Simple Scylla Cluster
apiVersion: scylla.scylladb.com/v1alpha1
kind: Cluster
kind: ScyllaCluster
metadata:
labels:
controller-tools.k8s.io: "1.0"
Expand Down
4 changes: 2 additions & 2 deletions examples/gke/cluster.yaml
Expand Up @@ -40,7 +40,7 @@ rules:
- apiGroups:
- scylla.scylladb.com
resources:
- clusters
- scyllaclusters
verbs:
- get

Expand Down Expand Up @@ -74,7 +74,7 @@ subjects:

# Scylla Cluster
apiVersion: scylla.scylladb.com/v1alpha1
kind: Cluster
kind: ScyllaCluster
metadata:
labels:
controller-tools.k8s.io: "1.0"
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/v1alpha1/cluster_types.go
Expand Up @@ -216,7 +216,7 @@ type BackupTaskStatus struct {
Error string `json:"error"`
}

// ClusterStatus defines the observed state of Cluster
// ClusterStatus defines the observed state of ScyllaCluster
type ClusterStatus struct {
Racks map[string]RackStatus `json:"racks,omitempty"`
ManagerID *string `json:"managerId,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion pkg/controllers/cluster/util/util.go
Expand Up @@ -93,6 +93,6 @@ func NewControllerRef(c *scyllav1alpha1.ScyllaCluster) metav1.OwnerReference {
return *metav1.NewControllerRef(c, schema.GroupVersionKind{
Group: "scylla.scylladb.com",
Version: "v1alpha1",
Kind: "Cluster",
Kind: "ScyllaCluster",
})
}

0 comments on commit 978b5fd

Please sign in to comment.