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
remove storageClassClaim and add new storageClassRequest CR #1913
remove storageClassClaim and add new storageClassRequest CR #1913
Conversation
|
Skipping CI for Draft Pull Request. |
3527e83
to
f39ce66
Compare
|
/test all |
f39ce66
to
a0acbb8
Compare
|
/test all |
a0acbb8
to
e25bf76
Compare
|
/test all |
e25bf76
to
f80144c
Compare
|
/test all |
f80144c
to
7a66d7b
Compare
7a66d7b
to
67c933d
Compare
546e2c4
to
efc8f0a
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.
@subhamkrai Thanks for the required changes. @nb-ohad, this also needs some migration changes as storageclassclaim needs to be replaced with storageClassRequest in existing clusters.
api/v1/storagecluster_types.go
Outdated
| @@ -244,26 +244,6 @@ type ExternalStorageClusterSpec struct { | |||
| //+kubebuilder:validation:Enum=ocs;rhcs | |||
| // StorageProviderKind Identify the type of storage provider cluster this consumer cluster is going to connect to. | |||
| StorageProviderKind ExternalStorageKind `json:"storageProviderKind,omitempty"` | |||
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 dont need storageProviderKind also anymore?
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.
lets keep it with rhcs mode also it might help in the future to add new functionalities
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.
there is no reference to this, so I removed it. Also, in case required in the future, we can add it later.
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.
lets keep it for now as am not sure if someone is using this field other than managed service
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.
@Madhu-1 The default was always RHCS, so no RHCS deployment was using it. And the only other value is ODF which now becomes irrelevant. I think a quick search on the codebase will assure you that this is not even looked at. If I am mistaken here we can keep it
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 you are correct, it's not used anywhere to be on the safer side we are not removing the Field from the Spec to avoid the foreseen problem, we can also remove it later if it's not used by others after some confirmation.
|
|
||
| const ( | ||
| StorageClassRequestFinalizer = "StorageClassRequest.ocs.openshift.io" | ||
| StorageClassRequestAnnotation = "ocs.openshift.io.fulfillstoragesclassclaim" |
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.
The annotation value need to be changed to math storageClassRequest
| @@ -0,0 +1,62 @@ | |||
| apiVersion: operators.coreos.com/v1alpha1 | |||
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.
Why we got the new CSV file here?
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.
my branch is older, so before fusion addition, it was like this. So, I removed the file now. Thanks
services/provider/client/client.go
Outdated
| @@ -54,15 +54,14 @@ func (cc *OCSProviderClient) Close() { | |||
|
|
|||
| // OnboardConsumer to validate the consumer and create StorageConsumer | |||
| // resource on the StorageProvider cluster | |||
| func (cc *OCSProviderClient) OnboardConsumer(ctx context.Context, ticket, name, capacity string) (*pb.OnboardConsumerResponse, error) { | |||
| func (cc *OCSProviderClient) OnboardConsumer(ctx context.Context, ticket, name string) (*pb.OnboardConsumerResponse, error) { | |||
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 dont need any change in this file as its a GRPC client
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.
Just remove the capacity nothing else
| @@ -26,10 +26,10 @@ service OCSProvider { | |||
| rpc AcknowledgeOnboarding(AcknowledgeOnboardingRequest) | |||
| returns (AcknowledgeOnboardingResponse){} | |||
|
|
|||
| // FulfillStorageClassClaim RPC call to create the StorageclassClaim CR on | |||
| // StorageClassRequest RPC call to create the StorageclassClaim CR on | |||
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.
No change is required in proto file as well
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 this supposed to change terminology? We are still fulfilling a storageclassclaim (not request) so I am not sure why is this change here.
services/provider/server/server.go
Outdated
| @@ -76,14 +76,14 @@ func NewOCSProviderServer(ctx context.Context, namespace string) (*OCSProviderSe | |||
|
|
|||
| storageClassClaimManager, err := newStorageClassClaimManager(ctx, client, namespace) | |||
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.
newStorageClassClaimManager need to be changed to newStorageClassRequestManager
services/provider/server/server.go
Outdated
| // provider cluster. | ||
| func (s *OCSProviderServer) FulfillStorageClassClaim(ctx context.Context, req *pb.FulfillStorageClassClaimRequest) (*pb.FulfillStorageClassClaimResponse, error) { | ||
| func (s *OCSProviderServer) StorageClassRequest(ctx context.Context, req *pb.StorageClassRequestRequest) (*pb.StorageClassRequestResponse, error) { |
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.
the RPC calls should remain the same only the CRD create/Delete/Get API calls need to be changed
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.
got it.
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 this supposed to change terminology? We are still fulfilling a storageclassclaim (not request) so I am not sure why is this change here.
efc8f0a
to
770dada
Compare
| metav1.TypeMeta `json:",inline"` | ||
| metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
|
||
| Spec StorageClassRequestSpec `json:"spec,omitempty"` |
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.
not related to this PR but Spec is a required field not a optional to do omitempty
config/rbac/role.yaml
Outdated
| - apiGroups: | ||
| - ocs.openshift.io | ||
| resources: | ||
| - storageclassrequests | ||
| verbs: | ||
| - get | ||
| - list |
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.
Why did this gets added new?
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.
should be good now
| var result reconcile.Result | ||
| var reconcileError error | ||
|
|
||
| result, reconcileError = r.reconcileProviderPhases() |
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.
call this as reconcilePhases()?
main.go
Outdated
| if err = (&controllers.StorageConsumerReconciler{ | ||
| Client: mgr.GetClient(), | ||
| Log: ctrl.Log.WithName("controllers").WithName("StorageConsumer"), | ||
| Scheme: mgr.GetScheme(), | ||
| }).SetupWithManager(mgr); err != nil { | ||
| setupLog.Error(err, "unable to create controller", "controller", "StorageConsumer") | ||
| os.Exit(1) | ||
| } |
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.
Why storageConsumer is removed?
services/provider/server/server.go
Outdated
| @@ -74,16 +74,16 @@ func NewOCSProviderServer(ctx context.Context, namespace string) (*OCSProviderSe | |||
| return nil, fmt.Errorf("failed to create new OCSConumer instance. %v", err) | |||
| } | |||
|
|
|||
| storageClassClaimManager, err := newStorageClassClaimManager(ctx, client, namespace) | |||
| storageClassRequestManager, err := newStorageClassClaimManager(ctx, client, namespace) | |||
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.
still its calling newStorageClassClaimManager
|
Tested migration of the provider and consumer with the build shared by Subham and it was a success. @Madhu-1 @subhamkrai |
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.
LGTM
services/provider/server/server.go
Outdated
| @@ -33,16 +33,16 @@ import ( | |||
| "k8s.io/apimachinery/pkg/api/resource" | |||
| "k8s.io/apimachinery/pkg/runtime" | |||
| "k8s.io/apimachinery/pkg/types" | |||
| "k8s.io/klog/v2" | |||
| "k8s.io/klog" | |||
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.
this is not addressed yet.
Thank you @rewantsoni for testing it. |
6c07044
to
bf0c1c8
Compare
bf0c1c8
to
6708e0e
Compare
thanks @rewantsoni for testing |
6708e0e
to
97ccb44
Compare
catalog/ocs-bundle.yaml
Outdated
| @@ -98,11 +98,6 @@ properties: | |||
| group: ocs.openshift.io | |||
| kind: OCSInitialization | |||
| version: v1 | |||
| - type: olm.gvk | |||
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 Can you drop this change also?
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.
reverted. Thanks!
from 4.13 we are moving from storageClassClaim to storageClassRequest CR. Also, we don't need consumer mode code in ocs-operator now, new operator will have consumer. Signed-off-by: subhamkrai <srai@redhat.com>
Signed-off-by: subhamkrai <srai@redhat.com>
97ccb44
to
1429d7e
Compare
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: iamniting, Madhu-1, subhamkrai The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/cherry-pick release-4.13 |
|
@iamniting: #1913 failed to apply on top of branch "release-4.13": In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
@subhamkrai Can you pls create a manual backport? |
here #2007 |
| Namespace: s.namespace, | ||
| Labels: map[string]string{ | ||
| controllers.ConsumerUUIDLabel: consumerUUID, | ||
| storageClassRequestName: storageClassRequestName, |
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 This should be storageClassClaimNameLabel we are adding name for both the label key and label value.
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.
Let's prioritize it and get it in both 4.13 and 4.12


Signed-off-by: subhamkrai srai@redhat.com