Skip to content
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

Adds fallback layer for multi cluster code in External mode #1212

Merged

Conversation

bipuladh
Copy link
Contributor

@bipuladh bipuladh commented Feb 7, 2024

No description provided.

Copy link
Contributor

openshift-ci bot commented Feb 7, 2024

@bipuladh: This pull request references Bugzilla bug 2259961, which is valid.

No validations were run on this bug

Requesting review from QA contact:
/cc @nehaberry

In response to this:

Bug 2259961: Adds fallback layer for multi cluster code in External mode

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.

@openshift-ci openshift-ci bot added the approved label Feb 7, 2024
Copy link
Contributor

openshift-ci bot commented Feb 7, 2024

@openshift-ci[bot]: GitHub didn't allow me to request PR reviews from the following users: nehaberry.

Note that only red-hat-storage members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

@bipuladh: This pull request references Bugzilla bug 2259961, which is valid.

No validations were run on this bug

Requesting review from QA contact:
/cc @nehaberry

In response to this:

Bug 2259961: Adds fallback layer for multi cluster code in External mode

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.

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.


const useFallbackHook = (storageClusterName) => {
const [storageClasses, storageClassesLoaded, storageClassLoadError] =
useK8sWatchResource<StorageClassResourceKind[]>(storageClusterResource);
Copy link
Collaborator

@SanjalKatiyar SanjalKatiyar Feb 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't u wanna pass StorageClass resource instead ??

Suggested change
useK8sWatchResource<StorageClassResourceKind[]>(storageClusterResource);
useK8sWatchResource<StorageClassResourceKind[]>(storageClassResource);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes. mistake


const useFallbackHook = (storageClusterName) => {
const [storageClasses, storageClassesLoaded, storageClassLoadError] =
useK8sWatchResource<StorageClassResourceKind[]>(storageClusterResource);
Copy link
Collaborator

@SanjalKatiyar SanjalKatiyar Feb 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this way it won't poll for resource unless needed...

Suggested change
useK8sWatchResource<StorageClassResourceKind[]>(storageClusterResource);
useK8sWatchResource<StorageClassResourceKind[]>(getValidWatchK8sResourceObj(storageClassResource, !storageClusterName));

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already poll for storageClass in the same page. so we can live with this poll. Essentially the connection is going to be shared.

*/
const useFallbackHook = (storageClusterName) => {
const [storageClasses, storageClassesLoaded, storageClassLoadError] =
useK8sWatchResource<StorageClassResourceKind[]>(scResource);
Copy link
Collaborator

@SanjalKatiyar SanjalKatiyar Feb 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this way it won't even poll when we already have a value for storageClusterName...

Suggested change
useK8sWatchResource<StorageClassResourceKind[]>(scResource);
useK8sWatchResource<StorageClassResourceKind[]>(getValidWatchK8sResourceObj(scResource, !storageClusterName));

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this resource is already called in the same page for inventory card. so we can live with this.

Copy link
Collaborator

@SanjalKatiyar SanjalKatiyar Feb 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make sense then !! (I did not check the other active components)

kind: referenceForModel(StorageClassModel),
};

const fsProvisionerPostFix = '.cephfs.csi.ceph.com';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

under common.ts let's create an enum for each ceph provisioner type and reuse the same here, in this way we can replace the cephStorageProvisioners list under common also can be replaced with enums.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to backport this to 4.15. I will create a seperate PR on top of this for 4.16

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here declare the fsProvisionerPostFix like: '.' + CEPH_FILESYSTEM_PROVISIONER

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tracking at #1215

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack

@SanjalKatiyar
Copy link
Collaborator

LGTM

Comment on lines +28 to +29
const fileSystemProvisioner = provisioners.find((item) =>
item.includes(fsProvisionerPostFix)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shall we replace this with a util function like isCephFSProvisioner?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can do that but I don't think we would have a very specific use case. We could probably go with isOCSProvisioner with more args. Adding it to #1215

Copy link
Contributor

openshift-ci bot commented Feb 7, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bipuladh, GowthamShanmugam

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@SanjalKatiyar
Copy link
Collaborator

/retitle Adds fallback layer for multi cluster code in External mode

@openshift-ci openshift-ci bot changed the title Bug 2259961: Adds fallback layer for multi cluster code in External mode Adds fallback layer for multi cluster code in External mode Feb 7, 2024
@SanjalKatiyar
Copy link
Collaborator

/cherry-pick release-4.15

@openshift-cherrypick-robot

@SanjalKatiyar: once the present PR merges, I will cherry-pick it on top of release-4.15 in a new PR and assign it to you.

In response to this:

/cherry-pick release-4.15

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.

Copy link
Contributor

openshift-ci bot commented Feb 7, 2024

@bipuladh: No Bugzilla bug is referenced in the title of this pull request.
To reference a bug, add 'Bug XXX:' to the title of this pull request and request another bug refresh with /bugzilla refresh.

In response to this:

Adds fallback layer for multi cluster code in External mode

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.

@SanjalKatiyar
Copy link
Collaborator

/cherry-pick release-4.15-compatibility

@openshift-cherrypick-robot

@SanjalKatiyar: once the present PR merges, I will cherry-pick it on top of release-4.15-compatibility in a new PR and assign it to you.

In response to this:

/cherry-pick release-4.15-compatibility

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.

@openshift-merge-bot openshift-merge-bot bot merged commit a11fb5a into red-hat-storage:master Feb 7, 2024
6 checks passed
@openshift-cherrypick-robot

@SanjalKatiyar: new pull request created: #1216

In response to this:

/cherry-pick release-4.15-compatibility

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.

@openshift-cherrypick-robot

@SanjalKatiyar: new pull request created: #1217

In response to this:

/cherry-pick release-4.15

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants