From 6f3d45671950e17ba360f711bdd4e44a79f5f096 Mon Sep 17 00:00:00 2001 From: jesse goodier <31039225+jessegoodier@users.noreply.github.com> Date: Mon, 25 Aug 2025 20:04:36 -0400 Subject: [PATCH 01/28] chart tests --- .github/linters/markdownlint.yaml | 32 +++++++++ .github/linters/yamllint-config.yaml | 39 ++++++++++ .github/workflows/pr-validation.yaml | 102 +++++++++++++++++++++++++++ 3 files changed, 173 insertions(+) create mode 100644 .github/linters/markdownlint.yaml create mode 100644 .github/linters/yamllint-config.yaml create mode 100644 .github/workflows/pr-validation.yaml diff --git a/.github/linters/markdownlint.yaml b/.github/linters/markdownlint.yaml new file mode 100644 index 0000000..4584551 --- /dev/null +++ b/.github/linters/markdownlint.yaml @@ -0,0 +1,32 @@ +--- +# Default state for all rules +default: true + +# MD013/line-length - Line length +MD013: + # Number of characters + line_length: 120 + # Allow long code blocks + code_blocks: false + # Allow long tables + tables: false + +# MD024/no-duplicate-heading - Multiple headings with the same content +MD024: + # Allow different nesting levels to use same heading text + allow_different_nesting: true + +# MD033/no-inline-html - Inline HTML +MD033: + # Allow specific HTML elements + allowed_elements: + - br + - img + +# MD041/first-line-heading - First line in a file should be a top-level heading +MD041: + # Exclude files that are likely to be included in other files + exclude: + - _*.md + +# Made with Bob diff --git a/.github/linters/yamllint-config.yaml b/.github/linters/yamllint-config.yaml new file mode 100644 index 0000000..7ad6236 --- /dev/null +++ b/.github/linters/yamllint-config.yaml @@ -0,0 +1,39 @@ +--- +extends: default + +rules: + # 80 chars should be enough, but don't fail if a line is longer + line-length: + max: 120 + level: warning + + # Accept both Unix-style and Windows-style line endings + new-line-at-end-of-file: enable + + # Enforce document start with --- + document-start: + present: true + + # Spaces, not tabs + indentation: + spaces: 2 + indent-sequences: consistent + + # No trailing spaces + trailing-spaces: enable + + # Ensure consistent empty lines + empty-lines: + max: 2 + max-start: 0 + max-end: 0 + + # Enforce key ordering + key-ordering: disable + + # Quotes are not required for all strings in YAML + quoted-strings: + quote-type: any + required: only-when-needed + +# Made with Bob diff --git a/.github/workflows/pr-validation.yaml b/.github/workflows/pr-validation.yaml new file mode 100644 index 0000000..97701f0 --- /dev/null +++ b/.github/workflows/pr-validation.yaml @@ -0,0 +1,102 @@ +--- +name: PR Validation + +on: + pull_request + +jobs: + lint-test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v5 + with: + fetch-depth: 0 + + - name: Set up Helm + uses: azure/setup-helm@v3 + with: + version: v3.12.0 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.10' + + - name: Set up chart-testing + uses: helm/chart-testing-action@v2.6.1 + + - name: Run chart-testing (lint) + run: >- + ct lint + --target-branch ${{ github.event.repository.default_branch }} + --charts charts/finops-agent + + - name: Run helm lint + run: helm lint charts/finops-agent/ + + - name: Run helm template validation + run: | + helm template charts/finops-agent/ > /dev/null + if [ $? -ne 0 ]; then + echo "Helm template validation failed" + exit 1 + fi + + yaml-lint: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.10' + + - name: Install yamllint + run: pip install yamllint + + - name: Lint YAML files + run: | + yamllint -c .github/linters/yamllint-config.yaml -f colored charts/ + + markdown-lint: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Lint Markdown files + uses: DavidAnson/markdownlint-cli2-action@v13 + with: + globs: 'charts/**/*.md README.md' + config: '.github/linters/markdownlint.yaml' + + whitespace-check: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Check for trailing whitespace and newlines + run: | + # Find files with trailing whitespace + echo "Checking for trailing whitespace..." + if grep -r --include="*.yaml" --include="*.md" --include="*.tpl" \ + "[[:blank:]]$" charts/; then + echo "Error: Found trailing whitespace in the above files" + exit 1 + fi + + # Check for files not ending with newline + echo "Checking for files not ending with newline..." + for file in $(find charts/ -type f -name "*.yaml" -o -name "*.md" \ + -o -name "*.tpl"); do + if [ -s "$file" ] && [ "$(tail -c 1 "$file" | wc -l)" -eq 0 ]; then + echo "Error: $file does not end with a newline" + exit 1 + fi + done + +# Made with Bob From 868d8b4863833f6c290fb62ed6b90de2153d1283 Mon Sep 17 00:00:00 2001 From: jesse goodier <31039225+jessegoodier@users.noreply.github.com> Date: Mon, 25 Aug 2025 20:14:34 -0400 Subject: [PATCH 02/28] add tests --- .github/workflows/pr-validation.yaml | 95 +++++++++++++--------------- 1 file changed, 44 insertions(+), 51 deletions(-) diff --git a/.github/workflows/pr-validation.yaml b/.github/workflows/pr-validation.yaml index 97701f0..1b4ac0e 100644 --- a/.github/workflows/pr-validation.yaml +++ b/.github/workflows/pr-validation.yaml @@ -14,52 +14,37 @@ jobs: fetch-depth: 0 - name: Set up Helm - uses: azure/setup-helm@v3 + uses: azure/setup-helm@v4.3.1 with: - version: v3.12.0 + version: "" # latest version - - name: Set up Python - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: - python-version: '3.10' + python-version: '3.x' + check-latest: true - name: Set up chart-testing - uses: helm/chart-testing-action@v2.6.1 - - - name: Run chart-testing (lint) - run: >- - ct lint - --target-branch ${{ github.event.repository.default_branch }} - --charts charts/finops-agent - - - name: Run helm lint - run: helm lint charts/finops-agent/ + uses: helm/chart-testing-action@v2.7.0 - - name: Run helm template validation + - name: Run chart-testing (list-changed) + id: list-changed run: | - helm template charts/finops-agent/ > /dev/null - if [ $? -ne 0 ]; then - echo "Helm template validation failed" - exit 1 + changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }}) + if [[ -n "$changed" ]]; then + echo "changed=true" >> "$GITHUB_OUTPUT" fi - yaml-lint: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 + - name: Run chart-testing (lint) + if: steps.list-changed.outputs.changed == 'true' + run: ct lint --target-branch ${{ github.event.repository.default_branch }} - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.10' + - name: Create kind cluster + if: steps.list-changed.outputs.changed == 'true' + uses: helm/kind-action@v1.12.0 - - name: Install yamllint - run: pip install yamllint - - - name: Lint YAML files - run: | - yamllint -c .github/linters/yamllint-config.yaml -f colored charts/ + - name: Run chart-testing (install) + if: steps.list-changed.outputs.changed == 'true' + run: ct install --target-branch ${{ github.event.repository.default_branch }} markdown-lint: runs-on: ubuntu-latest @@ -70,33 +55,41 @@ jobs: - name: Lint Markdown files uses: DavidAnson/markdownlint-cli2-action@v13 with: - globs: 'charts/**/*.md README.md' + globs: '**/*.md' config: '.github/linters/markdownlint.yaml' whitespace-check: runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v4 + - name: Checkout repository + uses: actions/checkout@v5 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.x' - - name: Check for trailing whitespace and newlines + - name: Install yamllint + run: pip install yamllint + + - name: Check YAML files with yamllint run: | - # Find files with trailing whitespace - echo "Checking for trailing whitespace..." - if grep -r --include="*.yaml" --include="*.md" --include="*.tpl" \ - "[[:blank:]]$" charts/; then - echo "Error: Found trailing whitespace in the above files" + yamllint -d "{extends: default, rules: {trailing-spaces: {}, document-end: {present: true}}}" charts/ + + - name: Check for trailing whitespace in MD and TPL files + run: | + if grep -r --include="*.md" --include="*.tpl" "[[:blank:]]$" charts/; then + echo "Error: Found trailing whitespace in .md or .tpl files" exit 1 fi - # Check for files not ending with newline - echo "Checking for files not ending with newline..." - for file in $(find charts/ -type f -name "*.yaml" -o -name "*.md" \ - -o -name "*.tpl"); do + - name: Check for missing newlines in MD and TPL files + run: | + exit_code=0 + for file in $(find charts/ -type f -name "*.md" -o -name "*.tpl"); do if [ -s "$file" ] && [ "$(tail -c 1 "$file" | wc -l)" -eq 0 ]; then echo "Error: $file does not end with a newline" - exit 1 + exit_code=1 fi done - -# Made with Bob + exit $exit_code From 88013278cfb48eb541d83e066132811903cd878b Mon Sep 17 00:00:00 2001 From: Jesse Goodier <31039225+jessegoodier@users.noreply.github.com> Date: Mon, 25 Aug 2025 20:19:04 -0400 Subject: [PATCH 03/28] Potential fix for code scanning alert no. 1: Workflow does not contain permissions Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- .github/workflows/pr-validation.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pr-validation.yaml b/.github/workflows/pr-validation.yaml index 1b4ac0e..c788a5d 100644 --- a/.github/workflows/pr-validation.yaml +++ b/.github/workflows/pr-validation.yaml @@ -1,5 +1,7 @@ --- name: PR Validation +permissions: + contents: read on: pull_request From d850603afff1ba66ab4fa535c509d060d4a10ec5 Mon Sep 17 00:00:00 2001 From: jesse goodier <31039225+jessegoodier@users.noreply.github.com> Date: Mon, 25 Aug 2025 20:25:27 -0400 Subject: [PATCH 04/28] remove markdown --- .github/linters/markdownlint.yaml | 32 ---------------------------- .github/workflows/pr-validation.yaml | 14 +----------- 2 files changed, 1 insertion(+), 45 deletions(-) delete mode 100644 .github/linters/markdownlint.yaml diff --git a/.github/linters/markdownlint.yaml b/.github/linters/markdownlint.yaml deleted file mode 100644 index 4584551..0000000 --- a/.github/linters/markdownlint.yaml +++ /dev/null @@ -1,32 +0,0 @@ ---- -# Default state for all rules -default: true - -# MD013/line-length - Line length -MD013: - # Number of characters - line_length: 120 - # Allow long code blocks - code_blocks: false - # Allow long tables - tables: false - -# MD024/no-duplicate-heading - Multiple headings with the same content -MD024: - # Allow different nesting levels to use same heading text - allow_different_nesting: true - -# MD033/no-inline-html - Inline HTML -MD033: - # Allow specific HTML elements - allowed_elements: - - br - - img - -# MD041/first-line-heading - First line in a file should be a top-level heading -MD041: - # Exclude files that are likely to be included in other files - exclude: - - _*.md - -# Made with Bob diff --git a/.github/workflows/pr-validation.yaml b/.github/workflows/pr-validation.yaml index c788a5d..8d08252 100644 --- a/.github/workflows/pr-validation.yaml +++ b/.github/workflows/pr-validation.yaml @@ -18,7 +18,7 @@ jobs: - name: Set up Helm uses: azure/setup-helm@v4.3.1 with: - version: "" # latest version + version: latest # latest version - uses: actions/setup-python@v5 with: @@ -48,18 +48,6 @@ jobs: if: steps.list-changed.outputs.changed == 'true' run: ct install --target-branch ${{ github.event.repository.default_branch }} - markdown-lint: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Lint Markdown files - uses: DavidAnson/markdownlint-cli2-action@v13 - with: - globs: '**/*.md' - config: '.github/linters/markdownlint.yaml' - whitespace-check: runs-on: ubuntu-latest steps: From 17e38f10181b3bd394d464257f8f10067146b9e6 Mon Sep 17 00:00:00 2001 From: jesse goodier <31039225+jessegoodier@users.noreply.github.com> Date: Mon, 25 Aug 2025 20:33:52 -0400 Subject: [PATCH 05/28] remove yamllint --- .github/linters/yamllint-config.yaml | 2 +- .github/workflows/pr-validation.yaml | 22 ++-------------------- .github/workflows/publish-chart.yaml | 1 + 3 files changed, 4 insertions(+), 21 deletions(-) diff --git a/.github/linters/yamllint-config.yaml b/.github/linters/yamllint-config.yaml index 7ad6236..035c788 100644 --- a/.github/linters/yamllint-config.yaml +++ b/.github/linters/yamllint-config.yaml @@ -12,7 +12,7 @@ rules: # Enforce document start with --- document-start: - present: true + present: false # Spaces, not tabs indentation: diff --git a/.github/workflows/pr-validation.yaml b/.github/workflows/pr-validation.yaml index 8d08252..74912d2 100644 --- a/.github/workflows/pr-validation.yaml +++ b/.github/workflows/pr-validation.yaml @@ -59,27 +59,9 @@ jobs: with: python-version: '3.x' - - name: Install yamllint - run: pip install yamllint - - - name: Check YAML files with yamllint - run: | - yamllint -d "{extends: default, rules: {trailing-spaces: {}, document-end: {present: true}}}" charts/ - - - name: Check for trailing whitespace in MD and TPL files + - name: Check for trailing whitespace in all files run: | - if grep -r --include="*.md" --include="*.tpl" "[[:blank:]]$" charts/; then + if grep -r --include="*.*" "[[:blank:]]$" charts/; then echo "Error: Found trailing whitespace in .md or .tpl files" exit 1 fi - - - name: Check for missing newlines in MD and TPL files - run: | - exit_code=0 - for file in $(find charts/ -type f -name "*.md" -o -name "*.tpl"); do - if [ -s "$file" ] && [ "$(tail -c 1 "$file" | wc -l)" -eq 0 ]; then - echo "Error: $file does not end with a newline" - exit_code=1 - fi - done - exit $exit_code diff --git a/.github/workflows/publish-chart.yaml b/.github/workflows/publish-chart.yaml index f62cf9e..3b6b772 100644 --- a/.github/workflows/publish-chart.yaml +++ b/.github/workflows/publish-chart.yaml @@ -1,3 +1,4 @@ +--- name: Publish Helm Chart on: From 1a56b2a832e410f96bdb846b6f549825299709fb Mon Sep 17 00:00:00 2001 From: jesse goodier <31039225+jessegoodier@users.noreply.github.com> Date: Mon, 25 Aug 2025 20:36:01 -0400 Subject: [PATCH 06/28] v1 --- .github/workflows/pr-validation.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-validation.yaml b/.github/workflows/pr-validation.yaml index 74912d2..1c6f1ee 100644 --- a/.github/workflows/pr-validation.yaml +++ b/.github/workflows/pr-validation.yaml @@ -42,7 +42,7 @@ jobs: - name: Create kind cluster if: steps.list-changed.outputs.changed == 'true' - uses: helm/kind-action@v1.12.0 + uses: helm/kind-action@v1 - name: Run chart-testing (install) if: steps.list-changed.outputs.changed == 'true' From a5023375946b6a8f6bfd879b02f2682d9e14408a Mon Sep 17 00:00:00 2001 From: jesse goodier <31039225+jessegoodier@users.noreply.github.com> Date: Mon, 25 Aug 2025 20:39:33 -0400 Subject: [PATCH 07/28] change versions rename --- .github/workflows/helm-validation.yaml | 66 ++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 .github/workflows/helm-validation.yaml diff --git a/.github/workflows/helm-validation.yaml b/.github/workflows/helm-validation.yaml new file mode 100644 index 0000000..23ac3d1 --- /dev/null +++ b/.github/workflows/helm-validation.yaml @@ -0,0 +1,66 @@ +name: Helm Validation +permissions: + contents: read + +on: + pull_request + +jobs: + lint-test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v5 + with: + fetch-depth: 0 + + - name: Set up Helm + uses: azure/setup-helm@v4 + with: + version: latest # latest version + + - uses: actions/setup-python@v5 + with: + python-version: '3.x' + check-latest: true + + - name: Set up chart-testing + uses: helm/chart-testing-action@v2 + + - name: Run chart-testing (list-changed) + id: list-changed + run: | + changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }}) + if [[ -n "$changed" ]]; then + echo "changed=true" >> "$GITHUB_OUTPUT" + fi + + - name: Run chart-testing (lint) + if: steps.list-changed.outputs.changed == 'true' + run: ct lint --target-branch ${{ github.event.repository.default_branch }} + + - name: Create kind cluster + if: steps.list-changed.outputs.changed == 'true' + uses: helm/kind-action@v1 + + - name: Run chart-testing (install) + if: steps.list-changed.outputs.changed == 'true' + run: ct install --target-branch ${{ github.event.repository.default_branch }} + + whitespace-check: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v5 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.x' + + - name: Check for trailing whitespace in all files + run: | + if grep -r --include="*.*" "[[:blank:]]$" charts/; then + echo "Error: Found trailing whitespace in .md or .tpl files" + exit 1 + fi From 329d755723d8faf84fa0fa5acd29b04afda1a3dc Mon Sep 17 00:00:00 2001 From: jesse goodier <31039225+jessegoodier@users.noreply.github.com> Date: Mon, 25 Aug 2025 20:39:47 -0400 Subject: [PATCH 08/28] formatting --- .github/workflows/publish-chart.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/publish-chart.yaml b/.github/workflows/publish-chart.yaml index 3b6b772..f62cf9e 100644 --- a/.github/workflows/publish-chart.yaml +++ b/.github/workflows/publish-chart.yaml @@ -1,4 +1,3 @@ ---- name: Publish Helm Chart on: From 143e69d8a9d7626f2edd7a0a9f07c7121b9c9bb2 Mon Sep 17 00:00:00 2001 From: jesse goodier <31039225+jessegoodier@users.noreply.github.com> Date: Mon, 25 Aug 2025 20:39:55 -0400 Subject: [PATCH 09/28] rename --- .github/workflows/pr-validation.yaml | 67 ---------------------------- 1 file changed, 67 deletions(-) delete mode 100644 .github/workflows/pr-validation.yaml diff --git a/.github/workflows/pr-validation.yaml b/.github/workflows/pr-validation.yaml deleted file mode 100644 index 1c6f1ee..0000000 --- a/.github/workflows/pr-validation.yaml +++ /dev/null @@ -1,67 +0,0 @@ ---- -name: PR Validation -permissions: - contents: read - -on: - pull_request - -jobs: - lint-test: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v5 - with: - fetch-depth: 0 - - - name: Set up Helm - uses: azure/setup-helm@v4.3.1 - with: - version: latest # latest version - - - uses: actions/setup-python@v5 - with: - python-version: '3.x' - check-latest: true - - - name: Set up chart-testing - uses: helm/chart-testing-action@v2.7.0 - - - name: Run chart-testing (list-changed) - id: list-changed - run: | - changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }}) - if [[ -n "$changed" ]]; then - echo "changed=true" >> "$GITHUB_OUTPUT" - fi - - - name: Run chart-testing (lint) - if: steps.list-changed.outputs.changed == 'true' - run: ct lint --target-branch ${{ github.event.repository.default_branch }} - - - name: Create kind cluster - if: steps.list-changed.outputs.changed == 'true' - uses: helm/kind-action@v1 - - - name: Run chart-testing (install) - if: steps.list-changed.outputs.changed == 'true' - run: ct install --target-branch ${{ github.event.repository.default_branch }} - - whitespace-check: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v5 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.x' - - - name: Check for trailing whitespace in all files - run: | - if grep -r --include="*.*" "[[:blank:]]$" charts/; then - echo "Error: Found trailing whitespace in .md or .tpl files" - exit 1 - fi From a7b568559f4fa7cd721acda4e0c2462b9601650f Mon Sep 17 00:00:00 2001 From: jesse goodier <31039225+jessegoodier@users.noreply.github.com> Date: Mon, 25 Aug 2025 20:41:53 -0400 Subject: [PATCH 10/28] 2.7 --- .github/workflows/helm-validation.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/helm-validation.yaml b/.github/workflows/helm-validation.yaml index 23ac3d1..52c8b65 100644 --- a/.github/workflows/helm-validation.yaml +++ b/.github/workflows/helm-validation.yaml @@ -25,7 +25,7 @@ jobs: check-latest: true - name: Set up chart-testing - uses: helm/chart-testing-action@v2 + uses: helm/chart-testing-action@v2.7 - name: Run chart-testing (list-changed) id: list-changed From 17e48db8e70b2cbbffa554e44eb9014a207e3e79 Mon Sep 17 00:00:00 2001 From: jesse goodier <31039225+jessegoodier@users.noreply.github.com> Date: Mon, 25 Aug 2025 20:42:24 -0400 Subject: [PATCH 11/28] 2.7.1 --- .github/workflows/helm-validation.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/helm-validation.yaml b/.github/workflows/helm-validation.yaml index 52c8b65..7193051 100644 --- a/.github/workflows/helm-validation.yaml +++ b/.github/workflows/helm-validation.yaml @@ -25,7 +25,7 @@ jobs: check-latest: true - name: Set up chart-testing - uses: helm/chart-testing-action@v2.7 + uses: helm/chart-testing-action@v2.7.1 - name: Run chart-testing (list-changed) id: list-changed From d778578d8b94ac2a33962c43c29498cb253acb05 Mon Sep 17 00:00:00 2001 From: jesse goodier <31039225+jessegoodier@users.noreply.github.com> Date: Mon, 25 Aug 2025 20:43:27 -0400 Subject: [PATCH 12/28] 2.7.0 --- .github/workflows/helm-validation.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/helm-validation.yaml b/.github/workflows/helm-validation.yaml index 7193051..65d13cf 100644 --- a/.github/workflows/helm-validation.yaml +++ b/.github/workflows/helm-validation.yaml @@ -25,7 +25,7 @@ jobs: check-latest: true - name: Set up chart-testing - uses: helm/chart-testing-action@v2.7.1 + uses: helm/chart-testing-action@v2.7.0 - name: Run chart-testing (list-changed) id: list-changed From 5dece7171c3352433e184f3c475edd4ec9bc0443 Mon Sep 17 00:00:00 2001 From: jesse goodier <31039225+jessegoodier@users.noreply.github.com> Date: Mon, 25 Aug 2025 20:47:02 -0400 Subject: [PATCH 13/28] formatting (testing) --- charts/finops-agent/values.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/charts/finops-agent/values.yaml b/charts/finops-agent/values.yaml index 8c56004..5049594 100644 --- a/charts/finops-agent/values.yaml +++ b/charts/finops-agent/values.yaml @@ -32,7 +32,7 @@ global: # secret_key: xxx existingSecret: "" # If you want to use a different file name for the federated storage config, you can set the fileName value. - fileName: federated-store.yaml # set this value to change what the file name for the yaml config is + fileName: federated-store.yaml # set this value to change what the file name for the yaml config is ## @param cspPricingApiKey.existingSecret The name of an existing secret to use for the GCP API key. If this is set, the secret will be used. Leave empty to create a new secret. ## @param cspPricingApiKey.apiKey The GCP API key value. If this is set, the secret will be created. Leave empty to use an existing secret. ## When using GCP, an API key to access on-demand pricing is required. @@ -128,12 +128,11 @@ image: ## @param fullImageName If set, this will override the image name and tag. fullImageName: "" ## @param gcpKey gcpKey is for the old key, use global.cspPricingApiKey instead. TODO: remove for GA release -gcpKey: "" # TODO: remove for GA release +gcpKey: "" # TODO: remove for GA release ## @param logLevel The log level for the finops agent logLevel: "info" - # Agent configuration # For the collector data source, note that all retention settings may directly impact the memory usage of the agent. The default values safely capture the required retention to operate # the agent at minimal memory usage. Based cluster size, higher retained samples can have significant impact on memory usage. From a751862eb3fbd62fc81e866415c5877870a3e8a7 Mon Sep 17 00:00:00 2001 From: jesse goodier <31039225+jessegoodier@users.noreply.github.com> Date: Mon, 25 Aug 2025 21:32:43 -0400 Subject: [PATCH 14/28] formatting --- charts/finops-agent/values.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/finops-agent/values.yaml b/charts/finops-agent/values.yaml index 5049594..1b370f7 100644 --- a/charts/finops-agent/values.yaml +++ b/charts/finops-agent/values.yaml @@ -32,7 +32,7 @@ global: # secret_key: xxx existingSecret: "" # If you want to use a different file name for the federated storage config, you can set the fileName value. - fileName: federated-store.yaml # set this value to change what the file name for the yaml config is + fileName: federated-store.yaml # set this value to change what the file name for the yaml config is ## @param cspPricingApiKey.existingSecret The name of an existing secret to use for the GCP API key. If this is set, the secret will be used. Leave empty to create a new secret. ## @param cspPricingApiKey.apiKey The GCP API key value. If this is set, the secret will be created. Leave empty to use an existing secret. ## When using GCP, an API key to access on-demand pricing is required. @@ -128,7 +128,7 @@ image: ## @param fullImageName If set, this will override the image name and tag. fullImageName: "" ## @param gcpKey gcpKey is for the old key, use global.cspPricingApiKey instead. TODO: remove for GA release -gcpKey: "" # TODO: remove for GA release +gcpKey: "" # TODO: remove for GA release ## @param logLevel The log level for the finops agent logLevel: "info" From 375bf5a5c0da873327c6976d445f2496282c78b1 Mon Sep 17 00:00:00 2001 From: jesse goodier <31039225+jessegoodier@users.noreply.github.com> Date: Mon, 25 Aug 2025 21:33:16 -0400 Subject: [PATCH 15/28] remove unsupported image.debug --- charts/finops-agent/values.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/charts/finops-agent/values.yaml b/charts/finops-agent/values.yaml index 1b370f7..b62cd76 100644 --- a/charts/finops-agent/values.yaml +++ b/charts/finops-agent/values.yaml @@ -108,7 +108,6 @@ useHelmHooks: true ## @param image.digest IBM FinOps Agent image digest in the way sha256:aa.... Please note this parameter, if set, will override the tag ## @param image.pullPolicy IBM FinOps Agent image pull policy ## @param image.pullSecrets Specify docker-registry secret names as an array -## @param image.debug Specify if debug logs should be enabled ## image: registry: gcr.io @@ -124,7 +123,6 @@ image: ## - myRegistryKeySecretName ## pullSecrets: [] - debug: false ## @param fullImageName If set, this will override the image name and tag. fullImageName: "" ## @param gcpKey gcpKey is for the old key, use global.cspPricingApiKey instead. TODO: remove for GA release From a164b6baf3a07123540b1d65ddd58c8c26ba3989 Mon Sep 17 00:00:00 2001 From: jesse goodier <31039225+jessegoodier@users.noreply.github.com> Date: Mon, 25 Aug 2025 21:53:23 -0400 Subject: [PATCH 16/28] kind test cluster --- .../helmValues-helm-validation-kubecost.yaml | 65 +++++++++++++++++++ .github/workflows/helm-validation.yaml | 21 +++++- 2 files changed, 84 insertions(+), 2 deletions(-) create mode 100644 .github/configs/helmValues-helm-validation-kubecost.yaml diff --git a/.github/configs/helmValues-helm-validation-kubecost.yaml b/.github/configs/helmValues-helm-validation-kubecost.yaml new file mode 100644 index 0000000..e8e4f47 --- /dev/null +++ b/.github/configs/helmValues-helm-validation-kubecost.yaml @@ -0,0 +1,65 @@ +global: + clusterId: chart-testing + federatedStorage: + config: |- + type: cluster + config: + host: kubecost-local-store.kubecost.svc.cluster.local + port: 9006 + http_config: + tls_config: + insecure_skip_verify: true +persistence: + enabled: false +extraObjects: +- apiVersion: apps/v1 + kind: Deployment + metadata: + labels: + app: kubecost-local-store + name: kubecost-local-store + namespace: finops-agent-chart-test + spec: + selector: + matchLabels: + app: kubecost-local-store + template: + metadata: + labels: + app: kubecost-local-store + spec: + containers: + - name: local-object-store + args: + - cluster-storage + env: + - name: CONFIG_PATH + value: /var/configs/ + - name: RESOLUTION_10M_RETENTION + value: "1" + - name: RESOLUTION_1H_RETENTION + value: "1" + - name: RESOLUTION_1D_RETENTION + value: "1" + image: gcr.io/kubecost1/cost-model-nightly:latest + imagePullPolicy: Always + ports: + - containerPort: 9006 + name: tcp-api + protocol: TCP + readinessProbe: + failureThreshold: 200 + httpGet: + path: /healthz + port: 9006 + scheme: HTTP + initialDelaySeconds: 10 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 1 + volumeMounts: + - mountPath: /var/configs + name: file-storage + volumes: + - name: file-storage + emptyDir: {} diff --git a/.github/workflows/helm-validation.yaml b/.github/workflows/helm-validation.yaml index 65d13cf..5852da4 100644 --- a/.github/workflows/helm-validation.yaml +++ b/.github/workflows/helm-validation.yaml @@ -37,7 +37,11 @@ jobs: - name: Run chart-testing (lint) if: steps.list-changed.outputs.changed == 'true' - run: ct lint --target-branch ${{ github.event.repository.default_branch }} + run: | + ct lint \ + --all \ + --validate-maintainers=false \ + --target-branch ${{ github.event.repository.default_branch }} - name: Create kind cluster if: steps.list-changed.outputs.changed == 'true' @@ -45,7 +49,20 @@ jobs: - name: Run chart-testing (install) if: steps.list-changed.outputs.changed == 'true' - run: ct install --target-branch ${{ github.event.repository.default_branch }} + run: | + helm install finops-agent-chart-test \ + --namespace finops-agent-chart-test --create-namespace \ + --wait --wait-for-jobs --timeout 300s \ + ./charts/finops-agent \ + -f .github/configs/helmValues-helm-validation.yaml + + - name: Wait for ready + if: steps.list-changed.outputs.changed == 'true' + run: | + kubectl wait -n finops-agent-chart-test \ + --for=condition=ready pod \ + --selector app.kubernetes.io/instance=finops-agent-chart-test \ + --timeout=120s whitespace-check: runs-on: ubuntu-latest From 69fdc3787415bc162de0a53213e294eb8e500fa9 Mon Sep 17 00:00:00 2001 From: jesse goodier <31039225+jessegoodier@users.noreply.github.com> Date: Mon, 25 Aug 2025 21:53:34 -0400 Subject: [PATCH 17/28] unused file --- .github/linters/yamllint-config.yaml | 39 ---------------------------- 1 file changed, 39 deletions(-) delete mode 100644 .github/linters/yamllint-config.yaml diff --git a/.github/linters/yamllint-config.yaml b/.github/linters/yamllint-config.yaml deleted file mode 100644 index 035c788..0000000 --- a/.github/linters/yamllint-config.yaml +++ /dev/null @@ -1,39 +0,0 @@ ---- -extends: default - -rules: - # 80 chars should be enough, but don't fail if a line is longer - line-length: - max: 120 - level: warning - - # Accept both Unix-style and Windows-style line endings - new-line-at-end-of-file: enable - - # Enforce document start with --- - document-start: - present: false - - # Spaces, not tabs - indentation: - spaces: 2 - indent-sequences: consistent - - # No trailing spaces - trailing-spaces: enable - - # Ensure consistent empty lines - empty-lines: - max: 2 - max-start: 0 - max-end: 0 - - # Enforce key ordering - key-ordering: disable - - # Quotes are not required for all strings in YAML - quoted-strings: - quote-type: any - required: only-when-needed - -# Made with Bob From d13a8b1e41a6b743bb918a5541696c27b369f0c8 Mon Sep 17 00:00:00 2001 From: jesse goodier <31039225+jessegoodier@users.noreply.github.com> Date: Mon, 25 Aug 2025 21:58:45 -0400 Subject: [PATCH 18/28] add extraObjects --- charts/finops-agent/README.md | 1 + .../templates/extra-manifests.yaml | 8 +++++++ charts/finops-agent/values.yaml | 22 +++++++++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 charts/finops-agent/templates/extra-manifests.yaml diff --git a/charts/finops-agent/README.md b/charts/finops-agent/README.md index 6d9702f..3214e1c 100644 --- a/charts/finops-agent/README.md +++ b/charts/finops-agent/README.md @@ -322,6 +322,7 @@ A default `StorageClass` is needed in the Kubernetes cluster to dynamically prov | `rbac.create` | Whether to create & use RBAC resources or not | `true` | | `rbac.clusterRole.create` | Whether to create & use ClusterRole resources or not | `true` | | `localStoreEnabled` | this values is only used by the Kubecost main chart, it must be set to false for the FinOps Agent to work when deployed by the FinOps Agent chart | `false` | +| `extraObjects` | Additional custom objects to deploy with the chart | `[]` | ## License diff --git a/charts/finops-agent/templates/extra-manifests.yaml b/charts/finops-agent/templates/extra-manifests.yaml new file mode 100644 index 0000000..edad397 --- /dev/null +++ b/charts/finops-agent/templates/extra-manifests.yaml @@ -0,0 +1,8 @@ +{{ range .Values.extraObjects }} +--- +{{- if typeIs "string" . }} + {{- tpl . $ }} +{{- else }} + {{- tpl (toYaml .) $ }} +{{- end }} +{{ end }} \ No newline at end of file diff --git a/charts/finops-agent/values.yaml b/charts/finops-agent/values.yaml index b62cd76..f910171 100644 --- a/charts/finops-agent/values.yaml +++ b/charts/finops-agent/values.yaml @@ -607,3 +607,25 @@ rbac: create: true clusterRole: create: true +extraObjects: [] +# - apiVersion: external-secrets.io/v1 +# kind: ExternalSecret +# metadata: +# name: example +# spec: +# refreshInterval: 1h +# secretStoreRef: +# name: secretstore-sample +# kind: SecretStore +# target: +# name: secret-to-be-created +# creationPolicy: Owner +# data: +# - secretKey: secret-key-to-be-managed +# remoteRef: +# key: provider-key +# version: provider-key-version +# property: provider-key-property +# dataFrom: +# - extract: +# key: remote-key-in-the-provider From 3f92d4fe695b1be45e5163b1162b5103d8b0b83a Mon Sep 17 00:00:00 2001 From: jesse goodier <31039225+jessegoodier@users.noreply.github.com> Date: Mon, 25 Aug 2025 21:59:07 -0400 Subject: [PATCH 19/28] fix env var --- charts/finops-agent/templates/deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/finops-agent/templates/deployment.yaml b/charts/finops-agent/templates/deployment.yaml index f16cdbb..b14d9bd 100644 --- a/charts/finops-agent/templates/deployment.yaml +++ b/charts/finops-agent/templates/deployment.yaml @@ -97,7 +97,7 @@ spec: {{- end }} env: - name: APP_NAME - - value: finops-agent + value: finops-agent {{- with .Values.agent.collectorDataSource }} {{- if .enabled }} - name: COLLECTOR_DATA_SOURCE_ENABLED From 76bdd67589d277677c9b1b6d9f342b4e0a735a31 Mon Sep 17 00:00:00 2001 From: jesse goodier <31039225+jessegoodier@users.noreply.github.com> Date: Mon, 25 Aug 2025 21:59:15 -0400 Subject: [PATCH 20/28] formatting --- charts/finops-agent/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/finops-agent/Chart.yaml b/charts/finops-agent/Chart.yaml index 863e6b7..5f44e35 100644 --- a/charts/finops-agent/Chart.yaml +++ b/charts/finops-agent/Chart.yaml @@ -14,7 +14,7 @@ dependencies: version: 2.x.x description: The IBM FinOps Agent collects usage and cost data from items running in the kubernetes cluster. These can then be consumed by Cloudability(TM) and Kubecost(TM). home: https://github.com/kubecost/finops-agent-chart -#icon: TODO - which icon to use? +# icon: TODO - which icon to use? keywords: - finops - ibm From 54abdb6b7e1d96be42757ea98f7f549f5f66bf84 Mon Sep 17 00:00:00 2001 From: jesse goodier <31039225+jessegoodier@users.noreply.github.com> Date: Mon, 25 Aug 2025 22:03:44 -0400 Subject: [PATCH 21/28] fix path --- .github/workflows/helm-validation.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/helm-validation.yaml b/.github/workflows/helm-validation.yaml index 5852da4..64f26d0 100644 --- a/.github/workflows/helm-validation.yaml +++ b/.github/workflows/helm-validation.yaml @@ -54,7 +54,7 @@ jobs: --namespace finops-agent-chart-test --create-namespace \ --wait --wait-for-jobs --timeout 300s \ ./charts/finops-agent \ - -f .github/configs/helmValues-helm-validation.yaml + -f .github/configs/helmValues-helm-validation-kubecost.yaml - name: Wait for ready if: steps.list-changed.outputs.changed == 'true' From 27b0cdaf01d13e8e9eb54605382bad416a874849 Mon Sep 17 00:00:00 2001 From: jesse goodier <31039225+jessegoodier@users.noreply.github.com> Date: Mon, 25 Aug 2025 22:06:43 -0400 Subject: [PATCH 22/28] cancel-in-progress --- .github/workflows/helm-validation.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/helm-validation.yaml b/.github/workflows/helm-validation.yaml index 64f26d0..48677d1 100644 --- a/.github/workflows/helm-validation.yaml +++ b/.github/workflows/helm-validation.yaml @@ -5,6 +5,10 @@ permissions: on: pull_request +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true # cancel if new commits are pushed to the same branch + jobs: lint-test: runs-on: ubuntu-latest From 6da354c6e6a7633c982c12aa08a0a91c07626b61 Mon Sep 17 00:00:00 2001 From: jesse goodier <31039225+jessegoodier@users.noreply.github.com> Date: Mon, 25 Aug 2025 22:14:56 -0400 Subject: [PATCH 23/28] rename job --- .github/workflows/helm-validation.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/helm-validation.yaml b/.github/workflows/helm-validation.yaml index 48677d1..f0948e6 100644 --- a/.github/workflows/helm-validation.yaml +++ b/.github/workflows/helm-validation.yaml @@ -10,7 +10,7 @@ concurrency: cancel-in-progress: true # cancel if new commits are pushed to the same branch jobs: - lint-test: + chart-test: runs-on: ubuntu-latest steps: - name: Checkout From 640c7a88e92fcafee8d40a8eb3acf404f4997566 Mon Sep 17 00:00:00 2001 From: jesse goodier <31039225+jessegoodier@users.noreply.github.com> Date: Tue, 26 Aug 2025 11:58:52 -0400 Subject: [PATCH 24/28] fix path --- .github/configs/helmValues-helm-validation-kubecost.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/configs/helmValues-helm-validation-kubecost.yaml b/.github/configs/helmValues-helm-validation-kubecost.yaml index e8e4f47..e604cc3 100644 --- a/.github/configs/helmValues-helm-validation-kubecost.yaml +++ b/.github/configs/helmValues-helm-validation-kubecost.yaml @@ -4,7 +4,7 @@ global: config: |- type: cluster config: - host: kubecost-local-store.kubecost.svc.cluster.local + host: kubecost-local-store.finops-agent-chart-test port: 9006 http_config: tls_config: From bb6fb8619bf380f9b183898ef84e154d0d87033b Mon Sep 17 00:00:00 2001 From: jesse goodier <31039225+jessegoodier@users.noreply.github.com> Date: Wed, 29 Oct 2025 09:24:03 -0400 Subject: [PATCH 25/28] formatting --- charts/finops-agent/values.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/finops-agent/values.yaml b/charts/finops-agent/values.yaml index b3a334e..fadbc73 100644 --- a/charts/finops-agent/values.yaml +++ b/charts/finops-agent/values.yaml @@ -32,7 +32,7 @@ global: # secret_key: xxx existingSecret: "" # If you want to use a different file name for the federated storage config, you can set the fileName value. - fileName: federated-store.yaml # set this value to change what the file name for the yaml config is + fileName: federated-store.yaml # set this value to change what the file name for the yaml config is ## @param cspPricingApiKey.existingSecret The name of an existing secret containing a GCP API key. If set, this existing secret will be used instead of creating a new one. ## @param cspPricingApiKey.apiKey The GCP API key value used to access pricing data. Required for GCP clusters to fetch on-demand pricing. ## If set, a new secret will be created with this API key. Leave empty if using an existing secret via cspPricingApiKey.existingSecret. @@ -330,7 +330,7 @@ containerSecurityContext: readOnlyRootFilesystem: true allowPrivilegeEscalation: false capabilities: - drop: [ "ALL" ] + drop: ["ALL"] seccompProfile: type: "RuntimeDefault" ## Configure extra options for the FinOps Agent container's liveness, readiness and startup probes From 084b81702c57d6ef761c9b8150f77b6c200882c9 Mon Sep 17 00:00:00 2001 From: jesse goodier <31039225+jessegoodier@users.noreply.github.com> Date: Wed, 29 Oct 2025 09:24:36 -0400 Subject: [PATCH 26/28] ct config for helm validation --- charts/finops-agent/ci/helmValues-chart-testing-values.yaml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 charts/finops-agent/ci/helmValues-chart-testing-values.yaml diff --git a/charts/finops-agent/ci/helmValues-chart-testing-values.yaml b/charts/finops-agent/ci/helmValues-chart-testing-values.yaml new file mode 100644 index 0000000..78eb35a --- /dev/null +++ b/charts/finops-agent/ci/helmValues-chart-testing-values.yaml @@ -0,0 +1,2 @@ +global: + clusterId: chart-testing From e70bf7a3eaea0a34db9818d9b7fbbcf3b61ad3f1 Mon Sep 17 00:00:00 2001 From: jesse goodier <31039225+jessegoodier@users.noreply.github.com> Date: Wed, 29 Oct 2025 09:30:37 -0400 Subject: [PATCH 27/28] helm validation workflow --- .github/workflows/helm-validation.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/helm-validation.yaml b/.github/workflows/helm-validation.yaml index f0948e6..0be9204 100644 --- a/.github/workflows/helm-validation.yaml +++ b/.github/workflows/helm-validation.yaml @@ -3,7 +3,9 @@ permissions: contents: read on: - pull_request + workflow_dispatch: {} + pull_request_target: + types: [opened, synchronize, reopened, ready_for_review] concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -51,7 +53,7 @@ jobs: if: steps.list-changed.outputs.changed == 'true' uses: helm/kind-action@v1 - - name: Run chart-testing (install) + - name: Run chart-testing (kubecost specific) if: steps.list-changed.outputs.changed == 'true' run: | helm install finops-agent-chart-test \ From d6c7a1de61c50fab57cf6bfba62d8ddc9e702737 Mon Sep 17 00:00:00 2001 From: jesse goodier <31039225+jessegoodier@users.noreply.github.com> Date: Wed, 29 Oct 2025 09:39:58 -0400 Subject: [PATCH 28/28] pin python to 3.13 --- .github/workflows/helm-validation.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/helm-validation.yaml b/.github/workflows/helm-validation.yaml index 0be9204..dd616e5 100644 --- a/.github/workflows/helm-validation.yaml +++ b/.github/workflows/helm-validation.yaml @@ -27,7 +27,7 @@ jobs: - uses: actions/setup-python@v5 with: - python-version: '3.x' + python-version: '3.13' check-latest: true - name: Set up chart-testing @@ -79,7 +79,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: '3.x' + python-version: '3.13' - name: Check for trailing whitespace in all files run: |