Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
cowwoc opened this issue Nov 24, 2024 · 1 comment
Open

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

cowwoc opened this issue Nov 24, 2024 · 1 comment
Labels
awaiting-upstream The issue cannot be resolved without action in another repository (may be owned by Pulumi). kind/bug Some behavior is incorrect or out of spec

Comments

@cowwoc
Copy link

cowwoc commented Nov 24, 2024

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).

@cowwoc cowwoc added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Nov 24, 2024
@cowwoc
Copy link
Author

cowwoc commented Nov 24, 2024

WORKAROUND: Explicitly add the default values:

delay: "0s",
window: "0s"

to the restartPolicy.

@blampe blampe added awaiting-upstream The issue cannot be resolved without action in another repository (may be owned by Pulumi). and removed needs-triage Needs attention from the triage team labels Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-upstream The issue cannot be resolved without action in another repository (may be owned by Pulumi). kind/bug Some behavior is incorrect or out of spec
Projects
None yet
Development

No branches or pull requests

2 participants