Skip to content

GCP-1405: Handle invalid LoadBalancer resource-label annotations - #10367

Open
gbarabasz wants to merge 3 commits into
openshift:mainfrom
gbarabasz:fix/gcp-1405-invalid-lb-annotations
Open

gbarabasz wants to merge 3 commits into
openshift:mainfrom
gbarabasz:fix/gcp-1405-invalid-lb-annotations

Conversation

@gbarabasz

@gbarabasz gbarabasz commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

Invalid user-owned cloud.google.com/load-balancer-resource-labels annotations currently cause HCCO's aggregate resource reconciliation to fail, even though HCCO cannot safely repair them.

Validate existing native annotations before reconciling labels. If invalid, leave the Service unchanged, log a warning identifying the Service and a content-free validation reason, and continue processing other eligible Services. Preserve list, patch, and other label reconciliation errors.

Add regression coverage for malformed annotations, invalid label keys, duplicate keys, warning details, unchanged Service data, and continued reconciliation of valid Services. Document the behavior and regenerate aggregate docs.

Which issue(s) this PR fixes:

Fixes GCP-1405.

Special notes for your reviewer:

  • The annotation rename and upstream CCM integration are intentionally out of scope.
  • HCCO's normal periodic reconciliation remains unchanged; invalid annotations no longer cause an error-driven retry.
  • No API, ignition, MachineConfig, or NodePool config-hash changes.
  • Commits are separated into shared parser implementation/tests (HO), CPO implementation/tests, and documentation per repository layout rules.

Validation passed:

  • GO111MODULE=on GOWORK=off GOFLAGS=-mod=vendor go test -race ./control-plane-operator/hostedclusterconfigoperator/controllers/resources ./support/gcputil
  • GO111MODULE=on GOWORK=off GOFLAGS=-mod=vendor go vet ./control-plane-operator/hostedclusterconfigoperator/controllers/resources ./support/gcputil
  • GO111MODULE=on GOWORK=off GOFLAGS=-mod=vendor hack/tools/bin/golangci-lint run --new-from-rev=upstream/main ./control-plane-operator/hostedclusterconfigoperator/controllers/resources/...
  • Configured pre-commit hooks on all four changed files; applicable checks passed, YAML/API import checks skipped because no matching files changed.
  • make test-changed PULL_BASE_SHA=upstream/main
  • make docs-aggregate and make verify-docs-nav
  • Commit-message gitlint, make verify-commit-layout BASE=upstream/main, formatting, and git diff --check.
  • New regression cases fail against the unchanged upstream implementation.

Full-repository verification/test suites and cluster/E2E validation were not run. The working tree was clean after committing.

Implementation, tests, documentation, and PR description were AI-assisted using GPT-6.1 via Codex in T3 Code; changes and validation were inspected by the assistant and require human review.

Checklist:

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

Always review AI generated responses prior to use.
AI-assisted response via openshift-developer plugin

Summary by CodeRabbit

  • Bug Fixes

    • Services with malformed or invalid GCP resource-label annotations are left unchanged. A warning identifies the Service and gives a brief validation reason without exposing annotation contents.
    • Reconciliation continues for other Services instead of failing because of an invalid label annotation. Failures to list or update Services, and invalid managed-annotation metadata, remain reconciliation errors.
  • Documentation

    • Updated the GCP platform guide to describe warning events for invalid label annotations and how to view them with oc describe.

@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 20, 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 Nov 20, 2026
@openshift-ci

openshift-ci Bot commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci-robot

Copy link
Copy Markdown

@gbarabasz: This pull request references GCP-1405 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 bug to target the "5.1.0" version, but no target version was set.

Details

In response to this:

What this PR does / why we need it:

Invalid user-owned cloud.google.com/load-balancer-resource-labels annotations currently cause HCCO's aggregate resource reconciliation to fail, even though HCCO cannot safely repair them.

Validate existing native annotations before reconciling labels. If invalid, leave the Service unchanged, log a warning identifying the Service and validation failure, and continue processing other eligible Services. Preserve list, patch, and other label reconciliation errors.

Add regression coverage for malformed annotations, invalid label keys, duplicate keys, warning details, unchanged Service data, and continued reconciliation of valid Services. Document the behavior and regenerate aggregate docs.

Which issue(s) this PR fixes:

Fixes GCP-1405.

