Details
-
Bug
-
Resolution: Obsolete
-
Major
-
None
-
None
Description
PVC created manually (any accessModes) by user can be slip into the Operator.
Things to notice here:
WFWIP-186StorageSpec is intended to be mounted in ReadWriteOnce mode- foo: bar should never pass the validation as it is not a valid storage configuration
reproduce
- create PVC, use the ${OPERATOR_NAME}-volume-${OPERATOR_NAME}-0 name - the PVC would be in normal circumstances created by the operator
apiVersion: v1 kind: PersistentVolumeClaim metadata: name: quickstart-volume-quickstart-0 spec: accessModes: - ReadWriteOnce - ReadOnlyMany - ReadWriteMany resources: requests: storage: 1Mi volumeMode: Filesystem volumeName: pv0022
- deploy the project
apiVersion: wildfly.org/v1alpha1 kind: WildFlyServer metadata: name: quickstart spec: applicationImage: "quay.io/wildfly-quickstarts/wildfly-operator-quickstart:18.0" replicas: 1 storage: foo: bar
The PVC created by user is reused by operator.
Additional details:
- oc get pvc quickstart-volume-quickstart-0 -o yaml
$ oc get pvc quickstart-volume-quickstart-0 -o yaml apiVersion: v1 kind: PersistentVolumeClaim metadata: name: quickstart-volume-quickstart-0 ... spec: accessModes: - ReadWriteOnce - ReadOnlyMany - ReadWriteMany resources: requests: storage: 1Mi volumeMode: Filesystem volumeName: pv0022 status: accessModes: - ReadWriteOnce - ReadWriteMany - ReadOnlyMany capacity: storage: 10Gi phase: Bound
- oc get wildflyserver quickstart -o yaml
$ oc get wildflyserver quickstart -o yaml apiVersion: wildfly.org/v1alpha1 kind: WildFlyServer metadata: name: quickstart ... spec: applicationImage: quay.io/wildfly-quickstarts/wildfly-operator-quickstart:18.0 replicas: 1 storage: foo: bar status: hosts: - quickstart-route-statefulset.apps-crc.testing pods: - name: quickstart-0 podIP: 10.128.1.101 state: ACTIVE replicas: 1 scalingdownPods: 0
- oc get pod/quickstart-0 -o yaml
$ oc get pod/quickstart-0 -o yaml ... volumeMounts: - mountPath: /wildfly/standalone/data name: quickstart-volume ... volumes: - name: quickstart-volume persistentVolumeClaim: claimName: quickstart-volume-quickstart-0