fix: use short SHA for chart appVersion#2
Open
twallac10 wants to merge 15 commits into
Open
Conversation
- Scaffold kubebuilder project with HelmReleaseTest CRD
- CRD types: HelmReleaseTestSpec (helmReleaseRef, kustomizationRef, cronJobRef),
full status fields, kubebuilder print columns
- Webhook handler (internal/webhook): HMAC-SHA256 validation, Flux event parsing,
HelmReleaseTest matching, 5-min dedup window, Job creation from CronJob template
- Job watcher controller: watches batch/v1 Jobs by label, lazy SHA resolution,
updates HelmReleaseTest status, posts GitHub commit status
- Kustomization SHA resolver (internal/kustomization): unstructured Kustomization fetch
- GitHub status reporter (internal/github): POST /statuses/{sha} with env-based config
- cmd/main.go: webhook goroutine on :8080, probes on :8082, metrics on :8081,
leader election ID helm-release-test-operator.testing.platform.io
- RBAC markers: batch jobs/cronjobs, kustomize+helm flux CRDs, helmreleasetests
- Sample manifests: HelmReleaseTest CR, suspended CronJob, Flux Provider+Alert
- Unit tests: HMAC validation, SHA parsing, dedup logic, GitHub status posting
- All verification steps pass: make generate, manifests, build, test
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Scope push trigger to main only so feature branch pushes don't fire a second run alongside the pull_request trigger. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- errcheck: wrap resp.Body.Close in func literal, remove duplicate os.Setenv calls - lll: break long flag.StringVar line in main.go - staticcheck QF1008: drop embedded .Time from CreationTimestamp.After call Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Multi-platform build (linux/amd64 + linux/arm64) covers Ubuntu k8s nodes and Mac OS kind clusters (Apple Silicon). On PRs, builds both platforms without pushing to verify the Dockerfile. On push to main, pushes ghcr.io/<owner>/testrun-operator:latest and :sha-<sha> tags. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Critical: - Controller: add LastRunJob guard to prevent re-processing completed Jobs, eliminating redundant status patches and duplicate GitHub API calls Important: - Webhook: add 1 MiB body size limit via http.MaxBytesReader - Webhook: remove unused testing.platform.io/helmrelease annotation write - GitHub: convert PostCommitStatus to Poster struct with injectable HTTPClient, read Token/Repo once at startup in main.go instead of inside the leaf function - main.go: implement fluxWebhookRunnable (manager.Runnable) for graceful shutdown with 5s drain timeout instead of bare goroutine - main.go: inject github.Poster into reconciler - manager.yaml: fix health probe arg and port from :8081 to :8082 - api types: remove LastTestedRevision field that was declared but never populated Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…FORM Without --platform=\$BUILDPLATFORM, Docker pulls the arm64 golang image and runs the entire Go compile under QEMU on the amd64 runner, which takes many minutes. With this flag the builder always runs natively; GOARCH=\$TARGETARCH handles cross-compilation. Only the final distroless layer needs QEMU. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root Cause
The `package-push-chart` CI job set chart appVersion to the full 40-char SHA via `${{ github.sha }}`, but `docker/metadata-action` with `type=sha,prefix=sha-` tags the image with the short 7-char SHA. This mismatch caused ImagePullBackOff — the chart referenced a tag that did not exist.
Fix
Truncate to 7 chars in the chart job to match the actual Docker image tag format.