Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

[bug] fails to import: removes ports #38

Open
brandonkal opened this issue Nov 25, 2019 · 2 comments
Open

[bug] fails to import: removes ports #38

brandonkal opened this issue Nov 25, 2019 · 2 comments
Assignees
Labels
kind/bug Some behavior is incorrect or out of spec

Comments

@brandonkal
Copy link

brandonkal commented Nov 25, 2019

Pulumi does not include ports when adopting resulting in a failure to adopt existing resources:
YAML

apiVersion: v1
kind: Service
metadata:
  name: gitea-web
  labels:
    app: gitea-web
spec:
  ports:
    - port: 80
      targetPort: 8080
      name: http
  selector:
    app: gitea

TS
Note that using the kubernetes package for this service will also fail with a different error.

import * as kx from '@pulumi/kubernetesx' // version 0.1.1
const svc = new kx.Service(
  'gitea-web',
  {
    metadata: {
      name: 'gitea-web',
      labels: {
        app: 'gitea-web',
      },
    },
    spec: {
      ports: [
        {
          name: 'http',
          port: 80,
          targetPort: 8080,
        },
      ],
      selector: {
        app: 'gitea',
      },
    },
  },
  {
    import: 'gitea-web',
    ignoreChanges: ['metadata.annotations'],
  }
)

Details:

  pulumi:pulumi:Stack: (same)
    [urn=urn:pulumi:dev::gitkit::pulumi:pulumi:Stack::gitkit-dev]
    = kubernetes:core/v1:Service: (import)
        [id=gitea-web]
        [urn=urn:pulumi:dev::gitkit::kubernetes:core/v1:Service::gitea-web]
        [provider=urn:pulumi:dev::gitkit::pulumi:providers:kubernetes::default_1_3_1::3b7c7381-1acb-47d8-a7fd-dd8563b0de39]
      ~ metadata: {
          - annotations: {}
        }
      ~ spec    : {
          ~ ports: [
              - [0]: {
                      - name      : "http"
                      - port      : 80
                      - targetPort: 8080
                    }
            ]
        }

Also, I appear to be doing something wrong with getting it to ignore annotations.

@pgavlin
Copy link
Member

pgavlin commented Nov 25, 2019

@lblackstone do we have import and ignoreChanges plumbed for kx?

@brandonkal
Copy link
Author

I believe the issue is that ignoreChanges is not plumbed for the base kubernetes package either.

The second issue is that ports appear to be ignored in kx.

@lukehoban lukehoban added the kind/bug Some behavior is incorrect or out of spec label Jul 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Some behavior is incorrect or out of spec
Projects
None yet
Development

No branches or pull requests

4 participants