Special notes for your reviewer:

  • The annotation rename and upstream CCM integration are intentionally out of scope.
  • HCCO's normal periodic reconciliation remains unchanged; invalid annotations no longer cause an error-driven retry.
  • No API, ignition, MachineConfig, or NodePool config-hash changes.
  • Commits are separated into CPO implementation/tests and documentation per repository layout rules.

Validation passed:

  • GO111MODULE=on GOWORK=off GOFLAGS=-mod=vendor go test -race ./control-plane-operator/hostedclusterconfigoperator/controllers/resources ./support/gcputil
  • GO111MODULE=on GOWORK=off GOFLAGS=-mod=vendor go vet ./control-plane-operator/hostedclusterconfigoperator/controllers/resources ./support/gcputil
  • GO111MODULE=on GOWORK=off GOFLAGS=-mod=vendor hack/tools/bin/golangci-lint run --new-from-rev=upstream/main ./control-plane-operator/hostedclusterconfigoperator/controllers/resources/...
  • Configured pre-commit hooks on all four changed files; applicable checks passed, YAML/API import checks skipped because no matching files changed.
  • make test-changed PULL_BASE_SHA=upstream/main
  • make docs-aggregate and make verify-docs-nav
  • Commit-message gitlint, make verify-commit-layout BASE=upstream/main, formatting, and git diff --check.
  • New regression cases fail against the unchanged upstream implementation.

Full-repository verification/test suites and cluster/E2E validation were not run. The working tree was clean after committing.

Implementation, tests, documentation, and PR description were AI-assisted using GPT-6.1 via Codex in T3 Code; changes and validation were inspected by the assistant and require human review.

Checklist:

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

Always review AI generated responses prior to use.
AI-assisted response via openshift-developer plugin

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-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification

This PR uses the pipeline controller for second-stage tests. Selection and triggering follow the repository configuration.

Use /test ? to list jobs and /pipeline help for commands.

@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review.

Walkthrough

The parser now returns typed validation errors with safe reasons for invalid native resource-label annotations. Before reconciling labels, the controller parses each selected Service’s annotation. If parsing fails, it logs a warning, emits a warning event when a recorder is configured, and skips that Service without adding an error to the aggregate result. Tests cover invalid annotations, valid Services, and managed-annotation metadata errors. The documentation describes this behavior and retains Service list and patch failures as reconciliation errors.

Sequence Diagram(s)

sequenceDiagram
  participant Reconciler
  participant Parser
  participant EventRecorder
  Reconciler->>Parser: Validate Service annotation
  Parser-->>Reconciler: Return validation error and safe reason
  Reconciler->>EventRecorder: Emit warning event when configured
  Reconciler->>Reconciler: Log warning and skip invalid Service
Loading
Merge Risk: Minimal · up to 83b9b · assessed changes only

Path filters excluded changed files. This rating applies only to the assessed changes.

