Spinnaker重推已有标签(如latest)不触发构建的原因咨询
latest) doesn't trigger Spinnaker deployments, and how to fix it Hey there, let's unpack this common Spinnaker behavior and get you sorted:
Why this happens
The root cause boils down to how Spinnaker's Docker Registry triggers work, paired with the mutable nature of tags like latest:
- Triggers prioritize "new tags" over updated tags: As you noted in the official docs, when you specify a concrete tag (like
latest), Spinnaker only triggers your pipeline when it first encounters that tag. Re-pushing the same tag—even if the underlying image content changes—doesn't count as a "new tag" in Spinnaker's eyes. Leaving the tag field blank helps for new tags, but it still skips re-pushes of existing ones. - Spinnaker caches registry metadata: Spinnaker keeps a local cache of your ECR registry's image tags and their corresponding digests. If it already has a record of
latestpointing to an old image digest, it won't automatically pick up that the tag now maps to a new image unless you tell it to.
Fixes to get your deployments triggering again
Here are the most practical solutions, ordered by best practice:
Ditch
latestfor unique, immutable tags
This is the gold standard for container deployments. Instead of reusinglatest, tag your images with unique identifiers like Git commit hashes (a1b2c3d), timestamps (20240520-1645), or build numbers. Every new build gets a distinct tag, so Spinnaker will immediately detect it as a new image and fire off your pipeline—no extra config required. This also makes debugging rollbacks way easier, since you can trace exactly which image is running.Update your trigger to watch for digest changes
If you really need to keep using reusable tags, check if your Spinnaker version supports triggering on digest updates. Look in your pipeline's Docker Registry trigger settings for an option like "Trigger when tag's digest changes" (or similar wording). Enabling this tells Spinnaker to monitor when an existing tag points to a new image digest, rather than just looking for new tags.Manually refresh Spinnaker's registry cache (temporary workaround)
For quick one-off fixes, you can force Spinnaker to refresh its cache of your ECR registry. This can be done via the Spinnaker API or by restarting the Clouddriver service (depending on how you've deployed Spinnaker). Just note this isn't a long-term solution for automated workflows—it's only for when you need an immediate trigger.
内容的提问来源于stack exchange,提问作者Mohammed Idris

