Refine validation rule for K8s provisioning#2212
Refine validation rule for K8s provisioning#2212cb-github-robot merged 1 commit intocloud-barista:mainfrom
Conversation
seokho-son
commented
Nov 18, 2025
- 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>
|
CC @hanizang77 |
|
/approve |
There was a problem hiding this comment.
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
nodeImageDesignationandnodeGroupsOnCreationsettings - 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 { |
There was a problem hiding this comment.
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.
| if spImgName == "" || createErr != nil { | |
| if spImgName == "" || err != nil { |
There was a problem hiding this comment.