Bug 2196067

Summary: reclaimspacejob 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:11:25 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 23:33:59 UTC
Description of problem (please be detailed as possible and provide log
snippests):


Reclaim space job object is editable after it is created while it should not be

Editable property : retryDeadlineSeconds


Version of all relevant components (if applicable):

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


Does this issue impact your ability to continue to work with the product
(please explain in detail what is the user impact)?

No

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. Create Reclaim Space job with the following yaml file: 

apiVersion: csiaddons.openshift.io/v1alpha1
kind: ReclaimSpaceJob
metadata:
  name: sample-1
spec:
  target:
     persistentVolumeClaim: pvc-1
  backOffLimit: 10
  retryDeadlineSeconds: 900

As a result - this is the object that is created : 

[ypersky@ypersky ocs-ci]$ oc get reclaimspacejob.csiaddons.openshift.io/sample-1 -o yaml
apiVersion: csiaddons.openshift.io/v1alpha1
kind: ReclaimSpaceJob
metadata:
  creationTimestamp: "2023-05-07T23:26:06Z"
  generation: 1
  name: sample-1
  namespace: default
  resourceVersion: "27354834"
  uid: 9090614b-3122-45f2-9efc-5f8eef4b36fc
spec:
  backOffLimit: 10
  retryDeadlineSeconds: 900
  target:
    persistentVolumeClaim: pvc-1
status:
  completionTime: "2023-05-07T23:26:16Z"
  conditions:
  - lastTransitionTime: "2023-05-07T23:26:16Z"
    message: Failed to get target details
    observedGeneration: 1
    reason: failed
    status: "True"
    type: Failed
  message: Maximum retry limit reached
  result: Failed
  retries: 10
  startTime: "2023-05-07T23:26:06Z"



2. Edit the above object, editable property: 

retryDeadlineSeconds from 900 to 1800 ( numbers bigger than 1800 are not valid for this property). 


Actual results:

retryDeadlineSeconds is changed from 900 to 1800 and the new valie is kept. 


Expected results:

No changed should be applicable to Reclaim Space Job object after it is created. 


Additional info: