Skip to content

RFE-9138: feat: label some hosted control plane services - #8298

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
ingvagabund:label-some-services
Sep 1, 2026
Merged

RFE-9138: feat: label some hosted control plane services#8298
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
ingvagabund:label-some-services

Conversation

@ingvagabund

@ingvagabund ingvagabund commented Apr 21, 2026

Copy link
Copy Markdown
Member

What this PR does / why we need it:

Not every hosted control plane service is labeled. Which makes it impossible to list a service or a list of service using a label selector. E.g. when a Metal load balancer needs to select the Hosted Clusters Services for the IPAddressPool.

The service labeling is aligned with the corresponding component labels:

  • oauth-openshift: app: oauth-openshift (from the component's Deployment spec)
  • konnectivity-server: app: konnectivity-agent (from the component's DS spec)
  • ignition-server: app: ignition-server (from the component's Deployment spec)

Which issue(s) this PR fixes:

Fixes

Special notes for your reviewer:

Checklist:

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

Summary by CodeRabbit

  • Chores
    • Added metadata labels to Kubernetes Service resources for the OAuth server, konnectivity server, and ignition server, improving service identification and selection.
  • Tests
    • Updated service expectations to include the new metadata labels.
    • Added coverage confirming generated service and route resources use the configured namespaces and expected names.

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Apr 21, 2026
@openshift-ci-robot

openshift-ci-robot commented Apr 21, 2026

Copy link
Copy Markdown

@ingvagabund: This pull request references RFE-9138 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 feature request to target the "5.0.0" version, but no target version was set.

Details

In response to this:

To allow the services to be listed through a label selector. The service labeling is aligned with the corresponding component labels:

  • oauth-openshift: app: oauth-openshift (from the component's Deployment spec)
  • konnectivity-server: app: konnectivity-agent (from the component's DS spec)
  • ignition-server: app: ignition-server (from the component's Deployment spec)

What this PR does / why we need it:

Not every hosted control plane service is labeled. Which makes it impossible to list a service or a list of service using a label selector. E.g. when a Metal load balancer needs to select the Hosted Clusters Services for the IPAddressPool.

Which issue(s) this PR fixes:

Fixes

Special notes for your reviewer:

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 added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/needs-area labels Apr 21, 2026
@coderabbitai

coderabbitai Bot commented Apr 21, 2026

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The changes add app labels to OAuth, Konnectivity, and ignition-server Kubernetes Services. The OAuth and Konnectivity manifest builders set the labels in ObjectMeta.Labels. The ignition-server Service asset sets metadata.labels.app. Tests update the OAuth Service fixture and validate service and route builder output names and namespaces.

Suggested reviewers: sjenning, clebs, devguyio

🚥 Pre-merge checks | ✅ 11
✅ Passed checks (11 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding labels to selected hosted control plane services.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed Added subtests use literal names that describe static builder functions and behavior; dynamic namespace data stays in test bodies, with no generated identifiers or runtime values in titles.
Test Structure And Quality ✅ Passed The PR adds standard testing unit tests with Gomega, not Ginkgo It blocks; they create no cluster resources and use no waits requiring the listed Ginkgo checks.
Topology-Aware Scheduling Compatibility ✅ Passed The PR adds only Service metadata labels and matching fixtures/tests; the diff introduces no affinity, topology spread, replica, node selector, toleration, taint, or PDB scheduling constraints.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The diff adds only standard Go unit tests (func Test..., testing, Gomega) and manifest fixtures; it adds no Ginkgo e2e tests, IPv4 assumptions, or external connectivity.
No-Weak-Crypto ✅ Passed The diff adds only Service labels, tests, and regenerated 64-hex hashes; it introduces no MD5, SHA1, DES, RC4, Blowfish, ECB, custom crypto, or secret comparisons.
Container-Privileges ✅ Passed The PR diff adds only Service labels and fixture hash updates; it introduces no privileged, hostPID, hostNetwork, hostIPC, SYS_ADMIN, root, or allowPrivilegeEscalation settings.
No-Sensitive-Data-In-Logs ✅ Passed The PR adds Service labels and fixture tests only; the diff introduces no logging calls or output containing passwords, tokens, API keys, PII, hostnames, session IDs, or customer data.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@openshift-ci
openshift-ci Bot requested review from clebs and devguyio April 21, 2026 10:53
@openshift-ci openshift-ci Bot added area/control-plane-operator Indicates the PR includes changes for the control plane operator - in an OCP release and removed do-not-merge/needs-area labels Apr 21, 2026
@ingvagabund
ingvagabund marked this pull request as draft April 21, 2026 10:55
@ingvagabund

Copy link
Copy Markdown
Member Author

/retest-required

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@control-plane-operator/controllers/hostedcontrolplane/manifests/infra.go`:
- Around line 144-146: The KonnectivityServerService resource's metadata Labels
map currently uses "app: konnectivity-agent" which mismatches the service
selector produced by kasLabels(); update the Labels in the
KonnectivityServerService definition (infra.go, the Labels map in the service
metadata) to use "app: kube-apiserver" so the resource labels reflect the actual
selector used by kasLabels() and remain consistent at reconciliation time.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: bab30a8d-90ad-4b47-8043-248f6a5a7bfc

📥 Commits

Reviewing files that changed from the base of the PR and between d0a4024 and b39164b.

📒 Files selected for processing (2)
  • control-plane-operator/controllers/hostedcontrolplane/manifests/infra.go
  • control-plane-operator/controllers/hostedcontrolplane/v2/assets/ignition-server/service.yaml

Comment on lines +144 to +146
Labels: map[string]string{
"app": "konnectivity-agent",
},

@coderabbitai coderabbitai Bot Apr 21, 2026

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.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Verify konnectivity service selector and deployment labels

echo "=== Searching for konnectivity-server service full specification ==="
rg -n -A 20 "func.*KonnectivityServerService" --type=go

echo -e "\n=== Searching for konnectivity service selector configuration ==="
rg -n "konnectivity.*selector" --type=go --type=yaml -C 3

echo -e "\n=== Searching for konnectivity-server deployment/daemonset ==="
fd -e yaml -e go "konnectivity-server" -x echo "File: {}" \; -x head -30 {}

echo -e "\n=== Searching for konnectivity-agent deployment/daemonset ==="
fd -e yaml -e go "konnectivity-agent" -x echo "File: {}" \; -x head -30 {}

echo -e "\n=== Checking if service selector gets populated elsewhere ==="
rg -n "KonnectivityServerService.*Spec.*Selector" --type=go -C 5

Repository: openshift/hypershift

Length of output: 10600


🏁 Script executed:

#!/bin/bash
# Find the kasLabels() function definition and context

echo "=== Searching for kasLabels() function definition ==="
rg -n "func kasLabels" --type=go -A 5

echo -e "\n=== Checking kas/service.go for context around selector assignment ==="
rg -n "svc.Spec.Selector = kasLabels" --type=go -B 3 -A 5

echo -e "\n=== Searching for kasLabels usage in other services ==="
rg -n "kasLabels()" --type=go -B 2 -A 2

echo -e "\n=== Checking if metadata labels are used elsewhere ==="
rg -n "konnectivity-agent" --type=go -C 3

Repository: openshift/hypershift

Length of output: 47414


Change metadata labels to match the actual service selector.

The KonnectivityServerService has metadata labels set to app: konnectivity-agent, but the service selector is set to app: kube-apiserver (via kasLabels() in the reconciler at kas/service.go:281). This mismatch is misleading—the metadata labels should reflect what the selector actually targets. Update the labels in infra.go lines 144-145 to app: kube-apiserver for consistency with the selector set at reconciliation time.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@control-plane-operator/controllers/hostedcontrolplane/manifests/infra.go`
around lines 144 - 146, The KonnectivityServerService resource's metadata Labels
map currently uses "app: konnectivity-agent" which mismatches the service
selector produced by kasLabels(); update the Labels in the
KonnectivityServerService definition (infra.go, the Labels map in the service
metadata) to use "app: kube-apiserver" so the resource labels reflect the actual
selector used by kasLabels() and remain consistent at reconciliation time.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is invalid. The label used to identify the service is different from the selector it has to select specific pods.
It does make sense to have a label to find the service and it does not change its current behavior when routing to pods with label app: kube-apiserver.

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.

@clebs, you're absolutely right, and I apologize for the confusion. I incorrectly conflated two distinct Kubernetes concepts:

  • metadata.labels — labels on the Service object itself, used by external selectors (like a Metal LB IPAddressPool) to find the Service.
  • spec.selector — used by the Service to route traffic to matching pods.

The label app: konnectivity-agent on the Service metadata is entirely independent of the spec.selector (set to app: kube-apiserver via kasLabels()). Adding the metadata label does not affect pod routing at all. The PR's intent is valid and the implementation is correct.


📝 Learnings were identified and not saved (knowledge base disabled). Enable

@ingvagabund
ingvagabund force-pushed the label-some-services branch 2 times, most recently from 3e8a572 to 80c768b Compare April 21, 2026 12:05
@codecov

codecov Bot commented Apr 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 46.30%. Comparing base (8b0fbb6) to head (aa530f2).
⚠️ Report is 75 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8298      +/-   ##
==========================================
+ Coverage   46.13%   46.30%   +0.17%     
==========================================
  Files         783      783              
  Lines       98377    98412      +35     
==========================================
+ Hits        45382    45567     +185     
+ Misses      49919    49769     -150     
  Partials     3076     3076              
Files with missing lines Coverage Δ
.../controllers/hostedcontrolplane/manifests/infra.go 100.00% <100.00%> (+100.00%) ⬆️

... and 1 file with indirect coverage changes

Flag Coverage Δ
cmd-support 39.76% <ø> (+0.15%) ⬆️
cpo-hostedcontrolplane 49.02% <100.00%> (+0.70%) ⬆️
cpo-other 46.11% <ø> (ø)
hypershift-operator 57.14% <ø> (ø)
other 34.71% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ingvagabund
ingvagabund marked this pull request as ready for review April 21, 2026 14:36
@openshift-ci
openshift-ci Bot requested review from jparrill and sjenning April 21, 2026 14:37
@ingvagabund

Copy link
Copy Markdown
Member Author

/retest-required

@clebs

clebs commented Apr 23, 2026

Copy link
Copy Markdown
Member

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Apr 23, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-aks
/test e2e-aws
/test e2e-aws-upgrade-hypershift-operator
/test e2e-azure-self-managed
/test e2e-kubevirt-aws-ovn-reduced
/test e2e-v2-aws

@clebs

clebs commented Apr 23, 2026

Copy link
Copy Markdown
Member

/unassign
/assign @devguyio

@openshift-ci openshift-ci Bot assigned devguyio and unassigned clebs Apr 23, 2026
@ingvagabund ingvagabund changed the title wip: RFE-9138: feat: label some hosted control plane services RFE-9138: feat: label some hosted control plane services Apr 23, 2026
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 23, 2026
@hypershift-jira-solve-ci

Copy link
Copy Markdown
Contributor

AI Test Failure Analysis

Job: pull-ci-openshift-hypershift-main-e2e-azure-self-managed | Build: 2047239919058817024 | Cost: $3.5705067499999994 | Failed step: hypershift-azure-run-e2e-self-managed

View full analysis report


Generated by hypershift-analyze-e2e-failure post-step using Claude claude-opus-4-6

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 25, 2026
@jparrill

Copy link
Copy Markdown
Contributor

/lgtm

@jparrill

Copy link
Copy Markdown
Contributor

/verified by Unit tests passing.

Labels added to deployment and covered by unit test. Self-verification is enough

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Aug 25, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@jparrill: This PR has been marked as verified by Unit tests passing..

Details

In response to this:

/verified by Unit tests passing.

Labels added to deployment and covered by unit test. Self-verification is enough

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 added the lgtm Indicates that a PR is ready to be merged. label Aug 25, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-aks
/test e2e-aws
/test e2e-aws-upgrade-hypershift-operator
/test e2e-kubevirt-aws-ovn-reduced
/test e2e-v2-aws
/test e2e-v2-azure-self-managed
/test e2e-v2-gke

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD 926828a and 2 for PR HEAD aa530f2 in total

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD 9674af4 and 1 for PR HEAD aa530f2 in total

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD 94167e7 and 0 for PR HEAD aa530f2 in total

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

/hold

Revision aa530f2 was retested 3 times: holding

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 25, 2026
@ingvagabund

Copy link
Copy Markdown
Member Author

/hold cancel

@openshift-ci openshift-ci Bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 26, 2026
@ingvagabund

Copy link
Copy Markdown
Member Author

/retest-required

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD 0b61ee9 and 2 for PR HEAD aa530f2 in total

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD 9631a28 and 1 for PR HEAD aa530f2 in total

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD a2a920b and 0 for PR HEAD aa530f2 in total

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

/hold

Revision aa530f2 was retested 3 times: holding

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 27, 2026
@ingvagabund

Copy link
Copy Markdown
Member Author

/hold cancel

@ingvagabund

Copy link
Copy Markdown
Member Author

/retest-required

@openshift-ci openshift-ci Bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 31, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD 63781a0 and 2 for PR HEAD aa530f2 in total

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD 6c6d9de and 1 for PR HEAD aa530f2 in total

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD 51713fb and 0 for PR HEAD aa530f2 in total

@openshift-ci

openshift-ci Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

@ingvagabund: 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-sigs/prow repository. I understand the commands that are listed here.

@openshift-merge-bot
openshift-merge-bot Bot merged commit ba7f307 into openshift:main Sep 1, 2026
45 checks passed
@ingvagabund
ingvagabund deleted the label-some-services branch September 1, 2026 12:23
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/control-plane-operator Indicates the PR includes changes for the control plane operator - in an OCP release 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. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants