I'm trying to use the SecretPatch resource and get...
# python
n
I'm trying to use the SecretPatch resource and getting an error after it applies for the first time. Curious if anyone knows how to implement it correctly?
Copy code
kubernetes:core/v1:SecretPatch (cluster-dev-argo-externaldns-secret-patch):
    error: error reading from server: EOF

  pulumi:pulumi:Stack (aws-eks-dev):
    panic: fatal: An assertion has failed: path: [stringData]  |  v: <nil>  | old: <nil>  |  oldInput: <nil>
    goroutine 610 [running]:
Copy code
SecretPatch(
    f"{self.name}-argo-externaldns-secret-patch",
    metadata={
        "name": f"{self.name}",
        "namespace": "argocd",
        "annotations": {
            "external-dns-sa-arn": iam_role.arn
        },
    },
    opts=pulumi.ResourceOptions(
        depends_on=[
            role_attach,
            argo_cluster_secret,
        ],
        provider=self.cluster_provider,
    ),
)
d
The usage looks correct. Have you enabled Server Side Apply?
n
yeah I have that enabled on the k8s provider currently:
Copy code
self.cluster_provider = Provider(
            resource_name=name,
            kubeconfig=cluster.kubeconfig,
            opts=pulumi.ResourceOptions(depends_on=[cluster]),
            enable_server_side_apply=True,
        )
d
Not sure then. I've used it in the past to set string_data. Given it's mentioned in the error, what happens if you provide an empty dict?
n
hm, that's a good suggestion. seems like it does clear that error! does seem like the labels are going to be deleted in the original secret though so need to figure that out now 🤔
d
Interesting, the labels should definitely not delete. Worth raising issues for both on github
n
interestingly seems like it was just in the
pulumi up
details diff but the labels are still there. running it through again to verify the behavior but will make a ticket for the secret data issue. appreciate the help!