Skip to content

Task/csi 3503 add verification #224

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

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from
Draft
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
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,16 @@ run-unit-tests:
$(run_unit_tests_image) make test

.PHONY: test
test: check-generated-manifests update
test: check-files-alignment update
ginkgo -r -v -skipPackage tests

.PHONY: update
update: kustomize
hack/update-all.sh

.PHONY: check-generated-manifests
check-generated-manifests:
hack/check-generated-manifests.sh
.PHONY: check-files-alignment
check-files-alignment:
hack/check-files-alignment.sh

.PHONY: update-generated-yamls
update-generated-yamls:
Expand Down
6 changes: 6 additions & 0 deletions build/ci/Dockerfile.unittest
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ RUN go get github.com/onsi/ginkgo/[email protected] \
&& make kustomize \
&& make controller-gen

ARG YQ_VERSION=v4.13.5
ARG ARCH=yq_linux_386
RUN ARCH=$(if [ "$(uname -m)" = "x86_64" ]; then echo "amd64"; else echo "$(uname -m)" ; fi) \
&& wget https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_${ARCH} -O /usr/bin/yq \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done here

&& chmod +x /usr/bin/yq

COPY . .

CMD ["make", "test"]
118 changes: 50 additions & 68 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
@@ -1,75 +1,50 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: ibm-block-csi-operator
namespace: default
labels:
product: ibm-block-csi-driver
csi: ibm
app.kubernetes.io/name: ibm-block-csi-operator
app.kubernetes.io/instance: ibm-block-csi-operator
app.kubernetes.io/managed-by: ibm-block-csi-operator
app.kubernetes.io/name: ibm-block-csi-operator
csi: ibm
product: ibm-block-csi-driver
name: ibm-block-csi-operator
namespace: default
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: ibm-block-csi-operator
template:
metadata:
annotations:
productID: 5027566ef6c54de49028be7df25119e1
productMetric: FREE
productName: IBM Block CSI Driver
productVersion: 1.8.0
labels:
app.kubernetes.io/name: ibm-block-csi-operator
app.kubernetes.io/instance: ibm-block-csi-operator
app.kubernetes.io/managed-by: ibm-block-csi-operator
product: ibm-block-csi-driver
app.kubernetes.io/name: ibm-block-csi-operator
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

most of the diff looks like "rearranging lines", can we avoid it so the diff will be minimal?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I needed to do it since our yamls weren't aligned and that the CI won't fail, it will be easier for you if I will separate the PR's? one PR will be the yamls diffs and the other one will be the scripts that check it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, that would be great!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I opened two PRs, this is how you wanted it?
#227
#226

csi: ibm
annotations:
productName: "IBM Block CSI Driver"
productID: "5027566ef6c54de49028be7df25119e1"
productVersion: "1.8.0"
productMetric: "FREE"
product: ibm-block-csi-driver
spec:
serviceAccountName: ibm-block-csi-operator
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/arch
operator: In
values:
- amd64
- s390x
- ppc64le
- matchExpressions:
- key: kubernetes.io/arch
operator: In
values:
- amd64
- s390x
- ppc64le
containers:
- name: ibm-block-csi-operator
resources:
requests:
memory: 100Mi
cpu: 50m
limits:
memory: 500Mi
cpu: 100m
readinessProbe:
exec:
command: ["./health_check.sh"]
initialDelaySeconds: 3
periodSeconds: 1
livenessProbe:
exec:
command: ["./health_check.sh"]
initialDelaySeconds: 10
periodSeconds: 30
securityContext:
capabilities:
drop:
- ALL
image: ibmcom/ibm-block-csi-operator:1.8.0
imagePullPolicy: IfNotPresent
command:
- ibm-block-csi-operator
args:
- args:
- --zap-encoder
- console
command:
- ibm-block-csi-operator
env:
- name: WATCH_NAMESPACE
value: ""
Expand All @@ -78,24 +53,31 @@ spec:
fieldRef:
fieldPath: metadata.name
- name: OPERATOR_NAME
value: "ibm-block-csi-operator"
#- name: ENDPOINT
# value: "unix:///storage/storage.sock:10086"
#- name: ISCSI_AGENT_PORT
# value: "10086"
#volumeMounts:
#- name: socket-dir
# mountPath: /storage/
#- name: ibm-storage-agent
#image: ibmcom/ibm-storage-agent:0.0.4
#imagePullPolicy: IfNotPresent
#env:
#- name: ENDPOINT
# value: "unix:///storage/storage.sock:10086"
#volumeMounts:
#- name: socket-dir
# mountPath: /storage/

