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

feat: enhancing webhook regexp for registry check #1187

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

coffeecupjapan
Copy link

Copy link

netlify bot commented Sep 8, 2024

Deploy Preview for capsule-documentation canceled.

Name Link
🔨 Latest commit 948461b
🔍 Latest deploy log https://app.netlify.com/sites/capsule-documentation/deploys/66ddb491cc116b000870f1f8

r := regexp.MustCompile(`((?P<registry>[a-zA-Z0-9-._]+(:\d+)?)\/)?(?P<repository>.*\/)?(?P<image>[a-zA-Z0-9-._]+:(?P<tag>[a-zA-Z0-9-._]+))?`)
// registry name should start with a-zA-Z0-9 and end with a-zA-Z0-9
// @see https://github.com/kubernetes/kubernetes/blob/v1.31.0/pkg/apis/core/validation/validation.go#L7281-L7284
r := regexp.MustCompile(`((?P<registry>[a-zA-Z0-9][a-zA-Z0-9-.]+[a-zA-Z0-9](:\d+)?)\/)?(?P<repository>.*\/)?(?P<image>[a-zA-Z0-9-._]+:(?P<tag>[a-zA-Z0-9-._]+))?`)
Copy link
Member

Choose a reason for hiding this comment

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

@oliverbaehler it seems a good improvement to me, WDYT?

@prometherion prometherion changed the title fix(WebHooks): generate more correct regexp for registry name checking feat: enhancing webhook regexp for registry check Sep 16, 2024
@prometherion
Copy link
Member

@coffeecupjapan may I ask you to fix the PR according to the checks, such as DCO, pull request tile and commit message (feat: enhancing webhook regexp for registry check)?

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