Skip to content

fix: add validation to prevent invalid ReferenceGrant resources#418

Merged
andibeuge merged 2 commits intofeat/inf-3308-adapt-charts-envoy-gatewayfrom
copilot/sub-pr-413-again
Jan 30, 2026
Merged

fix: add validation to prevent invalid ReferenceGrant resources#418
andibeuge merged 2 commits intofeat/inf-3308-adapt-charts-envoy-gatewayfrom
copilot/sub-pr-413-again

Conversation

Copy link
Contributor

Copilot AI commented Jan 30, 2026

The ReferenceGrant template creates invalid Kubernetes Gateway API resources when envoy.referenceGrant.from or envoy.referenceGrant.to are empty or undefined. Gateway API spec requires both fields to have at least one entry.

Changes

  • Added conditional logic to skip ReferenceGrant creation when from or to arrays are empty
  • Extract arrays into variables with default list to safely check their length
  • Template now only renders when envoy.enabled is true AND both arrays contain at least one element
# Before: Creates invalid resource with empty from/to
envoy:
  enabled: true
  referenceGrant: {}

# After: Skips ReferenceGrant creation when arrays are empty
# Only creates resource when properly configured:
envoy:
  enabled: true
  referenceGrant:
    from:
      - kind: HTTPRoute
    to:
      - kind: Gateway
        name: gateway-api

Existing required validations on kind fields remain active to catch misconfigured entries.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…ources

Co-authored-by: andibeuge <97287249+andibeuge@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 30, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • charts.bitnami.com
    • Triggering command: /usr/local/bin/helm helm dependency update parcellab/microservice (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Update chart adaptation for Envoy Gateway support Add validation to prevent invalid ReferenceGrant resources Jan 30, 2026
Copilot AI requested a review from andibeuge January 30, 2026 08:32
@andibeuge andibeuge changed the title Add validation to prevent invalid ReferenceGrant resources fix: add validation to prevent invalid ReferenceGrant resources Jan 30, 2026
@andibeuge andibeuge marked this pull request as ready for review January 30, 2026 08:35
@andibeuge andibeuge requested review from a team as code owners January 30, 2026 08:35
@andibeuge andibeuge merged commit b8c6478 into feat/inf-3308-adapt-charts-envoy-gateway Jan 30, 2026
12 checks passed
@andibeuge andibeuge deleted the copilot/sub-pr-413-again branch January 30, 2026 08:35
andibeuge added a commit that referenced this pull request Feb 2, 2026
* feat: inf-3308 adapt charts to support Envoy Gateway

* feat: inf-3308 adapt charts to support Envoy Gateway

* feat: inf-3308 adapt charts to support Envoy Gateway

* feat: inf-3308 adapt charts to support Envoy Gateway

* chore: updates based on tests with FBA

* chore: updatae monolith

* chore: linted and added sample values to microservice for gateway

* chore: added value samples to monolith

* chore: rename file

* chore: rename file

* chore: delete unused tempalte

* fix: add validation to prevent invalid ReferenceGrant resources (#418)

* Initial plan

* fix: add validation to ReferenceGrant template to prevent invalid resources

Co-authored-by: andibeuge <97287249+andibeuge@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: andibeuge <97287249+andibeuge@users.noreply.github.com>

* fix: enhance charts to support Envoy Gateway based on feedback (#417)

* Initial plan

* Add validation for HTTPRoute hosts requirement

Co-authored-by: andibeuge <97287249+andibeuge@users.noreply.github.com>

* Use idiomatic len check for empty hosts validation

Co-authored-by: andibeuge <97287249+andibeuge@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: andibeuge <97287249+andibeuge@users.noreply.github.com>

* chore: remove invalid block

* Update parcellab/monolith/README.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update parcellab/common/templates/_referencegrant.tpl

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fix: correct policy namespace

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Andreas Beuge <andreasbeuge@abs-bmbp.fritz.box>
Co-authored-by: Andreas Beuge <andreasbeuge@abs-bmbp.local>
Co-authored-by: andibeuge <97287249+andibeuge@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants