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

v1/Secret always in diff when using stringData with v4.0.1 #2507

Closed
Oro opened this issue Jul 20, 2023 · 0 comments · Fixed by #2511
Closed

v1/Secret always in diff when using stringData with v4.0.1 #2507

Oro opened this issue Jul 20, 2023 · 0 comments · Fixed by #2511
Assignees
Labels
4.0 kind/bug Some behavior is incorrect or out of spec p1 A bug severe enough to be the next item assigned to an engineer resolution/fixed This issue was fixed

Comments

@Oro
Copy link

Oro commented Jul 20, 2023

What happened?

Having a secret as following always results in a diff and pulumi trying to recreate the secret on every run
This works (without a diff) with @pulumi/kubernetes 3.30.2

Expected Behavior

No diff on pulumi pre//up

Steps to reproduce

import { Provider } from '@pulumi/kubernetes/provider';
import { Secret } from '@pulumi/kubernetes/core/v1/secret';

const k8sProvider = new Provider('k8sProvider', {
  context: 'mycontext',
});

  new Secret(
    'diff',
    {
      stringData: {
        diff: 'yep',
      },
    },
    {
      provider: k8sProvider,
    }
  );

output:

pulumi up
Previewing update (orotest):
     Type                          Name                Plan        Info
     pulumi:pulumi:Stack           k8s-4x-bug-orotest              
 +-  └─ kubernetes:core/v1:Secret  diff                replace     [diff: +stringData]


Resources:
    +-1 to replace
    2 unchanged

Do you want to perform this update? details
  pulumi:pulumi:Stack: (same)
    [urn=urn:pulumi:orotest::k8s-4x-bug::pulumi:pulumi:Stack::k8s-4x-bug-orotest]
    ++kubernetes:core/v1:Secret: (create-replacement)
        [id=default/diff-ce1859b6]
        [urn=urn:pulumi:orotest::k8s-4x-bug::kubernetes:core/v1:Secret::diff]
        [provider=urn:pulumi:orotest::k8s-4x-bug::pulumi:providers:kubernetes::k8sProvider::70b9e47c-3365-46c7-a284-14f1c1195b35]
      + stringData: [secret]
    +-kubernetes:core/v1:Secret: (replace)
        [id=default/diff-ce1859b6]
        [urn=urn:pulumi:orotest::k8s-4x-bug::kubernetes:core/v1:Secret::diff]
        [provider=urn:pulumi:orotest::k8s-4x-bug::pulumi:providers:kubernetes::k8sProvider::70b9e47c-3365-46c7-a284-14f1c1195b35]
      + stringData: [secret]
    --kubernetes:core/v1:Secret: (delete-replaced)
        [id=default/diff-ce1859b6]
        [urn=urn:pulumi:orotest::k8s-4x-bug::kubernetes:core/v1:Secret::diff]
        [provider=urn:pulumi:orotest::k8s-4x-bug::pulumi:providers:kubernetes::k8sProvider::70b9e47c-3365-46c7-a284-14f1c1195b35]

Output of pulumi about

CLI          
Version      3.60.1
Go Version   go1.20.4
Go Compiler  gc

Plugins
NAME        VERSION
kubernetes  4.0.1
nodejs      unknown

Host     
OS       nixos
Version  23.11 (Tapir)
Arch     x86_64

This project is written in nodejs: executable='/nix/store/w1ipv1cmppqbqrpwxi9acdxz7grrdz34-devenv-profile/bin/node' version='v18.16.0'

Current Stack: orotest

TYPE                         URN
pulumi:pulumi:Stack          urn:pulumi:orotest::k8s-4x-bug::pulumi:pulumi:Stack::k8s-4x-bug-orotest
pulumi:providers:kubernetes  urn:pulumi:orotest::k8s-4x-bug::pulumi:providers:kubernetes::k8sProvider
kubernetes:core/v1:Secret    urn:pulumi:orotest::k8s-4x-bug::kubernetes:core/v1:Secret::diff


Found no pending operations associated with orotest

Backend        
Name           OroFramework
URL            file://./
User           oro
Organizations  

Dependencies:
NAME                VERSION
typescript          5.1.6
@pulumi/kubernetes  4.0.1
@types/node         18.16.19

Pulumi locates its logs in /tmp by default

Additional context

It seems to be connected to using `stringData, as the following works (i.e. no diff on subsequent runs)

  new Secret(
    'no-diff',
    {
      data: {
        diff: Buffer.from('nope').toString("base64"),
      },
    },
    {
      provider: k8sProvider,
    }
  );

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

@Oro Oro added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Jul 20, 2023
@lblackstone lblackstone self-assigned this Jul 20, 2023
@lblackstone lblackstone added 4.0 p1 A bug severe enough to be the next item assigned to an engineer p0 A bug severe enough to interrupt existing work and removed needs-triage Needs attention from the triage team p0 A bug severe enough to interrupt existing work labels Jul 20, 2023
@pulumi-bot pulumi-bot added the resolution/fixed This issue was fixed label Jul 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.0 kind/bug Some behavior is incorrect or out of spec p1 A bug severe enough to be the next item assigned to an engineer resolution/fixed This issue was fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants