feat(package): redeploy when resolved source digest changes - #341
Conversation
| - `insecure_force_http` (Boolean) Allow plain HTTP for OCI package sources and force plain HTTP for external Zarf registry pushes. Package sources continue to use HTTPS when available, while Zarf-managed registries use the transport recorded in cluster state. Defaults to `false`. Can also be configured with the `UDS_INSECURE_FORCE_HTTP` environment variable. | ||
| - `insecure_skip_tls_verification` (Boolean) Skip TLS certificate verification for HTTPS package sources and external Zarf registry pushes. Zarf-managed mTLS registries continue to use their managed trust configuration. Defaults to `false`. Can also be configured with the `UDS_INSECURE_SKIP_TLS_VERIFICATION` environment variable. | ||
| - `validate_packages_on_plan` (Boolean) Whether to validate UDS packages during planning. When enabled, the provider may load packages during plan to catch package-dependent configuration errors early, such as invalid optional component names or signature verification failures. Disable this to avoid plan-time package downloads or expensive validation. These checks are still enforced during apply. Defaults to `true`. Can also be configured with the `UDS_VALIDATE_PACKAGES_ON_PLAN` environment variable. | ||
| - `validate_packages_on_plan` (Boolean) Whether to validate UDS packages during planning. When enabled, the provider may load packages during plan to catch package-dependent configuration errors early, such as invalid optional component names or signature verification failures. Disabling this avoids plan-time package downloads for validation, but does not disable source digest resolution used for lifecycle change detection. These checks are still enforced during apply. Defaults to `true`. Can also be configured with the `UDS_VALIDATE_PACKAGES_ON_PLAN` environment variable. |
There was a problem hiding this comment.
I think we should stick to the intended behavior of validate_packages_on_plan here. Since this new check would also require the provider to download and inspect the source package, it should be skipped/deferred to apply like the other checks when the user is explicitly opt'ing to disable package validation on plan.
There was a problem hiding this comment.
Should be addressed - thanks Jason!
|
@greptileai review |
The PR should not merge until digest-triggered updates safely reject or replace package content whose metadata name differs from the currently managed package. Findings
|
| if !plan.SourceDigest.IsUnknown() && !plan.SourceDigest.Equal(state.SourceDigest) { | ||
| markDeploymentComputedAttributesUnknown(&plan) |
There was a problem hiding this comment.
Mutable rename orphans package
When a mutable tag resolves to package content with a different metadata.name, the digest change schedules an update without checking package identity. The update deploys the newly named package and points Terraform state at it, but removal only handles missing components and never removes the old package. This leaves the previous Zarf package and its resources deployed but permanently untracked. Reject the name change or replace the old package before updating state.
Description
Add digest-aware lifecycle handling to
uds_packageso mutable source references, such as OCI:devtags, redeploy when their resolved content changes.The provider now exposes a computed
source_digest, resolves it during planning with Zarf's package digest API, pins OCI sources to the planned digest during apply, verifies loaded package content before deployment, and refreshes the digest from deployed cluster state. The configuredsourceremains unchanged.Related issue
N/A
Type of change
Validation
uds run build --no-progressuds run generate --no-progressuds run test-unit --no-progressuds run lint:check --no-progressuds run test:acc --no-progressgit diff --checkChecklist