Skip to content

OCPBUGS-32228: Fix failure to create a second hostedcluster in the same namespace - #3900

Merged
openshift-merge-bot[bot] merged 2 commits into
openshift:mainfrom
muraee:fix-empty-infraid
Apr 18, 2024
Merged

openshift-merge-bot[bot] merged 2 commits into
openshift:mainfrom
muraee:fix-empty-infraid

Conversation

@muraee

@muraee muraee commented Apr 17, 2024

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:
#3234 introduced a logic to list secrets generated by the cli and set their ownerReference . However, it was executed before .spec.infraID is defaulted which caused it to try to set the ownerReference on secrets that don't belong to the HostedCluster which was causing the creation of a multiple HCs in the same namespace to fail.

This only surfaced in agent clusters since the cli doesn't automatically sets the spec.infraID and relies on the HO to default it.

The core cluster creation workflow will now generate and set infraID for all platforms.

Which issue(s) this PR fixes (optional, use fixes #<issue_number>(, fixes #<issue_number>, ...) format, where issue_number might be a GitHub issue, or a Jira story:
Fixes #OCPBUGS-32228

Checklist

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

@openshift-ci-robot openshift-ci-robot added jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Apr 17, 2024
@openshift-ci-robot

Copy link
Copy Markdown

@muraee: This pull request references Jira Issue OCPBUGS-32228, which is invalid:

  • expected the bug to target the "4.16.0" version, but no target version was set

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

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

What this PR does / why we need it:
#3234 introduced a logic to list secrets generated by the cli and set their ownerReference . However, it was executed before .spec.infraID is defaulted which caused it to try to set the ownerReference on secrets that don't belong to the HostedCluster which was causing the creation of a multiple HCs in the same namespace to fail.

This only surfaced in agent clusters since the cli doesn't automatically sets the spec.infraID and relies on the HO to default it.

The core cluster creation workflow will now generate and set infraID for all platforms.

Which issue(s) this PR fixes (optional, use fixes #<issue_number>(, fixes #<issue_number>, ...) format, where issue_number might be a GitHub issue, or a Jira story:
Fixes #OCPBUGS-32228

Checklist

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci
openshift-ci Bot requested review from davidvossel and hasueki April 17, 2024 10:08
@openshift-ci openshift-ci Bot added area/cli Indicates the PR includes changes for CLI area/hypershift-operator Indicates the PR includes changes for the hypershift operator and API - outside an OCP release labels Apr 17, 2024
@openshift-ci

openshift-ci Bot commented Apr 17, 2024

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: muraee

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details 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 openshift-ci Bot added approved Indicates a PR has been approved by an approver from all required OWNERS files. and removed do-not-merge/needs-area labels Apr 17, 2024
@muraee

muraee commented Apr 17, 2024

Copy link
Copy Markdown
Contributor Author

/jira refresh

@openshift-ci-robot openshift-ci-robot added the jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. label Apr 17, 2024
@openshift-ci-robot

Copy link
Copy Markdown

@muraee: This pull request references Jira Issue OCPBUGS-32228, which is valid. The bug has been moved to the POST state.

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

No GitHub users were found matching the public email listed for the QA contact in Jira (jiezhao@redhat.com), skipping review request.

Details

In response to this:

/jira 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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot openshift-ci-robot removed the jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. label Apr 17, 2024
muraee added 2 commits April 17, 2024 14:31
- if reconcileCLISecrets is executed before spec.infraID is set, it might list secrets not belonging to this cluster and fail to set ownerReference.
@muraee
muraee force-pushed the fix-empty-infraid branch from 66204f8 to 0325427 Compare April 17, 2024 12:31

@jparrill jparrill left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The only question I have is, this is only affected in AWS and Azure? or the other providers are also facing this issue?

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Apr 17, 2024
@muraee

muraee commented Apr 17, 2024

Copy link
Copy Markdown
Contributor Author

@jparrill its affecting user creating agent clusters using the cli.
It would also show up potentially if someone creates a cluster on any platform without the cli using yaml manifest and not set spec.infraID

@muraee

muraee commented Apr 17, 2024

Copy link
Copy Markdown
Contributor Author

/retest-required

@openshift-ci-robot

Copy link
Copy Markdown

/retest-required

Remaining retests: 0 against base HEAD 743c792 and 2 for PR HEAD 0325427 in total

@openshift-ci

openshift-ci Bot commented Apr 18, 2024

Copy link
Copy Markdown
Contributor

@muraee: all tests passed!

Full PR test history. Your PR dashboard.

Details

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. I understand the commands that are listed here.

@openshift-merge-bot
openshift-merge-bot Bot merged commit 252e43f into openshift:main Apr 18, 2024
@openshift-ci-robot

Copy link
Copy Markdown

@muraee: Jira Issue OCPBUGS-32228: All pull requests linked via external trackers have merged:

Jira Issue OCPBUGS-32228 has been moved to the MODIFIED state.

Details

In response to this:

What this PR does / why we need it:
#3234 introduced a logic to list secrets generated by the cli and set their ownerReference . However, it was executed before .spec.infraID is defaulted which caused it to try to set the ownerReference on secrets that don't belong to the HostedCluster which was causing the creation of a multiple HCs in the same namespace to fail.

This only surfaced in agent clusters since the cli doesn't automatically sets the spec.infraID and relies on the HO to default it.

The core cluster creation workflow will now generate and set infraID for all platforms.

Which issue(s) this PR fixes (optional, use fixes #<issue_number>(, fixes #<issue_number>, ...) format, where issue_number might be a GitHub issue, or a Jira story:
Fixes #OCPBUGS-32228

Checklist

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

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 openshift-eng/jira-lifecycle-plugin repository.

@muraee

muraee commented Apr 18, 2024

Copy link
Copy Markdown
Contributor Author

/cherry-pick release-4.15

@openshift-cherrypick-robot

Copy link
Copy Markdown

@muraee: #3900 failed to apply on top of branch "release-4.15":

Applying: generate infraID by default for all platforms
Using index info to reconstruct a base tree...
M	cmd/cluster/aws/create.go
M	cmd/cluster/azure/create.go
M	cmd/cluster/core/create.go
M	cmd/cluster/kubevirt/create.go
M	cmd/cluster/kubevirt/create_test.go
M	cmd/cluster/powervs/create.go
Falling back to patching base and 3-way merge...
Auto-merging cmd/cluster/powervs/create.go
CONFLICT (content): Merge conflict in cmd/cluster/powervs/create.go
Auto-merging cmd/cluster/kubevirt/create_test.go
Auto-merging cmd/cluster/kubevirt/create.go
CONFLICT (content): Merge conflict in cmd/cluster/kubevirt/create.go
Auto-merging cmd/cluster/core/create.go
Auto-merging cmd/cluster/azure/create.go
CONFLICT (content): Merge conflict in cmd/cluster/azure/create.go
Auto-merging cmd/cluster/aws/create.go
CONFLICT (content): Merge conflict in cmd/cluster/aws/create.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 generate infraID by default for all platforms
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".

Details

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.

@openshift-bot

Copy link
Copy Markdown

[ART PR BUILD NOTIFIER]

This PR has been included in build ose-hypershift-container-v4.16.0-202404181209.p0.g252e43f.assembly.stream.el9 for distgit hypershift.
All builds following this will include this PR.

@openshift-merge-robot

Copy link
Copy Markdown
Contributor

Fix included in accepted release 4.16.0-0.nightly-2024-04-21-123502

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. area/cli Indicates the PR includes changes for CLI area/hypershift-operator Indicates the PR includes changes for the hypershift operator and API - outside an OCP release jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants