pulumi-kubernetes: Helm Release shows spurious diff when inputs are unknown

What happened?

Getting the following for my Helm release:

~ kubernetes:helm.sh/v3:Release chart update [diff: +compat-allowNullValues,apiVersion,createNamespace,dependencyUpdate,description,devel,disableCRDHooks,disableOpenapiValidation,disableWebhooks,forceUpdate,keyring,kind,lint,postrender,recreatePods,renderSubchartNotes,replace,resetValues,resourceNames,reuseValues,skipAwait,skipCrds,verify,version,waitForJobs~values]

It always happens after doing a refresh and then an up. For those exact values.

Example

No example. Under NDA.

Output of pulumi about

CLI
Version 3.92.0 Go Version go1.21.3 Go Compiler gc

Host
OS debian Version 12.2 Arch aarch64

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

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 25 (10 by maintainers)

Commits related to this issue

Most upvoted comments

I’d just like to know which of the values are varying. Because right now it shouldn’t deploy every time. At first glance, these values shouldn’t change.

So fixing the diff could be enough. Then at least I’ll understand the cause of it.

Could also be that logging some warnings could help. But that might create more confusion than clarity.

CC @dirien. This is quite critical to us.

@EronWright had the session with @ffMathy and this a code you can use, which is very very close to the setup of @ffMathy:

import * as pulumi from "@pulumi/pulumi";
import * as kubernetes from "@pulumi/kubernetes";
import * as command from "@pulumi/command";

const someNamespace = new kubernetes.core.v1.Namespace('some-namespace', {
    metadata: {
        name: 'some-namespace'
    }
});

const x = new command.local.Command('some-command', {
    update: "ls -la",
    create: "ls -la",
});

export const commandResult = x.stdout

new kubernetes.helm.v3.Release('some-chart', {
    chart: 'oci://ghcr.io/dirien/charts/minecraft-exporter',
    version: ' 0.11.1',
    name: 'some-stuff',
    timeout: 60 * 60 * 3,
    namespace: someNamespace.metadata.name,
    atomic: true,
    cleanupOnFail: true,
    description: x.stdout,
    values: {
        replicaCount: 1,
        dsd: 1,
        sds: 12,
    },
}, {
    customTimeouts: {
        create: '30m',
        update: '6h',
    },
});

This results in the pulumi preview to:

âžś pulumi preview
Previewing update (dev)

View in Browser (Ctrl+O): https://app.pulumi.com/dirien/lego-helm/dev/previews/26dabdc2-8f56-4736-b405-fdec73ce526c

     Type                              Name           Plan       Info
     pulumi:pulumi:Stack               lego-helm-dev             
 +   ├─ command:local:Command          some-command   create     
 ~   └─ kubernetes:helm.sh/v3:Release  some-chart     update     [diff: +compat-allowNullValues,apiVersion,checksum,createNamespace,dependencyUpdate,devel,disableCRDHooks,disableOpenapiValidation,disableWebhooks,forceUpdate,keyring,kind,lint,pos

Outputs:
  + commandResult: output<string>

Resources:
    + 1 to create
    ~ 1 to update
    2 changes. 2 unchanged

So using a resource output from a computed field as input in the Release object results in the situation @ffMathy reported!

That sounds very plausible! None of the values that are in the diff are specified by us.

It be great if we could also seal this off with a unit test.