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

HOSTEDCP-1305: Simplify HostedControlPlaneNamespace().Name #2619

Merged
merged 1 commit into from Nov 16, 2023

Conversation

nunnatsa
Copy link
Contributor

@nunnatsa nunnatsa commented May 28, 2023

What this PR does / why we need it

32 out of 38 calls to HostedControlPlaneNamespace are only to get the
controlPlane namespace name. These cases are actually creating a namespace object only to take its Name field.

This PR renames the HostedControlPlaneNamespace function, to HostedControlPlaneNamespaceObject, and add a new HostedControlPlaneNamespace function to only return the namespace name. Then use this new function anywhere we only want the namespace name, to simplify the code by avoiding the creation of the namespace object just to then take the Name field.

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 openshift-ci bot requested review from csrwng and enxebre May 28, 2023 12:38
@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 area/testing Indicates the PR includes changes for e2e testing and removed do-not-merge/needs-area labels May 28, 2023
@nunnatsa
Copy link
Contributor Author

/test e2e-kubevirt-aws-ovn

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 4, 2023
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 6, 2023
@nunnatsa nunnatsa force-pushed the controlplane-ns branch 2 times, most recently from fc97605 to 98aef28 Compare July 12, 2023 07:00
@nunnatsa
Copy link
Contributor Author

/test e2e-aws

@nunnatsa nunnatsa force-pushed the controlplane-ns branch 2 times, most recently from 818cf41 to 9f3a157 Compare July 12, 2023 14:33
@openshift-bot
Copy link

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci openshift-ci bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 20, 2023
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 20, 2023
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 15, 2023
@csrwng
Copy link
Contributor

csrwng commented Nov 15, 2023

/remove-lifecycle stale

@openshift-ci openshift-ci bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Nov 15, 2023
@csrwng
Copy link
Contributor

csrwng commented Nov 15, 2023

/lgtm

@enxebre
Copy link
Member

enxebre commented Nov 15, 2023

/approve

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 15, 2023
Copy link
Contributor

openshift-ci bot commented Nov 15, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: enxebre, nunnatsa

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 openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 15, 2023
@nunnatsa
Copy link
Contributor Author

/retest

@nunnatsa nunnatsa changed the title Simplify HostedControlPlaneNamespace().Name HOSTEDCP-1305: Simplify HostedControlPlaneNamespace().Name Nov 15, 2023
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Nov 15, 2023
@openshift-ci-robot
Copy link

openshift-ci-robot commented Nov 15, 2023

@nunnatsa: This pull request references HOSTEDCP-1305 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.15.0" version, but no target version was set.

In response to this:

What this PR does / why we need it

32 out of 38 calls to HostedControlPlaneNamespace are only to get the
controlPlane namespace name. These cases are actually creating a namespace object only to take its Name field.

This PR renames the HostedControlPlaneNamespace function, to HostedControlPlaneNamespaceObject, and add a new HostedControlPlaneNamespace function to only return the namespace name. Then use this new function anywhere we only want the namespace name, to simplify the code by avoiding the creation of the namespace object just to then take the Name field.

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 kubernetes/test-infra repository.

@nunnatsa
Copy link
Contributor Author

/retest

2 similar comments
@nunnatsa
Copy link
Contributor Author

/retest

@nunnatsa
Copy link
Contributor Author

/retest

44 out of 49 calls to `HostedControlPlaneNamespace` are only to get the
   controlPlane namespace name. This PR adds the
`HostedControlPlaneNamespaceName` function and use it anywhere we only want
the namespace name, to simplify the code by not creating the namespace
object just to then take the `Name` field.

Signed-off-by: Nahshon Unna-Tsameret <nunnatsa@redhat.com>
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Nov 16, 2023
@enxebre
Copy link
Member

enxebre commented Nov 16, 2023

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 16, 2023
Copy link
Contributor

openshift-ci bot commented Nov 16, 2023

@nunnatsa: all tests passed!

Full PR test history. Your PR dashboard.

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 3a42e77 into openshift:main Nov 16, 2023
12 checks passed
@nunnatsa nunnatsa deleted the controlplane-ns branch November 16, 2023 09:48
@openshift-bot
Copy link

[ART PR BUILD NOTIFIER]

This PR has been included in build ose-hypershift-container-v4.15.0-202311161132.p0.g3a42e77.assembly.stream for distgit hypershift.
All builds following this will include this PR.

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 area/testing Indicates the PR includes changes for e2e testing 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.

None yet

6 participants