-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
csi: fix the ROOK_CSI_DISABLE_DRIVER flag in the csi reconcile #14746
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't need return here, we need to add condition https://github.com/rook/rook/blob/master/pkg/operator/ceph/csi/controller.go#L335 and include && !disableCSI
otherwise CSI operator will not start
c93287d
to
54e828a
Compare
pkg/operator/ceph/csi/controller.go
Outdated
@@ -332,7 +332,7 @@ func (r *ReconcileCSI) reconcile(request reconcile.Request) (reconcile.Result, e | |||
} | |||
} | |||
|
|||
if !EnableCSIOperator() { | |||
if !EnableCSIOperator() && !disableCSI { | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, not related to your change but if you could remove this empty line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ya removed
54e828a
to
b1b6ec1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a more descriptive commit message and PR title. You can mention that the driver was being installed even though it was intended to be disabled.
5c695d0
to
4072dbd
Compare
ROOK_CSI_DISABLE_DRIVER was not working accurate from rook#14489 The csi driver was installed even if its not expected Signed-off-by: parth-gr <partharora1010@gmail.com>
4072dbd
to
166e4f3
Compare
Testing looks good
|
@@ -332,8 +332,7 @@ func (r *ReconcileCSI) reconcile(request reconcile.Request) (reconcile.Result, e | |||
} | |||
} | |||
|
|||
if !EnableCSIOperator() { | |||
|
|||
if !disableCSI && !EnableCSIOperator() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the goal of the setting ROOK_CSI_DISABLE_DRIVER: true
to completely skip all reconcile of the csi driver and csi operator? If so, seems like we should add a return statement above on line 205, so that we skip all reconciling in this method. If that is not the intention, then I'm not clear what is the intention of this flag since it's still reconciling some csi resources between lines 210-333.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had the same question today to @subhamkrai as I was under the same impression,
He mentioned ROOK_CSI_DISABLE_DRIVER
should only responsible for not creating CSI driver from rook
And enable_csi_operator
should be responsible for creating CSI operator.
So if ROOK_CSI_DISABLE_DRIVER
:true and enable_csi_operator
:true it should create the CSI operator resources and not CSI driver
But we can discuss this if needed more discussion and changes...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@subhamkrai please add your thoughts ^^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, ROOK_CSI_DISABLE_DRIVER
is the config that we should prioritize working correctly. This config has existed for a while, and I think we expect it to continue to be used after the CSI operator is GA'ed as well. This config has had the meaning "Rook should not manage CSI driver resources," and I think keeping that meaning will help others continue to use Rook as they have been without unexpected results.
IIUC, ENABLE_CSI_OPERATOR
is something that I think is temporary while we are working to test and migrate to the new CSI operator setup. I think it's fine if ENABLE_CSI_OPERATOR
doesn't do anything if ROOK_CSI_DISABLE_DRIVER == true
since we don't expect to need the option for a long time.
I would suggest that ROOK_CSI_DISABLE_DRIVER
behaves to disable all Rook management of CSI drivers, including the operator. I think that is also what Travis is expecting, based on his comment.
I guess the important thing might be to ensure Rook will remove CSI drivers when ROOK_CSI_DISABLE_DRIVER == true
, assuming that is the behavior in Rook today.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes above should be the correct expectation 👍🏻
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to decide which flag we want to give precedence as let's say
- User set
ROOK_CSI_DISABLE_DRIVER==true
andENABLE_CSI_OPERATOR == true
, if we placereturn
higher it will skip deploying CSI Operator.
While working on this, I treated ROOK_CSI_DISABLE_DRIVER
to enable/disable driver code and ENABLE_CSI_OPERATOR
to enable/disable operator code.
We can also log an error when user sets
ROOK_CSI_DISABLE_DRIVER==trueand
ENABLE_CSI_OPERATOR == true. But just to mention, we have to csi way of deployment
driver and operator` so to have it clear it clear for user I treated like this currently in the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per the huddle discussion,
We are keeping the current implementations,
Later when we remove the csi operator flag check, then we will bring back the disable the controller reconcile at very start of the reconcile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per discussion, approving to go ahead with the current changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
marking as changes requested until the discussion is resolved
@@ -332,8 +332,7 @@ func (r *ReconcileCSI) reconcile(request reconcile.Request) (reconcile.Result, e | |||
} | |||
} | |||
|
|||
if !EnableCSIOperator() { | |||
|
|||
if !disableCSI && !EnableCSIOperator() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per discussion, approving to go ahead with the current changes
csi: fix the ROOK_CSI_DISABLE_DRIVER flag in the csi reconcile (backport #14746)
ROOK_CSI_DISABLE_DRIVER was not working accurate
from #14489
The csi driver was installed even if its not
expected
Checklist: