Skip to content

Enhance spec and image selection feature#62

Merged
MZC-CSC merged 1 commit into
m-cmp:mainfrom
seokho-son:main
Nov 7, 2025
Merged

Enhance spec and image selection feature#62
MZC-CSC merged 1 commit into
m-cmp:mainfrom
seokho-son:main

Conversation

@seokho-son

Copy link
Copy Markdown
Member

No description provided.

Signed-off-by: Seokho Son <shsongist@gmail.com>
Copilot AI review requested due to automatic review settings November 7, 2025 10:08

Copilot AI left a comment

Copy link
Copy Markdown

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 matchedSpecId instead 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

Copy link

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).

Copilot uses AI. Check for mistakes.
// Memory 필터
// Memory 필터 (최소 16GB 보장)
if (memoryMinVal !== "" || memoryMaxVal !== "") {
if (memoryMaxVal !== "" && memoryMaxVal < memoryMinVal) {

Copilot AI Nov 7, 2025

Copy link

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).

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.

@MZC-CSC @dev4unet 추가로, k8s 생성시 안정빵으로 disksize 를 100GB 이상으로 설정해주셔야 합니다. (k8s 클러스터 생성시, 또는 노드 그룹 추가 생성시)

Comment on lines +243 to +249
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

Copy link

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).

Suggested change
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

Copilot uses AI. Check for mistakes.
Comment on lines +237 to +242
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

Copy link

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.

Suggested change
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

Copilot uses AI. Check for mistakes.
@MZC-CSC MZC-CSC merged commit bbbe86a into m-cmp:main Nov 7, 2025
9 checks passed
MZC-CSC added a commit that referenced this pull request May 11, 2026
Enhance spec and image selection feature
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