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

Bug 1897830: Fix cluster creation when using localvolume #7552

Merged

Conversation

afreen23
Copy link
Contributor

@afreen23 afreen23 commented Dec 15, 2020

  • use the nodeSelector field to get the associated nodes for a PV
  • drops the usage of labels for pv association

Before:
Screenshot from 2020-12-16 13-18-11

After:
Screenshot from 2020-12-16 13-18-20

- use the nodeSelector field to get the associated nodes for a PV
- drops the usage of labels

Signed-off-by: Afreen Rahman <afrahman@redhat.com>
@openshift-ci-robot openshift-ci-robot added bugzilla/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. labels Dec 15, 2020
@openshift-ci-robot
Copy link
Contributor

@afreen23: This pull request references Bugzilla bug 1897830, which is invalid:

  • expected the bug to target the "4.7.0" release, but it targets "---" instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

Bug 1897830: Fix cluster creation when using localvolume

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-robot openshift-ci-robot added the component/ceph Related to ceph-storage-plugin label Dec 15, 2020
@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 15, 2020
@afreen23
Copy link
Contributor Author

/bugzilla refresh

@openshift-ci-robot openshift-ci-robot added the bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. label Dec 15, 2020
@openshift-ci-robot
Copy link
Contributor

@afreen23: This pull request references Bugzilla bug 1897830, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.7.0) matches configured target release for branch (4.7.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

/bugzilla refresh

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-robot openshift-ci-robot removed the bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. label Dec 15, 2020
@afreen23
Copy link
Contributor Author

/test analyze

Copy link
Contributor

@cloudbehl cloudbehl left a comment

Choose a reason for hiding this comment

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

Just wanted to understand why we are doing this at first?

res.add(nodeName);
}
const matchExpressions: MatchExpression[] =
pv?.spec?.nodeAffinity?.required?.nodeSelectorTerms?.[0]?.matchExpressions;
Copy link
Contributor

Choose a reason for hiding this comment

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

what if there are multiple node selectors? I think that was the reason we relied on PV label.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For LSO PVs, it will always have hostname based selector.
I confirmed with LSO team on that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Relying on node affinity is more reliable over label selector. The node affinity field is a mandatory one for PV and will always be present on every PV unlike labels - added as per convenience.
Thats why we had issues in supporting 4.5 OCS on OCP 4.6 where users were trying to create storage cluster via local volume CR and they are blocked, since the pVs created via local volume are not labeled by hostname

Copy link
Contributor

Choose a reason for hiding this comment

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

The PV's not labeled shouldn't it be fixed in LSO operator? They should provide consistency when the PV is created and have label set.

@@ -48,10 +52,13 @@ export const getTotalDeviceCapacity = (list: Discoveries[]): number =>

export const getAssociatedNodes = (pvs: K8sResourceKind[]): string[] => {
const nodes = pvs.reduce((res, pv) => {
const nodeName = pv?.metadata?.labels?.[HOSTNAME_LABEL_KEY];
Copy link
Contributor

Choose a reason for hiding this comment

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

can you tell in which case the HOSTNAME_LABEL_KEY will not be present if =done from localVolumeSet?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is not any case for local volume set.
The bug is for local volume fix and an improvement over the current implementation where we identify nodes via labels.
See https://github.com/openshift/console/pull/7552/files#r543672246

@openshift-ci-robot
Copy link
Contributor

@afreen23: This pull request references Bugzilla bug 1897830, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.7.0) matches configured target release for branch (4.7.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1897830: Fix cluster creation when using localvolume

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.

1 similar comment
@openshift-ci-robot
Copy link
Contributor

@afreen23: This pull request references Bugzilla bug 1897830, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.7.0) matches configured target release for branch (4.7.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1897830: Fix cluster creation when using localvolume

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.

@cloudbehl
Copy link
Contributor

/lgtm

@cloudbehl
Copy link
Contributor

/test e2e-gcp-console

@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: afreen23, cloudbehl

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

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Dec 16, 2020
@openshift-merge-robot openshift-merge-robot merged commit 2efa276 into openshift:master Dec 16, 2020
@openshift-ci-robot
Copy link
Contributor

@afreen23: All pull requests linked via external trackers have merged:

Bugzilla bug 1897830 has been moved to the MODIFIED state.

In response to this:

Bug 1897830: Fix cluster creation when using localvolume

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.

@afreen23
Copy link
Contributor Author

/cherrypick release-4.6

@openshift-cherrypick-robot

@afreen23: #7552 failed to apply on top of branch "release-4.6":

Applying: Bug 1897830: Fix cluster creation when using localvolume - use the nodeSelector field to get the associated nodes for a PV - drops the usage of labels
Using index info to reconstruct a base tree...
M	frontend/packages/ceph-storage-plugin/src/utils/install.ts
Falling back to patching base and 3-way merge...
Auto-merging frontend/packages/ceph-storage-plugin/src/utils/install.ts
CONFLICT (content): Merge conflict in frontend/packages/ceph-storage-plugin/src/utils/install.ts
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Bug 1897830: Fix cluster creation when using localvolume - use the nodeSelector field to get the associated nodes for a PV - drops the usage of labels
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherrypick release-4.6

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
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. component/ceph Related to ceph-storage-plugin lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants