diff --git a/root/templates/cluster-apps.yaml b/root/templates/cluster-apps.yaml index 575aad34..26708539 100644 --- a/root/templates/cluster-apps.yaml +++ b/root/templates/cluster-apps.yaml @@ -74,34 +74,19 @@ spec: targetRevision: {{ .repoVersion | default $clusterForgeTargetRevision | quote }} {{- if .repoURL }} {{- if hasPrefix "oci://" $renderedRepoURL }} - {{- if or (eq .path ".") (not .path) }} - chart: {{ trimPrefix "oci://" $renderedRepoURL | base }} - {{- else }} - chart: {{ .path }} - {{- end }} + path: {{ .path | default "." }} {{- else }} path: {{ .path }} {{- end }} {{- else }} path: sources/{{ .path }} {{- end }} - {{- if or .valuesFile .valuesFiles .valuesObject .helmParameters }} + {{- if or .valuesFile .valuesObject .helmParameters }} helm: - {{- if or .valuesFile .valuesFiles }} - valueFiles: - {{- end }} {{- if .valuesFile }} + valueFiles: - {{ .valuesFile }} {{- end }} - {{- if .valuesFiles }} - {{- if kindIs "slice" .valuesFiles }} - {{- range .valuesFiles }} - - {{ . }} - {{- end }} - {{- else }} - - {{ .valuesFiles }} - {{- end }} - {{- end }} {{- if .valuesObject }} values: | {{ .valuesObject | toYaml | nindent 8 }} diff --git a/root/values.yaml b/root/values.yaml index 53b843b2..526bdb17 100644 --- a/root/values.yaml +++ b/root/values.yaml @@ -16,14 +16,14 @@ ociRegistry: apps: aim-engine: repoURL: "oci://{{ .Values.ociRegistry.dockerHub }}/aim-engine-chart" - repoVersion: "v0.2.2" + repoVersion: "0.2.2" path: "." namespace: aim-system valuesFile: values.yaml syncWave: 0 aim-engine-crds: repoURL: "oci://{{ .Values.ociRegistry.dockerHub }}/aim-engine-crds-chart" - repoVersion: "v0.2.2" + repoVersion: "0.2.2" path: "." namespace: aim-system syncWave: 0 diff --git a/sbom/SBOM-QUICK-GUIDE.md b/sbom/SBOM-QUICK-GUIDE.md index bf487293..322d31bd 100644 --- a/sbom/SBOM-QUICK-GUIDE.md +++ b/sbom/SBOM-QUICK-GUIDE.md @@ -70,7 +70,7 @@ The new modular validation system ensures data consistency: 2. Components Sync Check ├── Verifies components.yaml matches enabledApps from all cluster configurations ├── Checks for missing/extra components - └── Validates path/valuesFile/valuesFiles consistency across cluster files + └── Validates path/valuesFile consistency across cluster files 3. Metadata Completeness Check ├── Ensures sourceUrl and projectUrl are populated @@ -83,8 +83,7 @@ The new modular validation system ensures data consistency: - **projectUrl**: Main project repository (⚠️ Manual entry required - use GitHub for auto-license detection) - **license/licenseUrl**: Auto-populated from GitHub by `update_licenses.sh` - **path**: Auto-synced from values.yaml by generation script -- **valuesFile**: Auto-synced from values.yaml when present (single file) -- **valuesFiles**: Auto-synced from values.yaml when present (multiple files array) +- **valuesFile**: Auto-synced from values.yaml when present ## CI/CD Integration diff --git a/sbom/validate-components-sync.sh b/sbom/validate-components-sync.sh old mode 100755 new mode 100644 index 3a2c6c7f..f1d11cdb --- a/sbom/validate-components-sync.sh +++ b/sbom/validate-components-sync.sh @@ -103,14 +103,16 @@ while IFS= read -r app; do values_path="" for config_file in "$BASE_VALUES_FILE" "$SMALL_VALUES_FILE" "$MEDIUM_VALUES_FILE" "$LARGE_VALUES_FILE"; do if [[ -f "$config_file" ]]; then - app_path=$(yq eval ".apps.\"$app\".path // \"null\"" "$config_file" 2>/dev/null || echo "null") - if [[ "$app_path" != "null" ]]; then + # Check if app exists by looking for any field (path, repoURL, namespace, etc.) + app_exists=$(yq eval ".apps.\"$app\" // \"null\"" "$config_file" 2>/dev/null || echo "null") + if [[ "$app_exists" != "null" ]]; then + app_path=$(yq eval ".apps.\"$app\".path // \"null\"" "$config_file" 2>/dev/null || echo "null") values_path="$app_path" break fi fi done - + component_path=$(yq eval ".components.\"$app\".path" "$COMPONENTS_FILE" 2>/dev/null || echo "null") # Normalize empty string and null for comparison @@ -122,44 +124,22 @@ while IFS= read -r app; do echo "❌ Path mismatch for '$app': cluster-configs='$values_path' vs components.yaml='$component_path'" fi - # Check valuesFile/valuesFiles consistency + # Check valuesFile consistency values_file_values="null" - values_files_values="null" - config_file_source="" for config_file in "$BASE_VALUES_FILE" "$SMALL_VALUES_FILE" "$MEDIUM_VALUES_FILE" "$LARGE_VALUES_FILE"; do if [[ -f "$config_file" ]]; then - app_path_check=$(yq eval ".apps.\"$app\".path // \"null\"" "$config_file" 2>/dev/null || echo "null") - if [[ "$app_path_check" != "null" ]]; then + # Check if app exists by looking for any field (not just path) + app_exists=$(yq eval ".apps.\"$app\" // \"null\"" "$config_file" 2>/dev/null || echo "null") + if [[ "$app_exists" != "null" ]]; then values_file_values=$(yq eval ".apps.\"$app\".valuesFile // \"null\"" "$config_file" 2>/dev/null || echo "null") - values_files_values=$(yq eval ".apps.\"$app\".valuesFiles // \"null\"" "$config_file" 2>/dev/null || echo "null") - config_file_source="$config_file" break fi fi done - + values_file_components=$(yq eval ".components.\"$app\".valuesFile // \"null\"" "$COMPONENTS_FILE" 2>/dev/null || echo "null") - values_files_components=$(yq eval ".components.\"$app\".valuesFiles // \"null\"" "$COMPONENTS_FILE" 2>/dev/null || echo "null") - - # Compare - prefer valuesFiles if present, otherwise fall back to valuesFile - if [[ "$values_files_values" != "null" ]] || [[ "$values_files_components" != "null" ]]; then - # At least one side uses valuesFiles (array) - compare as JSON to normalize formatting - if [[ "$values_files_values" != "null" ]] && [[ "$values_files_components" != "null" ]]; then - # Both have valuesFiles - convert to JSON for comparison - values_files_values_json=$(yq eval ".apps.\"$app\".valuesFiles" "$config_file_source" -o=json 2>/dev/null || echo "null") - values_files_components_json=$(yq eval ".components.\"$app\".valuesFiles" "$COMPONENTS_FILE" -o=json 2>/dev/null || echo "null") - - if [[ "$values_files_values_json" != "$values_files_components_json" ]]; then - path_mismatches+=("$app valuesFiles: cluster-configs='$values_files_values_json' vs components.yaml='$values_files_components_json'") - echo "❌ ValuesFiles mismatch for '$app': cluster-configs='$values_files_values_json' vs components.yaml='$values_files_components_json'" - fi - else - # Only one side has valuesFiles - they don't match - path_mismatches+=("$app valuesFiles: cluster-configs='$values_files_values' vs components.yaml='$values_files_components'") - echo "❌ ValuesFiles mismatch for '$app': cluster-configs='$values_files_values' vs components.yaml='$values_files_components'" - fi - elif [[ "$values_file_values" != "$values_file_components" ]]; then - # Both sides use valuesFile (singular) + + if [[ "$values_file_values" != "$values_file_components" ]]; then path_mismatches+=("$app valuesFile: cluster-configs='$values_file_values' vs components.yaml='$values_file_components'") echo "❌ ValuesFile mismatch for '$app': cluster-configs='$values_file_values' vs components.yaml='$values_file_components'" fi diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh index 324906ed..99b71853 100755 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -822,22 +822,18 @@ render_actual_helm_manifests() { echo "{}" > "${temp_dir}/size_values.yaml" fi - # Get additional valuesFiles if specified - # Use yq to output as JSON array, then iterate to avoid bash array syntax issues + # Get additional valuesFile if specified local helm_value_args=() - local values_files_json - values_files_json=$(yq eval -o=json ".apps.\"$app_name\".valuesFiles // []" "${SOURCE_ROOT}/root/${VALUES_FILE}" 2>/dev/null || echo "[]") + local values_file + values_file=$(yq eval ".apps.\"$app_name\".valuesFile // \"null\"" "${SOURCE_ROOT}/root/${VALUES_FILE}" 2>/dev/null || echo "null") - # Read each value file from the JSON array - while IFS= read -r value_file; do - if [ -n "$value_file" ] && [ "$value_file" != "null" ]; then - # Resolve the path relative to the chart directory - local resolved_path="${chart_path}/${value_file}" - if [ -f "$resolved_path" ]; then - helm_value_args+=("-f" "$resolved_path") - fi + if [ -n "$values_file" ] && [ "$values_file" != "null" ]; then + # Resolve the path relative to the chart directory + local resolved_path="${chart_path}/${values_file}" + if [ -f "$resolved_path" ]; then + helm_value_args+=("-f" "$resolved_path") fi - done < <(echo "$values_files_json" | yq eval '.[]' - 2>/dev/null || true) + fi # Determine namespace local namespace=$(yq eval ".apps.\"$app_name\".namespace // \"default\"" "${SOURCE_ROOT}/root/${VALUES_FILE}") diff --git a/sources/kaiwo/values.yaml b/sources/kaiwo/values.yaml deleted file mode 100644 index 81f7bb71..00000000 --- a/sources/kaiwo/values.yaml +++ /dev/null @@ -1,3 +0,0 @@ -gpuPreemption: - enabled: true - metricsEndpoint: "http://lgtm-stack.otel-lgtm-stack.svc.cluster.local:9090/federate?match[]=gpu_gfx_activity" \ No newline at end of file