#volumes:
#- name: socket-dir
#emptyDir: {}
value: ibm-block-csi-operator
image: ibmcom/ibm-block-csi-operator:1.8.0
imagePullPolicy: IfNotPresent
livenessProbe:
exec:
command:
- ./health_check.sh
initialDelaySeconds: 10
periodSeconds: 30
name: ibm-block-csi-operator
readinessProbe:
exec:
command:
- ./health_check.sh
initialDelaySeconds: 3
periodSeconds: 1
resources:
limits:
cpu: 100m
memory: 500Mi
requests:
cpu: 50m
memory: 100Mi
securityContext:
capabilities:
drop:
- ALL
serviceAccountName: ibm-block-csi-operator
77 changes: 38 additions & 39 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: null
name: ibm-block-csi-operator
labels:
product: ibm-block-csi-driver
csi: ibm
app.kubernetes.io/name: ibm-block-csi-operator
app.kubernetes.io/instance: ibm-block-csi-operator
app.kubernetes.io/managed-by: ibm-block-csi-operator
app.kubernetes.io/name: ibm-block-csi-operator
csi: ibm
product: ibm-block-csi-driver
name: ibm-block-csi-operator
rules:
- apiGroups:
- ""
Expand Down Expand Up @@ -143,6 +143,40 @@ rules:
- list
- update
- watch
- apiGroups:
- replication.storage.openshift.io
resources:
- volumereplicationclasses
verbs:
- get
- list
- watch
- apiGroups:
- replication.storage.openshift.io
resources:
- volumereplications
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- replication.storage.openshift.io
resources:
- volumereplications/finalizers
verbs:
- update
- apiGroups:
- replication.storage.openshift.io
resources:
- volumereplications/status
verbs:
- get
- patch
- update
- apiGroups:
- security.openshift.io
resourceNames:
Expand Down Expand Up @@ -219,41 +253,6 @@ rules:
verbs:
- get
- list
- watch
- patch
- update
- apiGroups:
- replication.storage.openshift.io
resources:
- volumereplicationclasses
verbs:
- get
- list
- watch
- apiGroups:
- replication.storage.openshift.io
resources:
- volumereplications
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- replication.storage.openshift.io
resources:
- volumereplications/finalizers
verbs:
- update
- apiGroups:
- replication.storage.openshift.io
resources:
- volumereplications/status
verbs:
- get
- patch
- update
- watch
Expand Down
8 changes: 4 additions & 4 deletions config/rbac/role_binding.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: ibm-block-csi-operator
labels:
product: ibm-block-csi-driver
csi: ibm
app.kubernetes.io/name: ibm-block-csi-operator
app.kubernetes.io/instance: ibm-block-csi-operator
app.kubernetes.io/managed-by: ibm-block-csi-operator
app.kubernetes.io/name: ibm-block-csi-operator
csi: ibm
product: ibm-block-csi-driver
name: ibm-block-csi-operator
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
Expand Down
10 changes: 5 additions & 5 deletions config/rbac/service_account.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: ibm-block-csi-operator
namespace: default
labels:
product: ibm-block-csi-driver
csi: ibm
app.kubernetes.io/name: ibm-block-csi-operator
app.kubernetes.io/instance: ibm-block-csi-operator
app.kubernetes.io/managed-by: ibm-block-csi-operator
app.kubernetes.io/name: ibm-block-csi-operator
csi: ibm
product: ibm-block-csi-driver
release: v1.8.0
name: ibm-block-csi-operator
namespace: default
Loading