Skip to content
Success

Changes

Summary

  1. tekton: avoid dirty tidb-operator version during image builds (#4503) (commit: dd7dc03) (details)
Commit dd7dc0392220d9d4e4f5cb29bd7306f8118d9f62 by noreply
tekton: avoid dirty tidb-operator version during image builds (#4503)

## Summary
- move the package `release-dir` outside the checked-out source repo in
the linux package pipeline
- avoid creating an untracked `build/` directory inside component repos
before kaniko image builds
- fix the `tidb-operator` image version showing `-dirty` when built
through the tekton package pipeline

## Root cause
`pingcap-build-images` runs in the checked-out repo root and the
generated image build script unconditionally creates `RELEASE_WS` before
invoking kaniko. The linux package pipeline currently passes
`release-dir=build`, so the repo gets an untracked `build/` directory.
For `tidb-operator >= 2.0`, image builds use `context: .` plus
`image/Dockerfile`, and the Dockerfile runs `./hack/build.sh` inside the
repo. `tidb-operator` derives `dirty` from VCS state, so the untracked
`build/` directory turns the version into `-dirty`.

## Validation
- `yq e '.' tekton/v1/pipelines/pingcap-build-package-linux.yaml
>/dev/null`
- `git diff --check`
- local repro in `pingcap/tidb-operator`:
  - clean tree => clean version metadata
- creating only an untracked `build/` directory => dirty version
metadata
(commit: dd7dc03)
The file was modifiedtekton/v1/pipelines/pingcap-build-package-linux.yaml (diff)