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

adding taints to nodepools results in panic #74

Open
tcrasset opened this issue Oct 18, 2023 · 2 comments
Open

adding taints to nodepools results in panic #74

tcrasset opened this issue Oct 18, 2023 · 2 comments

Comments

@tcrasset
Copy link

This is my current nodepool. Uncommenting the taints spec I added yields an error.

const enum NodeType {
  GeneralPurpose = "generalPurpose",
  Small = "small",
  Medium = "medium",
  Huge = "huge",
}

const smallMemoryNodePools = new ovh.cloudproject.KubeNodePool(
  "ovh-nodepool-small",
  {
    serviceName: projectId,
    kubeId: cluster.id,
    desiredNodes: 1,
    flavorName: "r2-30", // Choose from https://www.ovhcloud.com/fr/public-cloud/prices/
    maxNodes: 3,
    minNodes: 1,
    autoscale: true,
    antiAffinity: false,
    monthlyBilled: false,

    template: {
      metadata: {
        annotations: {},
        finalizers: [],
        labels: {
          nodeType: NodeType.Small,
        },
      spec: {
		taints: [],
        // taints: [{
        //  key: "highMemory",
        //  value: "true",
        //  effect: "NoExecute",
        // }],
        unschedulable: false,
      },
    },
  },
  { provider: ovhProvider },
);

The error:

❯ pulumi up -t urn:pulumi:test-pulumi2::avatar-ovh::ovh:CloudProject/kubeNodePool:KubeNodePool::ovh-nodepool-small
Previewing update (test-pulumi2):
     Type                              Name                     Plan       Info
     pulumi:pulumi:Stack               avatar-ovh-test-pulumi2             1 error; 30 messages
 ~   └─ ovh:CloudProject:KubeNodePool  ovh-nodepool-small       update     [diff: ~template]; 1 error

Diagnostics:
  pulumi:pulumi:Stack (avatar-ovh-test-pulumi2):
    panic: fatal: A failure has occurred: Unexpected multiple elements in array with MaxItems=1
    goroutine 99 [running]:
    github.com/pulumi/pulumi/sdk/v3/go/common/util/contract.failfast(...)
    	/home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/[email protected]/go/common/util/contract/failfast.go:23
    github.com/pulumi/pulumi/sdk/v3/go/common/util/contract.Failf({0x14ce6c9?, 0xc000316000?}, {0x0?, 0x12b16a0?, 0x1463920?})
    	/home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/[email protected]/go/common/util/contract/fail.go:32 +0xcd
    github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge.MakeTerraformOutput.func1({0x16d24b8, 0xc000232180}, {0x140e720, 0xc000a80c40}, {0x16d36c0, 0xc000316000}, 0x0, 0xc000af5ef0, 0x0, 0x1)
    	/home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/[email protected]/pkg/tfbridge/schema.go:1057 +0xb9e
    github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge.MakeTerraformOutput({0x16d24b8?, 0xc000232180?}, {0x140e720?, 0xc000a80c40?}, {0x16d36c0?, 0xc000316000?}, 0xc000af4e10?, 0xc0009bc000?, 0x20?, 0x1)
    	/home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/[email protected]/pkg/tfbridge/schema.go:1085 +0x70
    github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge.MakeTerraformOutputs({0x16d24b8, 0xc000232180}, 0xc0003458f0?, {0x16c8b28, 0xc0003458f0}, 0x115c468?, 0x13f0bc0?, 0x0?, 0x48?)
    	/home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/[email protected]/pkg/tfbridge/schema.go:958 +0x1a6
    github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge.MakeTerraformResult({0x16d24b8?, 0xc000232180?}, {0x16c5030, 0xc000a56cc0}, {0x16c8b28?, 0xc0003458f0?}, 0xc0003458f0?, 0x1f?, 0x10?)
    	/home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/[email protected]/pkg/tfbridge/schema.go:933 +0xe5
    github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge.(*Provider).Update(0xc0001622c0, {0x16c4188?, 0xc000af4810?}, 0xc0003c6990)
    	/home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/[email protected]/pkg/tfbridge/provider.go:983 +0xae5
    github.com/pulumi/pulumi/sdk/v3/proto/go._ResourceProvider_Update_Handler.func1({0x16c4188, 0xc000af4810}, {0x13f88e0?, 0xc0003c6990})
    	/home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/[email protected]/proto/go/provider_grpc.pb.go:609 +0x7b
    github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc.OpenTracingServerInterceptor.func1({0x16c4188, 0xc000a8de00}, {0x13f88e0, 0xc0003c6990}, 0xc000a7a940, 0xc000a4eaf8)
    	/home/runner/go/pkg/mod/github.com/grpc-ecosystem/[email protected]/go/otgrpc/server.go:57 +0x3e8
    github.com/pulumi/pulumi/sdk/v3/proto/go._ResourceProvider_Update_Handler({0x144f680?, 0xc0001622c0}, {0x16c4188, 0xc000a8de00}, 0xc000199a40, 0xc000232d00)
    	/home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/[email protected]/proto/go/provider_grpc.pb.go:611 +0x138
    google.golang.org/grpc.(*Server).processUnaryRPC(0xc000446000, {0x16ce920, 0xc000552000}, 0xc000920b40, 0xc0003b4960, 0x2112cf0, 0x0)
    	/home/runner/go/pkg/mod/google.golang.org/[email protected]/server.go:1360 +0xe23
    google.golang.org/grpc.(*Server).handleStream(0xc000446000, {0x16ce920, 0xc000552000}, 0xc000920b40, 0x0)
    	/home/runner/go/pkg/mod/google.golang.org/[email protected]/server.go:1737 +0xa36
    google.golang.org/grpc.(*Server).serveStreams.func1.1()
    	/home/runner/go/pkg/mod/google.golang.org/[email protected]/server.go:982 +0x98
    created by google.golang.org/grpc.(*Server).serveStreams.func1
    	/home/runner/go/pkg/mod/google.golang.org/[email protected]/server.go:980 +0x18c

    error: preview failed

  ovh:CloudProject:KubeNodePool (ovh-nodepool-small):
    error: Preview failed: error reading from server: EOF

and the current state known to pulumi:

                {
                    "urn": "urn:pulumi:test-pulumi2::avatar-ovh::ovh:CloudProject/kubeNodePool:KubeNodePool::ovh-nodepool-small",
                    "custom": true,
                    "id": "7cb6b01e-01cf-4ac5-97b0-f5cb9a6c9ed8",
                    "type": "ovh:CloudProject/kubeNodePool:KubeNodePool",
                    "inputs": {
                        "__defaults": [
                            "name"
                        ],
                        "antiAffinity": false,
                        "autoscale": true,
                        "desiredNodes": 1,
                        "flavorName": "r2-30",
                        "kubeId": "7fd80973-ea87-4798-b199-5ffdb53e7974",
                        "maxNodes": 3,
                        "minNodes": 1,
                        "monthlyBilled": false,
                        "name": "ovh-nodepool-small-b905dfa",
                        "serviceName": "a40323b0eccb4606a325ef743c5dd17d",
                        "template": {
                            "__defaults": [],
                            "metadata": {
                                "__defaults": [],
                                "annotations": {
                                    "__defaults": []
                                },
                                "finalizers": [],
                                "labels": {
                                    "__defaults": [],
                                    "nodeType": "small"
                                }
                            },
                            "spec": {
                                "__defaults": [],
                                "taints": [],
                                "unschedulable": false
                            }
                        }
                    },
                    "outputs": {
                        "__meta": "{\"e2bfb730-ecaa-11e6-8f88-34363bc7c4c0\":{\"create\":1200000000000,\"default\":600000000000,\"delete\":600000000000,\"read\":300000000000,\"update\":600000000000}}",
                        "antiAffinity": false,
                        "autoscale": true,
                        "availableNodes": 1,
                        "createdAt": "2023-10-06T15:45:30Z",
                        "currentNodes": 1,
                        "desiredNodes": 1,
                        "flavor": "r2-30",
                        "flavorName": "r2-30",
                        "id": "7cb6b01e-01cf-4ac5-97b0-f5cb9a6c9ed8",
                        "kubeId": "7fd80973-ea87-4798-b199-5ffdb53e7974",
                        "maxNodes": 3,
                        "minNodes": 1,
                        "monthlyBilled": false,
                        "name": "ovh-small-nodepool-b905dfa",
                        "projectId": "a40323b0eccb4606a325ef743c5dd17d",
                        "serviceName": "a40323b0eccb4606a325ef743c5dd17d",
                        "sizeStatus": "CAPACITY_OK",
                        "status": "READY",
                        "template": {
                            "metadata": {
                                "annotations": {},
                                "finalizers": [],
                                "labels": {
                                    "nodeType": "small"
                                }
                            },
                            "spec": {
                                "taints": [],
                                "unschedulable": false
                            }
                        },
                        "upToDateNodes": 1,
                        "updatedAt": "2023-10-11T15:55:43Z"
                    },
                    "parent": "urn:pulumi:test-pulumi2::avatar-ovh::pulumi:pulumi:Stack::avatar-ovh-test-pulumi2",
                    "dependencies": [
                        "urn:pulumi:test-pulumi2::avatar-ovh::ovh:CloudProject/kube:Kube::test-pulumi2-app"
                    ],
                    "provider": "urn:pulumi:test-pulumi2::avatar-ovh::pulumi:providers:ovh::ovh-provider::05245939-c1d9-4bc8-ad0b-f9ce3c350d5a",
                    "propertyDependencies": {
                        "antiAffinity": null,
                        "autoscale": null,
                        "desiredNodes": null,
                        "flavorName": null,
                        "kubeId": [
                            "urn:pulumi:test-pulumi2::avatar-ovh::ovh:CloudProject/kube:Kube::test-pulumi2-app"
                        ],
                        "maxNodes": null,
                        "minNodes": null,
                        "monthlyBilled": null,
                        "serviceName": null,
                        "template": null
                    },
                    "created": "2023-10-06T15:50:03.05906Z",
                    "modified": "2023-10-11T15:55:43.476637361Z",
                    "sourcePosition": "project:///cluster.ts#57,30"
                },

Changing anything else makes the pulumi up preview work correctly.

@dirien
Copy link
Contributor

dirien commented Oct 19, 2023

Hey @tcrasset, thanks for reporting! I will have a look onto this!

@scraly
Copy link
Collaborator

scraly commented Feb 21, 2024

Does it work on the latest version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants