Skip to content

Refine validation rule for K8s provisioning#2212

Merged
cb-github-robot merged 1 commit intocloud-barista:mainfrom
seokho-son:main
Nov 18, 2025
Merged

Refine validation rule for K8s provisioning#2212
cb-github-robot merged 1 commit intocloud-barista:mainfrom
seokho-son:main

Conversation

@seokho-son
Copy link
Copy Markdown
Member

  • skip validation of K8s cluster provisioning request for the CSPs that do not requires nodeGroupsOnCreation.
  • skip image validation of K8s cluster and node group provisioning requests for the CSPs that do not requires nodeImageDesignation.
  • refine naming rule validation

Signed-off-by: Seokho Son <shsongist@gmail.com>
Copilot AI review requested due to automatic review settings November 18, 2025 06:01
@seokho-son
Copy link
Copy Markdown
Member Author

CC @hanizang77

@seokho-son
Copy link
Copy Markdown
Member Author

/approve

@github-actions github-actions bot added the approved This PR is approved and will be merged soon. label Nov 18, 2025
@cb-github-robot cb-github-robot merged commit e9b701f into cloud-barista:main Nov 18, 2025
11 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refines K8s cluster provisioning validation to be more CSP-specific by conditionally applying validation rules based on cloud provider capabilities. It introduces checks for node image designation support and nodegroup requirements at creation time, making the validation logic adaptive to different CSP requirements.

  • Adds CSP capability checks for nodeImageDesignation and nodeGroupsOnCreation settings
  • Implements conditional validation that skips image validation for CSPs that don't support image designation (e.g., Azure, NCP)
  • Introduces auto-fix logic for node group naming patterns and refines naming rule validation to only apply when required by the CSP

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

spImgName = ""
} else {
spImgName, err = GetCspResourceName(nsId, model.StrImage, v.ImageId)
if spImgName == "" || createErr != nil {
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

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

The condition checks createErr but should check err instead. At line 406, GetCspResourceName assigns to err, not createErr. This means the code will not properly detect errors from the image lookup, potentially causing nil pointer dereferences in the subsequent err.Error() call at line 409.

Suggested change
if spImgName == "" || createErr != nil {
if spImgName == "" || err != nil {

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved This PR is approved and will be merged soon.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants