Skip to content

Commit

Permalink
controllers: remove code which deploys CSI and retain delegation of CSI
Browse files Browse the repository at this point in the history
changes in brief:
csi related utils, pkg and templates are not required. usage of csi
images manifest is changed and old way of having all images in a single
configmap is not required.

conditional delegation of csi in controllers is removed and delegation
is made default. RBAC related to direct management of deployments and
daemonsets is removed.

usage of deployCSI in key of operator config is removed since that
functionality is now being done by deployment-guard

general:
concentrated on removal of code rather than refactor to minimize the
diff and will be raising a follow up if there is any chance of refactor
now.

Signed-off-by: Leela Venkaiah G <[email protected]>
  • Loading branch information
leelavg committed Oct 21, 2024
1 parent 7d67155 commit a7482eb
Show file tree
Hide file tree
Showing 30 changed files with 69 additions and 2,666 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/verify-generated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ jobs:
with:
go-version-file: go.mod

- name: Verify changes to CSI images manifest
run: make verify-csi-images-manifest

- name: Verify go deps
run: make godeps-verify

Expand Down
9 changes: 0 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,6 @@ manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and Cust
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."

csi-images-manifest: ## Generates the YAML manifest of CSI images for each supported environment.
./hack/gen-csi-images-manifest.sh

verify-csi-images-manifest: csi-images-manifest ## Verify csi-images-manifest has been run, if required.
@if [[ -n "$$(git status --porcelain $${CSI_IMAGES_MANIFEST})" ]]; then \
echo -e "\n\033[1;31mError:\033[0m Uncommitted changes to CSI images manifest found. Run \033[1m'make csi-images-manifest'\033[0m and commit the results.\n"; \
git diff -u $${CSI_IMAGES_MANIFEST}; \
exit 1; \
fi
fmt: ## Run go fmt against code.
go fmt ./...

Expand Down
36 changes: 0 additions & 36 deletions bundle/manifests/ocs-client-operator-csi-images_v1_configmap.yaml

This file was deleted.

36 changes: 1 addition & 35 deletions bundle/manifests/ocs-client-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
categories: Storage
console.openshift.io/plugins: '["odf-client-console"]'
containerImage: quay.io/ocs-dev/ocs-client-operator:latest
createdAt: "2024-10-14T12:21:27Z"
createdAt: "2024-10-21T04:48:51Z"
description: OpenShift Data Foundation client operator enables consumption of
storage services from a remote centralized OpenShift Data Foundation provider
cluster.
Expand Down Expand Up @@ -106,42 +106,13 @@ spec:
- get
- list
- watch
- apiGroups:
- apps
resources:
- daemonsets
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- apps
resources:
- daemonsets/finalizers
verbs:
- update
- apiGroups:
- apps
resources:
- deployments
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- apps
resources:
- deployments/finalizers
verbs:
- update
- apiGroups:
- batch
resources:
Expand Down Expand Up @@ -823,8 +794,6 @@ spec:
securityContext:
allowPrivilegeEscalation: false
volumeMounts:
- mountPath: /opt/config
name: csi-images
- mountPath: /etc/tls/private
name: webhook-cert-secret
initContainers:
Expand All @@ -848,9 +817,6 @@ spec:
operator: Equal
value: "true"
volumes:
- configMap:
name: ocs-client-operator-csi-images
name: csi-images
- name: webhook-cert-secret
secret:
secretName: webhook-cert-secret
Expand Down
3 changes: 0 additions & 3 deletions config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ configMapGenerator:
- files:
- controller_manager_config.yaml
name: manager-config
- files:
- csi-images.yaml=csi-images.yaml
name: csi-images
- name: config

apiVersion: kustomize.config.k8s.io/v1beta1
Expand Down
5 changes: 0 additions & 5 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ spec:
image: controller:latest
name: manager
volumeMounts:
- name: csi-images
mountPath: /opt/config
- mountPath: /etc/tls/private
name: webhook-cert-secret
env:
Expand Down Expand Up @@ -88,9 +86,6 @@ spec:
cpu: 10m
memory: 256Mi
volumes:
- name: csi-images
configMap:
name: csi-images
- name: webhook-cert-secret
secret:
secretName: webhook-cert-secret
Expand Down
29 changes: 0 additions & 29 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,42 +63,13 @@ rules:
- get
- list
- watch
- apiGroups:
- apps
resources:
- daemonsets
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- apps
resources:
- daemonsets/finalizers
verbs:
- update
- apiGroups:
- apps
resources:
- deployments
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- apps
resources:
- deployments/finalizers
verbs:
- update
- apiGroups:
- batch
resources:
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,12 @@ require (
github.com/onsi/gomega v1.34.1
github.com/openshift/api v0.0.0-20240828125535-01b3675ba7b3
github.com/operator-framework/api v0.27.0
github.com/pkg/errors v0.9.1
github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.76.0
github.com/ramendr/ramen/api v0.0.0-20241001141243-29d6f22ad237
github.com/red-hat-storage/ocs-client-operator/api v0.0.0-00010101000000-000000000000
github.com/red-hat-storage/ocs-operator/services/provider/api/v4 v4.0.0-20240917115204-741b9d6f263d
github.com/stretchr/testify v1.9.0
google.golang.org/grpc v1.66.0
gopkg.in/yaml.v2 v2.4.0
k8s.io/api v0.31.0
k8s.io/apiextensions-apiserver v0.31.0
k8s.io/apimachinery v0.31.0
Expand All @@ -47,8 +45,10 @@ require (
github.com/klauspost/compress v1.17.9 // indirect
github.com/kube-object-storage/lib-bucket-provisioner v0.0.0-20221122204822-d1a8c34382f1 // indirect
github.com/openshift/custom-resource-status v1.1.3-0.20220503160415-f2fdb4999d87 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/x448/float16 v0.8.4 // indirect
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
k8s.io/component-base v0.31.0 // indirect
sigs.k8s.io/container-object-storage-interface-api v0.1.0 // indirect
)
Expand Down
35 changes: 0 additions & 35 deletions hack/gen-csi-images-manifest.sh

This file was deleted.

5 changes: 0 additions & 5 deletions hack/make-bundle-vars.mk
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,6 @@ endif
CSI_ADDONS_PACKAGE_NAME ?= csi-addons
CSI_ADDONS_PACKAGE_VERSION ?= 0.9.1

## CSI driver images
# The following variables define the default CSI container images to deploy
# and the supported versions of OpenShift.
CSI_IMAGES_MANIFEST ?= config/manager/csi-images.yaml

# The following variables are here as a convenience for developers so we don't have
# to retype things, because we're lazy.
IMAGE_LOCATION_SIG_STORAGE ?= registry.k8s.io/sig-storage
Expand Down
Loading

0 comments on commit a7482eb

Please sign in to comment.