Skip to content

Commit

Permalink
chore(cvc): refactor cvc controller to use cstorvolumeconfig
Browse files Browse the repository at this point in the history
- Use cstorvolumeclaim apis to cstorvolumeconfig apis
- Refactor cvc controller with apis changes
- Update rbac rules with cstorvolumeconfig apis
- Rename cstorvolumeclaim crd to cstorvolumeconfig crd

Signed-off-by: prateekpandey14 <[email protected]>
  • Loading branch information
prateekpandey14 committed Mar 27, 2020
1 parent 5c44cc8 commit 69cd5f8
Show file tree
Hide file tree
Showing 18 changed files with 392 additions and 325 deletions.
4 changes: 2 additions & 2 deletions cmd/cvc-operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ package main
import (
"os"

cvc "github.com/openebs/cstor-operators/pkg/controllers/cstorvolumeclaim"
cvc "github.com/openebs/cstor-operators/pkg/controllers/cstorvolumeconfig"
"k8s.io/klog"
)

func main() {
if err := cvc.Start(); err != nil {
klog.Errorf("Failed to start cstorvolumeclaim controller:{%s}", err.Error())
klog.Errorf("Failed to start cstorvolumeconfig controller:{%s}", err.Error())
os.Exit(1)
}
os.Exit(0)
Expand Down
10 changes: 5 additions & 5 deletions deploy/crds/volumes-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
# name must match the spec fields below, and be in the form: <plural>.<group>
name: cstorvolumeclaims.cstor.openebs.io
name: cstorvolumeconfigs.cstor.openebs.io
spec:
# group name to use for REST API: /apis/<group>/<version>
group: cstor.openebs.io
Expand All @@ -49,14 +49,14 @@ spec:
scope: Namespaced
names:
# kind is normally the CamelCased singular type. Your resource manifests use this.
kind: CStorVolumeClaim
kind: CStorVolumeConfig
# plural name to be used in the URL: /apis/<group>/<version>/<plural>
plural: cstorvolumeclaims
plural: cstorvolumeconfigs
# singular name to be used as an alias on the CLI and for display
singular: cstorvolumeclaim
singular: cstorvolumeconfig
# shortNames allow shorter string to match your resource on the CLI
shortNames:
- cstorvolumeclaim
- cstorvolumeconfig
- cvc
additionalPrinterColumns:
- JSONPath: .status.phase
Expand Down
4 changes: 2 additions & 2 deletions deploy/cstor-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ spec:
containers:
- name: cspc-operator
imagePullPolicy: IfNotPresent
image: openebs/cspc-operator:ci
image: openebs/cspc-operator:v1ci
env:
- name: OPENEBS_NAMESPACE
valueFrom:
Expand Down Expand Up @@ -89,7 +89,7 @@ spec:
containers:
- name: cvc-operator
imagePullPolicy: IfNotPresent
image: openebs/cvc-operator:ci
image: openebs/cvc-operator:v1ci
env:
# OPENEBS_IO_BASE_DIR is used to configure base directory for openebs on host path.
# Where OpenEBS can store required files. Default base path will be /var/openebs
Expand Down
2 changes: 1 addition & 1 deletion deploy/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ rules:
resources: [ "castemplates", "runtasks"]
verbs: ["*" ]
- apiGroups: ["*"]
resources: ["cstorvolumereplicas", "cstorvolumes", "cstorvolumeclaims", "cstorvolumepolicies"]
resources: ["cstorvolumereplicas", "cstorvolumes", "cstorvolumeconfigs", "cstorvolumepolicies"]
verbs: ["*" ]
- apiGroups: ["*"]
resources: ["cstorpoolinstances", "cstorpoolinstances/finalizers"]
Expand Down
1 change: 0 additions & 1 deletion pkg/controllers/cstorvolumeclaim/volume_operations_test.go

This file was deleted.

Loading

0 comments on commit 69cd5f8

Please sign in to comment.