Interview Prep/CI/CD/Fundamentals and Pipeline Design

How should pipelines version artifacts, and why are mutable tags like `latest` dangerous?

AdvancedConceptFundamentals and Pipeline Design
Answer

Artifacts need an identifier that maps back to the source and never changes: the Git SHA (api:3f9c2ab), a SemVer tag from a release (1.14.2), or the content digest (@sha256:...). Often we publish several tags pointing at the same digest: 1.14.2, 1.14, and the SHA.

latest and other mutable tags break traceability (what is running?), make rollbacks ambiguous, and cause nodes to pull different bits at different times when a tag is repointed. Kubernetes with imagePullPolicy: IfNotPresent can even run different versions on different nodes. Deploy by digest or immutable tag, and enable tag immutability in ECR/Artifactory.

All CI/CD questions Roadmap: CI/CD fundamentals

More on Fundamentals and Pipeline Design