Bug 2196061

Summary: Network fence resource object is editable after it is created while it should not be
Product: [Red Hat Storage] Red Hat OpenShift Data Foundation Reporter: Yuli Persky <ypersky>
Component: csi-addonsAssignee: Rakshith <rar>
Status: CLOSED NOTABUG QA Contact: krishnaram Karthick <kramdoss>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 4.13CC: kramdoss, mrajanna, ocs-bugs, odf-bz-bot, rar
Target Milestone: ---Keywords: Automation
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-08 06:16:18 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Yuli Persky 2023-05-07 22:44:55 UTC
Description of problem (please be detailed as possible and provide log
snippests):

Network fence resource object is editable after it is created while it should not be
Editable property:  fenceState.
original property value: Fenced
changed property value to : Unfenced 


Does this issue impact your ability to continue to work with the product
(please explain in detail what is the user impact)?
No. However, this is the essence of the feature and it is not working properly. 

Is there any workaround available to the best of your knowledge?
No

Rate from 1 - 5 the complexity of the scenario you performed that caused this
bug (1 - very simple, 5 - very complex)?
3

Can this issue reproducible?
Yes

Can this issue reproduce from the UI?


If this is a regression, please provide more details to justify this:


Steps to Reproduce:
1.Network fence is created with the following yaml file: 

apiVersion: csiaddons.openshift.io/v1alpha1
kind: NetworkFence
metadata:
  name: network-fence-sample
spec:
  driver: example.driver
  cidrs:
    - 10.90.89.66/32
    - 11.67.12.42/24
  secret:
    name: fence-secret
    namespace: default
  parameters:
    key: value

The following object is created : 
[ypersky@ypersky ocs-ci]$ oc get networkfence.csiaddons.openshift.io/network-fence-sample -o yaml

apiVersion: csiaddons.openshift.io/v1alpha1
kind: NetworkFence
metadata:
  creationTimestamp: "2023-05-07T22:33:42Z"
  generation: 1
  name: network-fence-sample
  resourceVersion: "27316506"
  uid: 6c00b0a5-98a9-49a2-95d7-9e72b580cc3c
spec:
  cidrs:
  - 10.90.89.66/32
  - 11.67.12.42/24
  driver: example.drivero
  fenceState: Fenced
  parameters:
    key: value
  secret:
    name: fence-secret
    namespace: default

2. Edit the created object and change fenceState from Fenced to Unfenced


Actual results: The Unfenced value is kept while it should not be. 


Expected results:

No changed should be applicable to Network Fence object after it is created. 


Additional info:

OCS versions
	==============

		NAME                                         DISPLAY                       VERSION             REPLACES   PHASE
		mcg-operator.v4.13.0-157.stable              NooBaa Operator               4.13.0-157.stable              Succeeded
		ocs-operator.v4.13.0-157.stable              OpenShift Container Storage   4.13.0-157.stable              Succeeded
		odf-csi-addons-operator.v4.13.0-157.stable   CSI Addons                    4.13.0-157.stable              Succeeded
		odf-operator.v4.13.0-157.stable              OpenShift Data Foundation     4.13.0-157.stable              Succeeded
		
		ODF (OCS) build :		      full_version: 4.13.0-157
		

	Rook versions
	===============

		rook: v4.13.0-0.dcb0f9119dcfecb7256321eea60c54ec5f010959
		go: go1.19.6
		
	Ceph versions
	===============

		ceph version 17.2.5-1342.el9cp (ed07851f2c5b8d3dccadf079402f86a67cb7d3e5) quincy (stable)


OCP versions
	==============

		clientVersion:
		  buildDate: "2023-04-19T04:06:40Z"
		  compiler: gc
		  gitCommit: 92b1a3d0e5d092430b523f6541aa0c504b2222b3
		  gitTreeState: clean
		  gitVersion: 4.13.0-202304190216.p0.g92b1a3d.assembly.stream-92b1a3d
		  goVersion: go1.19.6
		  major: ""
		  minor: ""
		  platform: linux/amd64
		kustomizeVersion: v4.5.7
		openshiftVersion: 4.13.0-0.nightly-2023-04-11-144406
		releaseClientVersion: 4.13.0-0.nightly-2023-05-04-090524
		serverVersion:
		  buildDate: "2023-04-06T14:21:00Z"
		  compiler: gc
		  gitCommit: 0cffe665612c2b8ac54f19c932b33e84261992d9
		  gitTreeState: clean
		  gitVersion: v1.26.2+22308ca
		  goVersion: go1.19.6
		  major: "1"
		  minor: "26"
		  platform: linux/amd64
		
		
		Cluster version:

		NAME      VERSION                              AVAILABLE   PROGRESSING   SINCE   STATUS
		version   4.13.0-0.nightly-2023-04-11-144406   True        False         25d     Cluster version is 4.13.0-0.nightly-2023-04-11-144406