pulumi / pulumi-kubernetes

A Pulumi resource provider for Kubernetes to manage API resources and workloads in running clusters
https://www.pulumi.com/docs/reference/clouds/kubernetes/
Apache License 2.0
414 stars 116 forks source link

The `punycode` module is deprecated. Please use a userland alternative instead. #3301

Open cowwoc opened 3 weeks ago

cowwoc commented 3 weeks ago

What happened?

Every time pulumi is run, it outputs:

[DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.

Example

Run pulumi up

Output of pulumi about

CLI
Version      3.137.0
Go Version   go1.23.2
Go Compiler  gc

Plugins
KIND      NAME                     VERSION
resource  aws                      6.57.0
resource  kubernetes               4.18.2
resource  kubernetes-cert-manager  0.0.7
language  nodejs                   unknown

Host
OS       Microsoft Windows 10 Pro
Version  10.0.19045 Build 19045
Arch     x86_64

This project is written in nodejs: executable='C:\Users\Gili\scoop\apps\nodejs\current\node.exe' version='v23.1.0'

Current Stack: licensed/licensed/local

TYPE                                                         URN
pulumi:pulumi:Stack                                          urn:pulumi:local::licensed::pulumi:pulumi:Stack::licensed-local
pulumi:providers:kubernetes                                  urn:pulumi:local::licensed::pulumi:providers:kubernetes::local
kubernetes:core/v1:Namespace                                 urn:pulumi:local::licensed::kubernetes:core/v1:Namespace::cert-manager
kubernetes:core/v1:Namespace                                 urn:pulumi:local::licensed::kubernetes:core/v1:Namespace::velero
kubernetes:core/v1:Secret                                    urn:pulumi:local::licensed::kubernetes:core/v1:Secret::cert-manager.cloudflare.api-token
pulumi:providers:kubernetes-cert-manager                     urn:pulumi:local::licensed::pulumi:providers:kubernetes-cert-manager::default_0_0_7
pulumi:providers:pulumi                                      urn:pulumi:local::licensed::pulumi:providers:pulumi::default
kubernetes:helm.sh/v4:Chart                                  urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart::minio
kubernetes-cert-manager:index:CertManager                    urn:pulumi:local::licensed::kubernetes-cert-manager:index:CertManager::cert-manager
kubernetes:helm.sh/v3:Release                                urn:pulumi:local::licensed::kubernetes-cert-manager:index:CertManager$kubernetes:helm.sh/v3:Release::cert-manager-helm
kubernetes:core/v1:ServiceAccount                            urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:core/v1:ServiceAccount::minio:velero/minio
kubernetes:core/v1:Secret                                    urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:core/v1:Secret::minio:velero/minio
kubernetes:core/v1:Service                                   urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:core/v1:Service::minio:velero/minio
kubernetes:core/v1:PersistentVolumeClaim                     urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:core/v1:PersistentVolumeClaim::minio:velero/minio
kubernetes:policy/v1:PodDisruptionBudget                     urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:policy/v1:PodDisruptionBudget::minio:velero/minio
kubernetes:networking.k8s.io/v1:NetworkPolicy                urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:networking.k8s.io/v1:NetworkPolicy::minio:velero/minio
kubernetes:cert-manager.io/v1:Issuer                         urn:pulumi:local::licensed::kubernetes:cert-manager.io/v1:Issuer::cert-manager.acme.certificate.issuer
kubernetes:apps/v1:Deployment                                urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:apps/v1:Deployment::minio:velero/minio
kubernetes:cert-manager.io/v1:Certificate                    urn:pulumi:local::licensed::kubernetes:cert-manager.io/v1:Certificate::cert-manager.certificate
kubernetes:core/v1:Secret                                    urn:pulumi:local::licensed::kubernetes:core/v1:Secret::velero.repo.credentials
kubernetes:batch/v1:Job                                      urn:pulumi:local::licensed::kubernetes:batch/v1:Job::velero.minio.create-bucket
kubernetes:helm.sh/v4:Chart                                  urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart::velero
kubernetes:core/v1:ServiceAccount                            urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:core/v1:ServiceAccount::velero:velero/velero-server
kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition  urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition::velero:deletebackuprequests.velero.io
kubernetes:rbac.authorization.k8s.io/v1:RoleBinding          urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:rbac.authorization.k8s.io/v1:RoleBinding::velero:velero/velero-server
kubernetes:rbac.authorization.k8s.io/v1:Role                 urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:rbac.authorization.k8s.io/v1:Role::velero:velero/velero-server
kubernetes:core/v1:Secret                                    urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:core/v1:Secret::velero:velero/velero
kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition  urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition::velero:serverstatusrequests.velero.io
kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition  urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition::velero:backuprepositories.velero.io
kubernetes:core/v1:Service                                   urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:core/v1:Service::velero:velero/velero
kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition  urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition::velero:downloadrequests.velero.io
kubernetes:rbac.authorization.k8s.io/v1:ClusterRoleBinding   urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:rbac.authorization.k8s.io/v1:ClusterRoleBinding::velero:velero-server
kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition  urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition::velero:volumesnapshotlocations.velero.io
kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition  urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition::velero:backupstoragelocations.velero.io
kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition  urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition::velero:datadownloads.velero.io
kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition  urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition::velero:podvolumerestores.velero.io
kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition  urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition::velero:datauploads.velero.io
kubernetes:apps/v1:Deployment                                urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:apps/v1:Deployment::velero:velero/velero
kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition  urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition::velero:podvolumebackups.velero.io
kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition  urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition::velero:restores.velero.io
kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition  urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition::velero:backups.velero.io
kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition  urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition::velero:schedules.velero.io
kubernetes:velero.io/v1:BackupStorageLocation                urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:velero.io/v1:BackupStorageLocation::velero:velero/backup

Found no pending operations associated with local

Backend
Name           pulumi.com
URL            https://app.pulumi.com/cowwoc
User           cowwoc
Organizations  cowwoc, licensed
Token type     personal

Pulumi locates its logs in C:\Users\Gili\AppData\Local\Temp by default
warning: Failed to get information about the Pulumi program's dependencies: no package-lock.json or yarn.lock file found (searching upwards from [redacted])

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

justinvp commented 2 weeks ago

I can repro this with:

pulumi new kubernetes-typescript
...
pulumi preview

Modifying Pulumi.yaml to trace node warnings:

name: npunyk8s
runtime:
  name: nodejs
  options:
    packagemanager: npm
    nodeargs: --trace-warnings

And running pulumi preview again:

    (node:38212) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
        at node:punycode:3:9
        at BuiltinModule.compileForInternalLoader (node:internal/bootstrap/realm:399:7)
        at BuiltinModule.compileForPublicLoader (node:internal/bootstrap/realm:338:10)
        at loadBuiltinModule (node:internal/modules/helpers:113:7)
        at Function._load (node:internal/modules/cjs/loader:1097:17)
        at TracingChannel.traceSync (node:diagnostics_channel:322:14)
        at wrapModuleLoad (node:internal/modules/cjs/loader:216:24)
        at Module.require (node:internal/modules/cjs/loader:1337:12)
        at require (node:internal/modules/helpers:139:16)
        at Object.<anonymous> (/Users/user/npunyk8s/node_modules/whatwg-url/lib/url-state-machine.js:2:18)

Looking at my package-lock.json, it looks like whatwg-url is a dependency of node-fetch:

        "node_modules/node-fetch": {
            "version": "2.7.0",
            "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz",
            "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==",
            "license": "MIT",
            "dependencies": {
                "whatwg-url": "^5.0.0"
            },

Which is a dependency of @pulumi/kubernetes:

https://github.com/pulumi/pulumi-kubernetes/blob/8b4540505aa5dbee269c5582cecc2796620330f8/sdk/nodejs/package.json#L21

Transferring this issue to https://github.com/pulumi/pulumi-kubernetes

vladshcherbin commented 2 weeks ago

Same, this message comes every time you run pulumi command - so annoying. Any workaround for now?

vladshcherbin commented 2 weeks ago

Looking at the repo, it seems like node-fetch is not even used anywhere in the codebase 🤔

blampe commented 1 week ago

Looking at the repo, it seems like node-fetch is not even used anywhere in the codebase 🤔

It is used

https://github.com/pulumi/pulumi-kubernetes/blob/6865778769350cfcb6acd71e85e774e64563edf2/sdk/nodejs/yaml/yaml.ts#L21

but should just be a matter of updating the dependency.