Skip to content

Conversation

@tchap
Copy link
Contributor

@tchap tchap commented Jan 28, 2026

The --labels option was being ignored when exposing a service.
This is now fixed and .metadata.labels is set to the desired value.

@openshift-ci-robot openshift-ci-robot added 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 Jan 28, 2026
@openshift-ci-robot
Copy link

@tchap: This pull request references Jira Issue OCPBUGS-74543, which is invalid:

  • expected the bug to target the "4.22.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:

The --labels option was being ignored when exposing a service.
This is now fixed and .metadata.labels is set to the desired value.

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.

@coderabbitai
Copy link

coderabbitai bot commented Jan 28, 2026

Important

Review skipped

Auto reviews are limited based on label configuration.

🚫 Excluded labels (none allowed) (1)
  • do-not-merge/work-in-progress

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 🔍 Trigger a full review

Walkthrough

Expose command now parses user-provided labels for services, merges them into the created UnsecuredRoute's metadata labels, and returns an error if label parsing fails.

Changes

Cohort / File(s) Summary
Label parsing in expose command
pkg/cli/expose/expose.go
Added generate import; parse labels from ExposeServiceOptions.Labels via generate.ParseLabels() when present; on parse error return unable to parse labels: %w; merge parsed labels into route.ObjectMeta.Labels (assign if nil, otherwise overwrite/add keys).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes


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

@tchap
Copy link
Contributor Author

tchap commented Jan 28, 2026

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Jan 28, 2026
@openshift-ci-robot
Copy link

@tchap: This pull request references Jira Issue OCPBUGS-74543, 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.22.0) matches configured target version for branch (4.22.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @zhouying7780

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
Copy link
Contributor

openshift-ci bot commented Jan 28, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: tchap
Once this PR has been reviewed and has the lgtm label, please assign ardaguclu for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@pkg/cli/expose/expose.go`:
- Around line 188-205: The code unconditionally overwrites
route.ObjectMeta.Labels with the local variable labels (which is nil when
o.ExposeServiceOptions.Labels is omitted), discarding labels copied by
route.UnsecuredRoute; change the code to only assign route.ObjectMeta.Labels
when o.ExposeServiceOptions.Labels is non-empty (i.e., after parsing via
generate.ParseLabels or by checking len(o.ExposeServiceOptions.Labels) > 0) so
existing service labels from route.UnsecuredRoute are preserved when --labels is
not provided.

@tchap tchap force-pushed the expose-service-use-labels branch 2 times, most recently from b02b779 to d49d3a9 Compare January 28, 2026 15:19
@tchap
Copy link
Contributor Author

tchap commented Jan 28, 2026

I don't mind adding an e2e test for this once the OTE tests are merged.

@tchap tchap changed the title OCPBUGS-74543: expose: Fix labels not being added to service WIP: OCPBUGS-74543: expose: Fix labels not being added to service Jan 28, 2026
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 28, 2026
@tchap tchap changed the title WIP: OCPBUGS-74543: expose: Fix labels not being added to service WIP: OCPBUGS-74543: expose: Fix labels not being added to route Jan 28, 2026
The --labels option was being ignored when exposing a service.
This is now fixed and .metadata.labels is set to the desired value.
@tchap tchap force-pushed the expose-service-use-labels branch from d49d3a9 to d5afaa8 Compare January 28, 2026 15:28
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 28, 2026

@tchap: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-aws-ovn-serial-2of2 d5afaa8 link true /test e2e-aws-ovn-serial-2of2
ci/prow/e2e-agnostic-ovn-cmd d5afaa8 link true /test e2e-agnostic-ovn-cmd

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.

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

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants