Skip to content

MSP-72 Converted to dns-canary to helm chart#29

Merged
jeff-french merged 5 commits intomainfrom
add-dns-canary-chart
Mar 14, 2025
Merged

MSP-72 Converted to dns-canary to helm chart#29
jeff-french merged 5 commits intomainfrom
add-dns-canary-chart

Conversation

@chad-moonswitch
Copy link
Contributor

No description provided.

@chad-moonswitch
Copy link
Contributor Author

chad-moonswitch commented Mar 4, 2025

I reviewed this error with AI. Seems like the error is related to versioning with the main file and since this is a new addition, the linter is getting caught trying to compare versions. It spit out a draft fix for the github actions to more gracefully handle new chart additions:

# name: lint-test

on:
  pull_request:
    paths:
      - 'charts/**'

jobs:
  lint:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout Code
        uses: actions/checkout@v4
        with:
          fetch-depth: 0  # Make sure we have history to check against `main`

      - name: Set Chart Name
        run: |
          CHANGED_CHART=$(ls charts | grep dns-canary || true)
          if [ -z "$CHANGED_CHART" ]; then
            echo "❌ No changes detected for dns-canary, this job may have been triggered incorrectly."
            exit 1
          fi
          echo "CHART_NAME=$CHANGED_CHART" >> $GITHUB_ENV

      - name: Detect if Chart is New
        run: |
          if git ls-tree -r origin/main --name-only | grep -q "charts/$CHART_NAME/Chart.yaml"; then
            echo "NEW_CHART=false" >> $GITHUB_ENV
          else
            echo "NEW_CHART=true" >> $GITHUB_ENV
          fi

      - name: Log Detection Result
        run: |
          echo "Is this a new chart? $NEW_CHART"

      - name: Helm Setup
        uses: azure/setup-helm@v4
        with:
          version: v3.12.0

      - name: Helm Lint (New Chart Flow)
        if: env.NEW_CHART == 'true'
        run: |
          echo "🔔 Detected new chart ($CHART_NAME). Skipping version bump check."
          helm lint charts/$CHART_NAME/

      - name: Helm Lint (Existing Chart Flow)
        if: env.NEW_CHART == 'false'
        run: |
          echo "🔔 Existing chart detected. Performing normal lint + version bump check."
          # Example - customize this part if your repo has special rules for version bumps
          helm lint charts/$CHART_NAME/
          # Optional - Add version comparison logic if needed for existing charts.```

@chad-moonswitch
Copy link
Contributor Author

Linting is failing, but I'm not sure how to troubleshoot.

Copy link
Contributor

@jeff-french jeff-french left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to rename the directory to dns-canary so that it's a valid DNS name when used to create k8s resources.

Copy link
Contributor

@jeff-french jeff-french left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple more small changes. Once we have this published, let's deploy it into the Moonswitch cluster for testing first.

@jeff-french jeff-french merged commit 639c3ac into main Mar 14, 2025
1 check passed
@jeff-french jeff-french deleted the add-dns-canary-chart branch March 18, 2025 16:59
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.

2 participants