Skip to content

Normalize docker_service max_failure_ratio diffs to prevent 0 vs 0.0 drift#901

Merged
Junkern merged 3 commits intomasterfrom
copilot/fix-docker-service-rollback-config
Apr 11, 2026
Merged

Normalize docker_service max_failure_ratio diffs to prevent 0 vs 0.0 drift#901
Junkern merged 3 commits intomasterfrom
copilot/fix-docker-service-rollback-config

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 11, 2026

docker_service was planning perpetual in-place updates when rollback_config.max_failure_ratio (and similarly update_config.max_failure_ratio) differed only by string formatting ("0" vs "0.0"). The provider state/read path formats this value as a decimal string, which caused Terraform to detect non-semantic drift.

  • Schema diff normalization for ratio fields

    • Added a shared diff suppressor (suppressEquivalentFloatRatio) that parses old/new values as floats and suppresses diffs when numerically equal.
    • Applied to both:
      • update_config.max_failure_ratio
      • rollback_config.max_failure_ratio
  • Targeted unit coverage for drift semantics

    • Added service schema tests to verify suppression behavior for equivalent float representations and to ensure real numeric changes still plan correctly.
"max_failure_ratio": {
  Type:             schema.TypeString,
  Default:          "0.0",
  Optional:         true,
  ValidateDiagFunc: validateStringIsFloatRatio(),
  DiffSuppressFunc: suppressEquivalentFloatRatio(),
}

Copilot AI changed the title [WIP] Fix drift in docker_service rollback_config.max_failure_ratio Normalize docker_service max_failure_ratio diffs to prevent 0 vs 0.0 drift Apr 11, 2026
Copilot AI requested a review from Junkern April 11, 2026 18:48
@Junkern Junkern marked this pull request as ready for review April 11, 2026 18:59
@Junkern Junkern merged commit fe8a2fc into master Apr 11, 2026
19 checks passed
@Junkern Junkern deleted the copilot/fix-docker-service-rollback-config branch April 11, 2026 18:59
mx-moth added a commit to mx-moth/terraform-provider-docker that referenced this pull request Apr 13, 2026
…to-service

* upstream/master:
  chore: Replace git-chglog with git-cliff (kreuzwerker#904)
  feat: Implement docker registry image tags data source (kreuzwerker#903)
  Fix flaky `docker_container` destroy by disabling link removal during delete (kreuzwerker#902)
  Normalize `docker_service` `max_failure_ratio` diffs to prevent `0` vs `0.0` drift (kreuzwerker#901)
  Fix `docker_container.container_logs` to return demultiplexed log content (kreuzwerker#899)
  feat: Add docker import action (kreuzwerker#900)
  docs: add missing docker_exec/buildx examples and align action name to docker_exec (kreuzwerker#898)
  feat: Expose attached container network addresses in `docker_network` data source (kreuzwerker#897)
  chore: Prepare release 4.1.0 (kreuzwerker#896)
  Prevent `docker_container` read panic with CDI `device_requests` by hardening device flattening (kreuzwerker#895)
  Add Plugin Framework `docker_containers` data source for Docker container enumeration (kreuzwerker#893)
  Fix `docker_service` platform flattening hash to prevent platform list drift on updates (kreuzwerker#892)
  fix: Make container deletion idempotent for missing containers (kreuzwerker#891)
  fix(deps): update module github.com/containerd/platforms to v1.0.0-rc.4 (kreuzwerker#889)
  Avoid `docker_container` replacement when only daemon default `log_opts` are present (kreuzwerker#888)
  Add `platform` support to `docker_container` for cross-architecture emulation (kreuzwerker#886)
  Allow `docker_registry_image.auth_config` to mirror provider `registry_auth` optional credentials (kreuzwerker#887)
  feat: Implement docker_exec action (kreuzwerker#885)
  chore: Prepare 4.0.0 release (kreuzwerker#884)
  feat: add selinux_relabel attribute to docker_container volumes (kreuzwerker#883)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Drift in docker_service rollback_config.max_failure_ratio between '0' and '0.0'

2 participants