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

Error: Provider produced inconsistent result after apply #278

Open
1 task
benkeil opened this issue Aug 3, 2024 · 0 comments
Open
1 task

Error: Provider produced inconsistent result after apply #278

benkeil opened this issue Aug 3, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@benkeil
Copy link

benkeil commented Aug 3, 2024

Description

Both resources are deployed in the cluster, but there is this error

│ Error: Provider produced inconsistent result after apply
│
│ When applying changes to
│ kubernetes_manifest.kubernetes_kubernetes-v1-Secret-paperless-c8e69fc5-paperless_D1C7DE5B,
│ provider
│ "provider[\"registry.terraform.io/hashicorp/kubernetes\"].cdktf-cdk8s-kubernetes"
│ produced an unexpected new value: .object.stringData: was
│ cty.MapVal(map[string]cty.Value{"SECRET_KEY":cty.StringVal("my-secret-key")}),
│ but now null.
│
│ This is a bug in the provider, which should be reported in the provider's own
│ issue tracker.
import {Construct} from "constructs";
import {App, TerraformStack} from "cdktf";
import {App as CDK8sApp, Chart} from "cdk8s";
import {CDK8sProvider} from "cdktf-cdk8s";
import {KeepassProvider} from "./.gen/providers/keepass/provider";
import {DataKeepassEntry} from "./.gen/providers/keepass/data-keepass-entry";
import {Namespace, Secret} from "cdk8s-plus-30";
import * as path from "node:path";

class MyStack extends TerraformStack {
    constructor(scope: Construct, id: string) {
        super(scope, id);

        new KeepassProvider(this, "keepass", {
            database: path.resolve('secrets.kdbx'),
            password: process.env.DEVOPS_KEEPASS_PASSWORD,
        })

        // define resources here
        const cdk8sApp = new CDK8sApp();

        new CDK8sProvider(this, "kubernetes", {
            configPath: "~/.kube/hyperkube.config",
            configContext: "hyperkube",

            // Only the cdk8sApp property is added
            // There is no need to run synth on the cdk8sApp, this is done by the provider
            cdk8sApp,
        });

        const nsChart = new Chart(cdk8sApp, "namespace");

        new Namespace(nsChart, "namespace", {
            metadata: {
                name: "paperless"
            }
        });

        const chart = new Chart(cdk8sApp, "paperless", {
            namespace: "paperless",
        });
        chart.addDependency(nsChart);

        const secretKey = new DataKeepassEntry(this, "DataKeepassEntry_PAPERLESS_SECRET_KEY", {
            path: "Root/PAPERLESS_SECRET_KEY",
        })

        new Secret(chart, "paperless", {
            stringData: {
                "SECRET_KEY": secretKey.password,
            }
        })
    }
}

const app = new App();
new MyStack(app, "application");
app.synth();

Versions

cdktf debug
language: typescript
cdktf-cli: 0.20.4
node: v20.15.1
cdktf: 0.20.8
constructs: 10.3.0
jsii: null
terraform: 1.5.7
arch: arm64
os: darwin 23.5.0
providers
iSchluff/keepass@~> 1.0 (LOCAL)
terraform provider version: 1.0.1
@cdktf/provider-kubernetes (PREBUILT)
terraform provider version: 2.31.0
prebuilt provider version: 11.6.0
cdktf version: ^0.20.0

Providers

┌──────────────────┬──────────────────┬─────────┬────────────┬────────────────────────────┬─────────────────┐
│ Provider Name │ Provider Version │ CDKTF │ Constraint │ Package Name │ Package Version │
├──────────────────┼──────────────────┼─────────┼────────────┼────────────────────────────┼─────────────────┤
│ iSchluff/keepass │ 1.0.1 │ │ ~> 1.0 │ │ │
├──────────────────┼──────────────────┼─────────┼────────────┼────────────────────────────┼─────────────────┤
│ kubernetes │ 2.31.0 │ ^0.20.0 │ │ @cdktf/provider-kubernetes │ 11.6.0 │
└──────────────────┴──────────────────┴─────────┴────────────┴────────────────────────────┴─────────────────┘

Gist

No response

Possible Solutions

No response

Workarounds

No response

Anything Else?

No response

References

No response

Help Wanted

  • I'm interested in contributing a fix myself

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
@benkeil benkeil added the bug Something isn't working label Aug 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant