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

Improve the validation for a cache upstream #130

Merged

Conversation

ialidzhikov
Copy link
Member

@ialidzhikov ialidzhikov commented Jan 18, 2024

How to categorize this PR?

/kind enhancement

What this PR does / why we need it:
While working on #129 I noticed that we actually don't support upstreams with ports but our docs state that it is supported.
A Shoot reconciliation with a cache with upstream with a port (for example public.ecr.aws:443) fails with:

v1/Secret/kube-system/registry-public-ecr-aws-config-3cfbb538\": Secret \"registry-public-ecr-aws-config-3cfbb538\" is invalid: metadata.labels: Invalid value: \"public.ecr.aws:443\": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue',  or 'my_value',  or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?'

The above message is for Secret but the same label with the same value gets added to all resources, incl. the StatefulSet. Hence, upstream with port was not working since the initial implementation.

This PR improves the validation for the cache upstream (requires to be a valid DNS subdomain (RFC 1123)) and properly updates docs so that it is clear that upstream with port is not supported.

Which issue(s) this PR fixes:
Part of #3

Special notes for your reviewer:
N/A

Release note:

The cache upstream is now required to be a a valid DNS subdomain (RFC 1123).

@gardener-prow gardener-prow bot added the kind/enhancement Enhancement, improvement, extension label Jan 18, 2024
@gardener-prow gardener-prow bot added cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 18, 2024
@dimitar-kostadinov dimitar-kostadinov self-assigned this Jan 18, 2024
Copy link
Contributor

@dimitar-kostadinov dimitar-kostadinov left a comment

Choose a reason for hiding this comment

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

/lgtm

@gardener-prow gardener-prow bot added the lgtm Indicates that a PR is ready to be merged. label Jan 19, 2024
Copy link
Contributor

gardener-prow bot commented Jan 19, 2024

LGTM label has been added.

Git tree hash: d50da5e03fd63dc58ef7051c80d4660ca4b729ab

@dimitar-kostadinov
Copy link
Contributor

/retest

@ialidzhikov
Copy link
Member Author

/approve

Copy link
Contributor

gardener-prow bot commented Jan 19, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ialidzhikov

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

@gardener-prow gardener-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 19, 2024
@gardener-prow gardener-prow bot merged commit d832bbe into gardener:main Jan 19, 2024
6 checks passed
@ialidzhikov ialidzhikov deleted the enh/forbid-upstreams-with-port branch January 19, 2024 09:25
@JordanJordanov JordanJordanov added area/ipcei IPCEI (Important Project of Common European Interest) ipcei/registry-cache-extension Registry Cache Extension labels May 21, 2024
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/ipcei IPCEI (Important Project of Common European Interest) cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. ipcei/registry-cache-extension Registry Cache Extension kind/enhancement Enhancement, improvement, extension lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants