https://pulumi.com logo
k

kind-mechanic-53546

08/24/2020, 1:20 AM
is it desirable to include the kind and version in a resource? e.g.
Copy code
const eventRouterServiceAccount = new k8s.core.v1.ServiceAccount(
    "eventRouterServiceAccount",
    {
      apiVersion: "v1", // << Remove?
      kind: "ServiceAccount", // << Remove?
      metadata: {
        name: "eventRouter",
        namespace: "kube-system",
      },
    }
  );
a) we already know we're creating a
ServiceAccount
, b) we're specifying the version twice
core.v1.
This is from kube2pulumi
g

gorgeous-egg-16927

08/24/2020, 3:29 PM
It’s redundant, but it works. It’s a minor (known) bug in
kube2pulumi
https://github.com/pulumi/kube2pulumi/issues/10
You can safely remove those fields since they’re set in the resource constructors
k

kind-mechanic-53546

08/25/2020, 8:20 AM
thanks, eventually I'll put all the pieces together 🙂
4 Views