Skip to content

Service.restartPolicy.delay and window always marked as changed #1285

@cowwoc

Description

@cowwoc

Describe what happened

If you deploy the sample code using pulumi up twice, the second time will detect the following diff even though nothing changed:

~ restartPolicy    : {
    condition  : "on-failure"
  - delay      : "0s"
    maxAttempts: 3
  - window     : "0s"
}

This might be an upstream problem similar to #1272

Sample program

const certbotImage = await getRegistryImage({
		name: "cowwoc/certbot-dns-cloudflare:latest"
	}, {provider});
	const certbotRemoteImage = new RemoteImage("certbot", {
			name: certbotImage.name,
			pullTriggers: [certbotImage.sha256Digest]
		},
		{provider, dependsOn: dependencies});

	const certbot = new Service("certbot", {
			name: "certbot",
			taskSpec: {
				containerSpec: {
					// https://www.pulumi.com/registry/packages/docker/api-docs/image/#image-name
					image: certbotRemoteImage.repoDigest,
					commands: ["/bin/sh", "-c", "entrypoint.sh"],
					env: {
						"CERTBOT_DOMAIN": certificateDomains,
						"CERTBOT_EMAIL": certificateEmailAddress,
						"CLOUDFLARE_API_TOKEN": cloudflareApiToken,
						"REPLACE_SYMLINKS": "true"
					},
					mounts: [
						{
							// resolve() normalizes slashes
							source: path.resolve(`${hostPath}/config`),
							target: "/etc/letsencrypt",
							type: "volume"
						},
						{
							// Locks prevent concurrent updates
							source: path.resolve(`${hostPath}/locks`),
							target: "/var/lib/letsencrypt",
							type: "volume"
						},
						{
							source: path.resolve(`${hostPath}/logs`),
							target: "/var/log/letsencrypt",
							type: "volume"
						}]
				},
				networksAdvanceds: [{name: network.id}],
				restartPolicy: {
					condition: "on-failure",
					maxAttempts: 3
				}
			},
			endpointSpec: {
				ports: [{
					protocol: "tcp",
					targetPort: 5432,
					publishedPort: 5432
				}]
			},
			mode: {
				replicated: {
					replicas: 1
				}
			}
		},
		{
			provider
		});

Log output

No response

Affected Resource(s)

No response

Output of pulumi about

pulumi about
CLI
Version      3.141.0
Go Version   go1.23.3
Go Compiler  gc

Plugins
KIND      NAME          VERSION
resource  command       1.0.1
resource  digitalocean  4.35.0
resource  docker        4.5.7
language  nodejs        unknown
resource  tls           5.0.9

Host
OS       Microsoft Windows 10 Pro
Version  10.0.19045 Build 19045
Arch     x86_64

This project is written in nodejs: executable='C:\Users\Gili\scoop\apps\nodejs\current\node.exe' version='v23.3.0'

Backend
Name           pulumi.com
URL            https://app.pulumi.com/cowwoc
User           cowwoc
Organizations  cowwoc, licensed
Token type     personal

Pulumi locates its logs in C:\Users\Gili\AppData\Local\Temp by default

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

Metadata

Metadata

Assignees

No one assigned

    Labels

    awaiting-upstreamThe issue cannot be resolved without action in another repository (may be owned by Pulumi).kind/bugSome behavior is incorrect or out of spec

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions