Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataKubernetesNamespace resource is missing name field #856

Closed
bartlett-ops opened this issue Jul 29, 2021 · 5 comments
Closed

DataKubernetesNamespace resource is missing name field #856

bartlett-ops opened this issue Jul 29, 2021 · 5 comments
Labels
bug Something isn't working confirmed independently reproduced by an engineer on the team feature/tokens priority/important-longterm Medium priority, to be worked on within the following 1-2 business quarters. provider/kubernetes Issue shows up using Kubernetes provider

Comments

@bartlett-ops
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

cdktf & Language Versions

Typescript

cdktf: 0.2.1
"@cdktf/provider-kubernetes": "^0.2.110"

Affected Resource(s)

DataKubernetesNamespace

Probably other Kubernetes Data resources too

Debug Output

https://gist.github.com/bartlettt/bd130b3e27063948a1a8677fcc6e7bd4

Expected Behavior

Namespace name should have been printed to console

Actual Behavior

Undefined was printed to console

Steps to Reproduce

const dataNamespace = new DataKubernetesNamespace(stack, 'data-namespace', {
  metadata: [
    {
      name: 'kube-system'
    }
  ]
})

const namespaceName = dataNamespace.metadata[0].name
console.log(namespaceName)
@bartlett-ops bartlett-ops added bug Something isn't working new Un-triaged issue labels Jul 29, 2021
@bartlett-ops
Copy link
Author

Looks like a workaround is to use:
const name = ns.metadataInput[0].name

@danieldreier danieldreier added confirmed independently reproduced by an engineer on the team provider/kubernetes Issue shows up using Kubernetes provider needs-priority Issue has not yet been prioritized; this will prompt team review and removed new Un-triaged issue labels Jul 30, 2021
@danieldreier
Copy link
Contributor

@bartlettt thanks for reporting this! I've reproduced this using CDK for Terraform 0.5 and the 2.3.2 (current) version of the hashicorp/kubernetes provider. This does look like it should work.

For the sake of the engineer who picks this up, I created a simple reproduction case that can be git cloned.

@jsteinich
Copy link
Collaborator

Using metadataInput is the currently expected way of getting at explicitly specified values; however, accessing the name as a Terraform reference should be possible. It isn't currently because of

return `this.interpolationForAttribute('${att.terraformName}') as any`;
.
This should get fixed with #525.

@danieldreier danieldreier added priority/important-longterm Medium priority, to be worked on within the following 1-2 business quarters. feature/tokens and removed needs-priority Issue has not yet been prioritized; this will prompt team review labels Aug 19, 2021
@jsteinich jsteinich mentioned this issue Aug 20, 2021
8 tasks
@DanielMSchmidt
Copy link
Contributor

This should be fixed in 0.7, metadata is a single item block

@github-actions
Copy link
Contributor

github-actions bot commented Dec 1, 2022

I'm going to lock this issue because it has been closed for 30 days. This helps our maintainers find and focus on the active issues. If you've found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working confirmed independently reproduced by an engineer on the team feature/tokens priority/important-longterm Medium priority, to be worked on within the following 1-2 business quarters. provider/kubernetes Issue shows up using Kubernetes provider
Projects
None yet
Development

No branches or pull requests

4 participants