https://pulumi.com logo
Title
p

powerful-rain-97767

04/25/2022, 8:38 PM
Hello - I'm doing a POC to use Pulumi and running into a problem with
pulumi-kubernetes
and
kustomize
(python). I'm getting an error when trying to retrieve a kustomize directory from Github. The Github Repo is private, and SSO is configured. The code works if the repo is public. Here is my code:
image_tag = "main-xxxxx-xxxxxxx"
crds = k8s.kustomize.Directory(
    "some-crds",
    directory=f"<https://github.com/some-org/some-repo/tree/{image_tag}/config/crd>"
)
Here is the error:
Exception: invoke of kubernetes:kustomize:directory failed: invocation of kubernetes:kustomize:directory returned an error: failed to retrieve specified kustomize directory: "<https://github.com/some-org/some-repo/tree/main-xxxxx-xxxxxxx/config/crd>": failed to get git ref: authentication required
Wasn't sure if it was strictly necessary, but as part of troubleshooting I installed
pulumi-github
, created a new token and made sure to authorize it. I then set the token using the following:
pulumi config set github:token XXXXXXXXXXXXXX --secret
I found a github issue, but it's unclear whether using kustomize and targetting a private repo is unsupported, or if there is a bug. Has anybody gotten the above scenario to work?
b

billowy-army-68599

04/25/2022, 9:52 PM
I don’t believe this is supported yet. You might be able to work around it by passing the token as a header, but it isn't something that has come up before. Could you file an issue for it?
As a heads up, GitHub provider works by creating/managing github resources, so won’t help here
p

powerful-rain-97767

04/25/2022, 9:55 PM
No worries for Github provider, noticed that when I looked into further. Commented on an existing issue and someone responded. Here it is for reference: https://github.com/pulumi/pulumi-kubernetes/issues/1966