Skip to content

Comments

feat: enhancing webhook regexp for registry check#1187

Closed
coffeecupjapan wants to merge 2 commits intoprojectcapsule:mainfrom
coffeecupjapan:coffeecup/regexpFix2
Closed

feat: enhancing webhook regexp for registry check#1187
coffeecupjapan wants to merge 2 commits intoprojectcapsule:mainfrom
coffeecupjapan:coffeecup/regexpFix2

Conversation

@coffeecupjapan
Copy link

@netlify
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.

3 participants