-
Notifications
You must be signed in to change notification settings - Fork 9
Enhance spec and image selection feature #62
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
Conversation
Signed-off-by: Seokho Son <shsongist@gmail.com>
There was a problem hiding this 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 pull request implements PMK (Platform Managed Kubernetes) minimum requirements enforcement and simplifies image recommendation API calls across multiple files. The changes ensure that server recommendations for PMK meet Kubernetes minimum specifications and streamline the image search parameters.
Key changes:
- Added PMK minimum requirements (4 vCPU, 16GB memory) with enforcement logic in server recommendations
- Simplified image API search parameters to use
matchedSpecIdinstead of individual provider/region/architecture fields - Updated image recommendation table columns to show Kubernetes-specific attributes (BASIC, GPU, K8S flags) instead of generic CSP information
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| pmk_serverrecommendation.js | Implements PMK minimum requirements (4 vCPU, 16GB memory) with conditional enforcement logic for CPU and memory filters |
| pmk_imagerecommendation.js | Refactors table columns to display K8s-specific flags, simplifies API parameters using matchedSpecId, and adds GPU/K8s image metadata |
| imagerecommendation.js | Updates table structure with new columns (BASIC, GPU), simplifies API call parameters, and adds empty result handling with user notification |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // CPU 필터 | ||
| // CPU 필터 (최소 4 vCPU 보장) | ||
| if (cpuMinVal !== "" || cpuMaxVal !== "") { | ||
| if (cpuMaxVal !== "" && cpuMaxVal < cpuMinVal) { |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comparison does not account for the PMK minimum value enforcement. If cpuMinVal is empty but cpuMaxVal is less than PMK_MIN_VCPU (4), the validation passes but line 161 will set cpuMin to 4, creating an invalid range where max < min. Add validation: const effectiveCpuMin = Math.max(cpuMinVal === '' ? PMK_MIN_VCPU : parseInt(cpuMinVal), PMK_MIN_VCPU); before the comparison and use it: if (cpuMaxVal !== '' && cpuMaxVal < effectiveCpuMin).
| // Memory 필터 | ||
| // Memory 필터 (최소 16GB 보장) | ||
| if (memoryMinVal !== "" || memoryMaxVal !== "") { | ||
| if (memoryMaxVal !== "" && memoryMaxVal < memoryMinVal) { |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comparison does not account for the PMK minimum value enforcement. If memoryMinVal is empty but memoryMaxVal is less than PMK_MIN_MEMORY (16), the validation passes but line 190 will set memoryMin to 16, creating an invalid range where max < min. Add validation: const effectiveMemoryMin = Math.max(memoryMinVal === '' ? PMK_MIN_MEMORY : parseInt(memoryMinVal), PMK_MIN_MEMORY); before the comparison and use it: if (memoryMaxVal !== '' && memoryMaxVal < effectiveMemoryMin).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| osDiskType: image.osDiskType || "ebs", | ||
| osDiskSizeGB: image.osDiskSizeGB || -1, | ||
| imageStatus: image.imageStatus || "Available", | ||
| description: image.description || image.name, | ||
| isBasicImage: image.isBasicImage || false, | ||
| isGPUImage: image.isGPUImage || false, | ||
| isKubernetesImage: image.isKubernetesImage || false |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent indentation detected. Lines 243-246 use tab indentation while lines 247-249 also use tabs, but line 243 appears misaligned with the opening brace on line 223. Ensure all property assignments within this object use consistent indentation (either all tabs or all spaces at the same level).
| osDiskType: image.osDiskType || "ebs", | |
| osDiskSizeGB: image.osDiskSizeGB || -1, | |
| imageStatus: image.imageStatus || "Available", | |
| description: image.description || image.name, | |
| isBasicImage: image.isBasicImage || false, | |
| isGPUImage: image.isGPUImage || false, | |
| isKubernetesImage: image.isKubernetesImage || false | |
| osDiskType: image.osDiskType || "ebs", | |
| osDiskSizeGB: image.osDiskSizeGB || -1, | |
| imageStatus: image.imageStatus || "Available", | |
| description: image.description || image.name, | |
| isBasicImage: image.isBasicImage || false, | |
| isGPUImage: image.isGPUImage || false, | |
| isKubernetesImage: image.isKubernetesImage || false |
| osDiskType: image.osDiskType || "ebs", | ||
| osDiskSizeGB: image.osDiskSizeGB || -1, | ||
| imageStatus: image.imageStatus || "Available", | ||
| description: image.description || image.name, | ||
| isBasicImage: image.isBasicImage || false, | ||
| isGPUImage: image.isGPUImage || false |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent indentation detected. Lines 237-240 and 241-242 should use the same indentation level as the rest of the object properties. Ensure all property assignments within this object use consistent indentation.
| osDiskType: image.osDiskType || "ebs", | |
| osDiskSizeGB: image.osDiskSizeGB || -1, | |
| imageStatus: image.imageStatus || "Available", | |
| description: image.description || image.name, | |
| isBasicImage: image.isBasicImage || false, | |
| isGPUImage: image.isGPUImage || false | |
| osDiskType: image.osDiskType || "ebs", | |
| osDiskSizeGB: image.osDiskSizeGB || -1, | |
| imageStatus: image.imageStatus || "Available", | |
| description: image.description || image.name, | |
| isBasicImage: image.isBasicImage || false, | |
| isGPUImage: image.isGPUImage || false |
No description provided.