Pre-merge checks: Passed 11

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the GCP-1405 Jira key and the change: handling invalid LoadBalancer resource-label annotations. The raw summary and objectives confirm that invalid cloud.google.com/load-balancer-resou…
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 The check applies to Ginkgo test titles (It, Describe, Context, When and similar). The changed test files do not use Ginkgo. Both gcp_lb_service_annotations_test.go and lb_resource_labels_test.go …
Test Structure And Quality Passed The "Test Structure and Quality" check applies to Ginkgo test code. It asks for Ginkgo-specific items such as g.It blocks, BeforeEach/AfterEach setup, and ote.Informing() marking. The PR chang…
Topology-Aware Scheduling Compatibility Passed The check applies to changes in deployment manifests, operator code, or controllers. This PR modifies HCCO controller code, so the check applies. The changed files are the GCP LoadBalancer Service ann…
Ipv6 And Disconnected Network Test Compatibility Passed This check applies only when the PR adds new Ginkgo e2e tests (It, Describe, Context, When). The PR changes seven files: the HCCO LB annotation reconciler and its unit tests (`gcp_lb_service_annotatio…
No-Weak-Crypto Passed The no-weak-crypto check is not triggered by this pull request. I listed the seven changed files from the review range and searched all added lines for MD5, SHA1/SHA-1, DES, 3DES, RC4, Blowfish, ECB, …
Container-Privileges Passed The container-privileges check does not apply to this pull request. The PR changes seven files: four Go files in the HCCO resources package and gcputil, the GCP platform doc, and the aggregated docs. …
No-Sensitive-Data-In-Logs Passed The PR adds one new log statement and one new Warning Event on the invalid-annotation path. Neither includes annotation contents. - gcp_lb_service_annotations.go line 54 logs `klog.Warningf("Skippin…
Full details: Title check

Explanation

The title names the GCP-1405 Jira key and the change: handling invalid LoadBalancer resource-label annotations. The raw summary and objectives confirm that invalid cloud.google.com/load-balancer-resource-labels annotations are now validated, skipped with a warning and a Warning Event, and do not fail aggregate reconciliation. The title covers the main change, though it does not mention the warning or event behavior.

Full details: Stable And Deterministic Test Names

Explanation

The check applies to Ginkgo test titles (It, Describe, Context, When and similar). The changed test files do not use Ginkgo. Both gcp_lb_service_annotations_test.go and lb_resource_labels_test.go are standard Go testing tests. They use t.Run with static string names, and the CPO test file does not import onsi/ginkgo. The check is therefore inapplicable to this PR. For comparison, the new test names are static. They contain no pod names, timestamps, UUIDs, node names, namespaces, IP addresses, or legacy Author:/platform/Polarion metadata tokens. The names use the descriptive "When ..., it should ..." form, and the dynamic values stay in the test bodies, such as the annotation input and the expected reason.

Full details: Test Structure And Quality

Explanation

The "Test Structure and Quality" check applies to Ginkgo test code. It asks for Ginkgo-specific items such as g.It blocks, BeforeEach/AfterEach setup, and ote.Informing() marking. The PR changes seven files. Two of them are test files: control-plane-operator/hostedclusterconfigoperator/controllers/resources/gcp_lb_service_annotations_test.go and support/gcputil/lb_resource_labels_test.go. Both use the standard Go testing package with top-level func Test...(t *testing.T) functions and t.Run subtests. They use Gomega only as an assertion library, with no Ginkgo Describe, It, or BeforeEach blocks. No new It() block exists, so the informing recommendation does not apply. The check is not applicable to this PR, so it passes. The PR's test quality is outside the scope of this custom check.

Full details: Topology-Aware Scheduling Compatibility

Explanation

The check applies to changes in deployment manifests, operator code, or controllers. This PR modifies HCCO controller code, so the check applies. The changed files are the GCP LoadBalancer Service annotation reconciler, its tests, the gcputil parser and its tests, the docs, and resources.go. resources.go only adds an event recorder to the reconciler, which is initialized from the manager. I searched the full added diff for scheduling-related terms: affinity, anti-affinity, topologySpread, nodeSelector, tolerations, PodDisruptionBudget, maxUnavailable, maxSurge, replicas, node-role, control-plane, master, worker, arbiter, ControlPlaneTopology, and taint. The only matches were diff file headers. No added code creates or changes pod scheduling constraints, replica counts, PDBs, or node targeting. The change therefore does not introduce any failure condition in this check.

Full details: Ipv6 And Disconnected Network Test Compatibility

Explanation

This check applies only when the PR adds new Ginkgo e2e tests (It, Describe, Context, When). The PR changes seven files: the HCCO LB annotation reconciler and its unit tests (gcp_lb_service_annotations.go and _test.go), resources.go, support/gcputil/gcputil.go and its test, docs/content/how-to/gcp-platform.md, and the aggregated docs. None of them are e2e test files, and none sit under test/. The diff contains no Ginkgo g.It(, g.Describe(, g.Context(, or g.When( blocks. The only "Context(" matches are Go t.Context() calls in standard testing unit tests. The check is therefore not applicable, and it passes.

Full details: No-Weak-Crypto

Explanation

The no-weak-crypto check is not triggered by this pull request. I listed the seven changed files from the review range and searched all added lines for MD5, SHA1/SHA-1, DES, 3DES, RC4, Blowfish, ECB, HMAC, cipher, encrypt/decrypt, random, hash, secret, token, and password terms. No matches. The code changes in gcp_lb_service_annotations.go and support/gcputil/gcputil.go add error typing, a warning log, a warning event, and a skip path for invalid cloud.google.com/load-balancer-resource-labels annotations. They do not add or change any cryptographic primitive, custom crypto, or secret or token comparison. The remaining changes are tests, docs, and the event recorder wiring in resources.go.

Full details: Container-Privileges

Explanation

The container-privileges check does not apply to this pull request. The PR changes seven files: four Go files in the HCCO resources package and gcputil, the GCP platform doc, and the aggregated docs. None of these is a container or Kubernetes manifest. A search of the full review diff for privileged, hostPID, hostNetwork, hostIPC, SYS_ADMIN, allowPrivilegeEscalation, runAsUser, securityContext, and capabilities returned no matches. The Go changes validate the cloud.google.com/load-balancer-resource-labels annotation on Services and do not add or change any pod or container spec. No failure condition in the check is met.

Full details: No-Sensitive-Data-In-Logs

Explanation

The PR adds one new log statement and one new Warning Event on the invalid-annotation path. Neither includes annotation contents. - gcp_lb_service_annotations.go line 54 logs klog.Warningf("Skipping GCP resource label reconciliation for Service %s/%s: %s", service.Namespace, service.Name, reason). The reason value comes from LBResourceLabelsValidationError.Reason or a fixed fallback string. It is not the raw annotation value. - The Warning Event (lines 55–58) uses reason InvalidGCPResourceLabels. Its message contains the reason and the annotation name (gcputil.LBResourceLabelsAnnotation), not the value. - In support/gcputil/gcputil.go, each Reason is a constant string: "too many labels", "expected key=value format", "invalid label key or value", "duplicate label key". The detailed error messages, which can include the pair text or key, are not passed to any new log or event. They only remain on the error chain. - The Service namespace and name are Kubernetes object identifiers. They are not credentials, PII, or customer data. The docs state that the log and Event exclude annotation contents. Other errors (list, patch, and managed-key reconcile errors) keep their existing behavior. Those errors are returned, not newly logged, and this PR does not change what they contain. The diff adds no logging of tokens, passwords, or other sensitive values.

Warning

Some tools did not complete. Review the errors below.

golangci-lint (2.15.0)

golangci-lint (2.15.0) skipped for .golangci.yml: configuration contains disallowed or uninspectable plugin or linter settings. Use supported built-in linters.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: openshift/hypershift
  • Branch: main
  • File: .coderabbit.yaml
  • Commit: a24060b
  • Layers: Repository YAML (base), Central YAML (inherited)
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: dacc3fed-5f07-4fbe-9353-1cf0943435f3
Commits

Reviewing files that changed from the base of the PR and between ed8265a and 83b9b3a.

Files ignored due to path filters: 1

  • docs/content/reference/aggregated-docs.md is excluded by !docs/content/reference/aggregated-docs.md
Files selected for processing: 4

  • control-plane-operator/hostedclusterconfigoperator/controllers/resources/gcp_lb_service_annotations.go
  • control-plane-operator/hostedclusterconfigoperator/controllers/resources/gcp_lb_service_annotations_test.go
  • control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go
  • docs/content/how-to/gcp-platform.md
Files skipped from review as they are similar to previous changes: 1

  • docs/content/how-to/gcp-platform.md

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 10 remain after this review.

@openshift-ci openshift-ci Bot added area/control-plane-operator Indicates the PR includes changes for the control plane operator - in an OCP release area/documentation Indicates the PR includes changes for documentation area/platform/gcp PR/issue for GCP (GCPPlatform) platform and removed do-not-merge/needs-area labels Nov 20, 2026
@codecov

codecov Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 53.91%. Comparing base (0f43b29) to head (d015a8c).
⚠️ Report is 15 commits behind head on main.

⚠️ Current head d015a8c differs from pull request most recent head 83b9b3a

Please upload reports for the commit 83b9b3a to get more accurate results.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #10367   +/-   ##
=======================================
  Coverage   53.90%   53.91%           
=======================================
  Files         857      857           
  Lines      108393   108396    +3     
=======================================
+ Hits        58434    58437    +3     
  Misses      46303    46303           
  Partials     3656     3656           
Files with missing lines Coverage Δ
...ontrollers/resources/gcp_lb_service_annotations.go 95.23% <100.00%> (+0.36%) ⬆️
Flag Coverage Δ
cmd-support 47.85% <ø> (ø)
cpo-hostedcontrolplane 56.83% <ø> (ø)
cpo-other 58.48% <100.00%> (+<0.01%) ⬆️
hypershift-operator 61.44% <ø> (ø)
other 42.88% <ø> (ø)

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.

@gbarabasz
gbarabasz marked this pull request as ready for review November 20, 2026 16:09
@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 Nov 20, 2026
@redhat-chai-bot

Copy link
Copy Markdown
Contributor

Chai risk assessment for d015a8cb9699cd999b1dec998df61235b0089076 → main

Tier: Moderate
Assessed: Moderate
Minimum: Low
Signals: 4 files, +78/-13 lines outside vendored and generated code; no API type changes; no CRD schema changes; full diff read.
Rubric: https://github.com/openshift-eng/ai-helpers/tree/80b2e7e91e1a52028a1ab1a9bbf98d495260a0ee/plugins/openshift-developer/skills/pr-risk-assessment

Reason: The change is in HCCO's GCP LoadBalancer Service annotation reconciler. When a guest Service has a malformed or invalid cloud.google.com/load-balancer-resource-labels annotation, HCCO now logs a warning and skips that Service instead of returning an aggregate reconcile error. This is a runtime behaviour change in a shipped controller, so it is not Low. It is Moderate rather than Critical because it is a fix confined to a path that already fails. On main, ReconcileLBResourceLabelAnnotations already calls ParseLBResourceLabelsAnnotation first and returns its error. The new pre-check calls that same validator, so Services with valid annotations take exactly the same path as before. Services with invalid annotations were never patched before and still are not. Errors from invalid managed-key metadata, list and patch still surface, as the tests confirm. A plausible defect would leave labels unreconciled on a Service, or hide an error that used to trigger a retry. It would not touch Service data paths, node pools, config hashes or APIs. The other files are unit tests and docs. Signals: 4 files, +78/-13, no API or CRD changes, full diff read.

Change it with @redhat-chai-bot /risk-tier <low|moderate|critical>: anyone can raise the tier; lowering it needs two OWNERS approvers and lasts until the next push.

/label chai-risk-assessment/moderate

@openshift-ci openshift-ci Bot added the chai-risk-assessment/moderate Chai risk assessment of the latest commit: moderate (may change product behaviour). label Nov 20, 2026
@openshift-ci

openshift-ci Bot commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

@gbarabasz: 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.

@gbarabasz

Copy link
Copy Markdown
Contributor Author

/retest

@red-hat-konflux

Copy link
Copy Markdown
Contributor

All PipelineRuns for this commit have already succeeded. Use /retest <pipeline-name> to re-run a specific pipeline or /test to re-run all pipelines.

Retain detailed native annotation parser errors while exposing content-free
reasons for controller warnings. Test safe reasons for malformed, invalid,
duplicate, and excessive labels.

Refs: GCP-1405
Assisted-by: LLM
Signed-off-by: Grzegorz (Greg) Barabasz <gbarabas@redhat.com>
@gbarabasz
gbarabasz force-pushed the fix/gcp-1405-invalid-lb-annotations branch from d015a8c to ed8265a Compare November 23, 2026 10:14
@openshift-ci openshift-ci Bot added the area/hypershift-operator Indicates the PR includes changes for the hypershift operator and API - outside an OCP release label Nov 23, 2026
@redhat-chai-bot

Copy link
Copy Markdown
Contributor

Chai risk assessment for ed8265afb3f37161e9a1d5926fbc552df4a2e700 → main

Tier: Moderate
Assessed: Moderate
Minimum: Low
Signals: 6 files, +121/-17 lines outside vendored and generated code; no API type changes; no CRD schema changes; full diff read.
Rubric: https://github.com/openshift-eng/ai-helpers/tree/8b588bd3c993913e6687fa7688ed6ac0c809e173/plugins/openshift-developer/skills/pr-risk-assessment

Reason: This changes how HCCO reconciles GCP LoadBalancer Service annotations at runtime. If a guest Service has a malformed or invalid cloud.google.com/load-balancer-resource-labels annotation, HCCO now logs a warning with a safe reason and skips that Service. Before, it returned an aggregate reconcile error that caused a retry. Because a shipped controller behaves differently, this is not Low. It is Moderate rather than Critical because the fix is confined to a path that already fails. On main, ReconcileLBResourceLabelAnnotations already calls ParseLBResourceLabelsAnnotation first and returns its error. The new pre-check calls the same validator, so Services with valid annotations follow exactly the same path. Services with invalid annotations were not patched before and still are not. In support/gcputil, the parser's errors are now wrapped in LBResourceLabelsValidationError. That type embeds the original error, so its Error() text does not change. A search of the base branch found no callers of the parser other than the reconcile function and the new pre-check. Errors from invalid managed-key metadata, from listing Services and from patching them still surface. A plausible defect would leave labels unreconciled on a Service, or hide an error that used to trigger a retry. It would not reach Service data paths, NodePools, config hashes or APIs. The remaining files are unit tests and docs. Signals: 6 files, +121/-17, no API or CRD changes, full diff read.

Change it with @redhat-chai-bot /risk-tier <low|moderate|critical>: anyone can raise the tier; lowering it needs two OWNERS approvers and lasts until the next push.

…tations

Leave invalid native Service annotations unchanged and warn instead of
failing aggregate HCCO reconciliation. Continue processing other Services
while retaining operational and other label reconciliation errors.

Log the Service identity and safe validation reason without raw annotation
content. Emit a Warning Event on the affected guest Service so its owner
can identify and correct the annotation without management-cluster access.

Test annotation preservation, safe warning and Event contents, absence of
Events for valid Services, and continued reconciliation.

Refs: GCP-1405
Assisted-by: LLM
Signed-off-by: Grzegorz (Greg) Barabasz <gbarabas@redhat.com>
Document that invalid native annotations are preserved and skipped with a
content-free warning while other Services continue reconciling. Explain
how users can inspect the Warning Event on the affected guest Service.
Clarify that list and patch failures remain errors, and regenerate
aggregate documentation.

Refs: GCP-1405
Assisted-by: LLM
Signed-off-by: Grzegorz (Greg) Barabasz <gbarabas@redhat.com>
@gbarabasz
gbarabasz force-pushed the fix/gcp-1405-invalid-lb-annotations branch from ed8265a to 83b9b3a Compare November 23, 2026 10:40
@openshift-ci

openshift-ci Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: patjlm
Once this PR has been reviewed and has the lgtm label, please assign devguyio 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

@redhat-chai-bot

Copy link
Copy Markdown
Contributor

Chai risk assessment for 83b9b3adc0ec239447cd27dd0f2f9b33d051fc80 → main

Tier: Moderate
Assessed: Moderate
Minimum: Low
Signals: 7 files, +150/-18 lines outside vendored and generated code; no API type changes; no CRD schema changes; full diff read.
Rubric: https://github.com/openshift-eng/ai-helpers/tree/8b588bd3c993913e6687fa7688ed6ac0c809e173/plugins/openshift-developer/skills/pr-risk-assessment

Reason: This head changes how HCCO reconciles GCP LoadBalancer Service annotations at runtime. Before, a malformed or invalid cloud.google.com/load-balancer-resource-labels annotation on a guest Service produced an aggregate reconcile error and a retry. Now HCCO logs a warning with a safe reason, skips that Service and continues with the others. New in this head: the HCCO resources reconciler gets an event recorder from opts.Manager.GetEventRecorderFor, and HCCO records an InvalidGCPResourceLabels Warning Event on the affected guest Service. A search of the base branch found no event recorder in HCCO before this change, so emitting these events is new HCCO behaviour. The rubric names emitting a Kubernetes event as Moderate. A failure to record an event does not block the reconcile. The rest is a fix confined to a path that already fails. The pre-check calls the same parser that ReconcileLBResourceLabelAnnotations already calls first, so Services with valid annotations take an unchanged path. Services with invalid annotations were not patched before and still are not. The parser's errors are now wrapped in LBResourceLabelsValidationError, which embeds the original error, so their Error() text does not change. Errors from listing Services, patching them and invalid managed-key metadata still surface. A plausible defect would leave labels unreconciled, hide a retry, or produce extra or failed events. It would not reach NodePool config hashes, ignition, APIs or Service data paths, so this is not Critical. Signals: 7 files, +150/-18, no API or CRD changes, full diff read; tests and docs are Low.

Change it with @redhat-chai-bot /risk-tier <low|moderate|critical>: anyone can raise the tier; lowering it needs two OWNERS approvers and lasts until the next push.

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Nov 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-from-pr-aws
/test e2e-kubevirt-aws-ovn-reduced
/test e2e-v2-aws
/test e2e-v2-azure-self-managed
/test e2e-v2-gke

This branch was successfully deployed

1 active (outdated) deployment
docs-preview/pr-10367 — d015a8cb Deployed Nov 20, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/control-plane-operator Indicates the PR includes changes for the control plane operator - in an OCP release area/documentation Indicates the PR includes changes for documentation area/hypershift-operator Indicates the PR includes changes for the hypershift operator and API - outside an OCP release area/platform/gcp PR/issue for GCP (GCPPlatform) platform chai-risk-assessment/moderate Chai risk assessment of the latest commit: moderate (may change product behaviour). 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.

4 participants