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

kube_config_admin_raw is empty string "" #27939

Open
1 task done
akheel5544 opened this issue Nov 7, 2024 · 0 comments
Open
1 task done

kube_config_admin_raw is empty string "" #27939

akheel5544 opened this issue Nov 7, 2024 · 0 comments
Labels

Comments

@akheel5544
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

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 comments along the lines of "+1", "me too" or "any updates", 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 and review the contribution guide to help.

Terraform Version

1.9.7

AzureRM Provider Version

4.7.0

Affected Resource(s)/Data Source(s)

terraform aks addons

Terraform Configuration Files

provider "kubernetes" {
  host                   = yamldecode(var.kubeconfig).clusters.0.cluster.server
  username               = yamldecode(var.kubeconfig).users.0.name
  client_certificate     = base64decode(yamldecode(var.kubeconfig).users.0.user.client-certificate-data)
  client_key             = base64decode(yamldecode(var.kubeconfig).users.0.user.client-key-data)
  cluster_ca_certificate = base64decode(yamldecode(var.kubeconfig).clusters.0.cluster.certificate-authority-data)
}


provider "helm" {
  kubernetes {
    host                   = yamldecode(var.kubeconfig).clusters.0.cluster.server
    client_certificate     = base64decode(yamldecode(var.kubeconfig).users.0.user.client-certificate-data)
    client_key             = base64decode(yamldecode(var.kubeconfig).users.0.user.client-key-data)
    cluster_ca_certificate = base64decode(yamldecode(var.kubeconfig).clusters.0.cluster.certificate-authority-data)
  }
}

provider "kubectl" {
  host                   = yamldecode(var.kubeconfig).clusters.0.cluster.server
  username               = yamldecode(var.kubeconfig).users.0.name
  client_certificate     = base64decode(yamldecode(var.kubeconfig).users.0.user.client-certificate-data)
  client_key             = base64decode(yamldecode(var.kubeconfig).users.0.user.client-key-data)
  cluster_ca_certificate = base64decode(yamldecode(var.kubeconfig).clusters.0.cluster.certificate-authority-data)
  load_config_file       = false
}

Debug Output/Panic Output

│ Error: Error in function call
│ 
│   on .terraform/modules/addons/modules/aks-addons/providers.tf line 20, in provider "kubernetes":
│   20:   host                   = yamldecode(var.kubeconfig).clusters.0.cluster.server
│     ├────────────────
│     │ while calling yamldecode(src)
│     │ var.kubeconfig is ""
│ 
│ Call to function "yamldecode" failed: on line 1, column 1: missing start of
│ document.
╵
╷
│ Error: Error in function call
│ 
│   on .terraform/modules/addons/modules/aks-addons/providers.tf line 21, in provider "kubernetes":
│   21:   username               = yamldecode(var.kubeconfig).users.0.name
│     ├────────────────
│     │ while calling yamldecode(src)
│     │ var.kubeconfig is ""
│ 
│ Call to function "yamldecode" failed: on line 1, column 1: missing start of
│ document.
╵
╷
│ Error: Error in function call
│ 
│   on .terraform/modules/addons/modules/aks-addons/providers.tf line 22, in provider "kubernetes":
│   22:   client_certificate     = base64decode(yamldecode(var.kubeconfig).users.0.user.client-certificate-data)
│     ├────────────────
│     │ while calling yamldecode(src)
│     │ var.kubeconfig is ""
│ 
│ Call to function "yamldecode" failed: on line 1, column 1: missing start of
│ document.
╵
╷
│ Error: Error in function call
│ 
│   on .terraform/modules/addons/modules/aks-addons/providers.tf line 23, in provider "kubernetes":
│   23:   client_key             = base64decode(yamldecode(var.kubeconfig).users.0.user.client-key-data)
│     ├────────────────
│     │ while calling yamldecode(src)
│     │ var.kubeconfig is ""
│ 
│ Call to function "yamldecode" failed: on line 1, column 1: missing start of
│ document.
╵
╷
│ Error: Error in function call
│ 
│   on .terraform/modules/addons/modules/aks-addons/providers.tf line 24, in provider "kubernetes":
│   24:   cluster_ca_certificate = base64decode(yamldecode(var.kubeconfig).clusters.0.cluster.certificate-authority-data)
│     ├────────────────
│     │ while calling yamldecode(src)
│     │ var.kubeconfig is ""
│ 
│ Call to function "yamldecode" failed: on line 1, column 1: missing start of
│ document.
╵
╷
│ Error: Error in function call
│ 
│   on .terraform/modules/addons/modules/aks-addons/providers.tf line 30, in provider "helm":
│   30:     host                   = yamldecode(var.kubeconfig).clusters.0.cluster.server
│     ├────────────────
│     │ while calling yamldecode(src)
│     │ var.kubeconfig is ""
│ 
│ Call to function "yamldecode" failed: on line 1, column 1: missing start of
│ document.
╵
╷
│ Error: Error in function call
│ 
│   on .terraform/modules/addons/modules/aks-addons/providers.tf line 31, in provider "helm":
│   31:     client_certificate     = base64decode(yamldecode(var.kubeconfig).users.0.user.client-certificate-data)
│     ├────────────────
│     │ while calling yamldecode(src)
│     │ var.kubeconfig is ""
│ 
│ Call to function "yamldecode" failed: on line 1, column 1: missing start of
│ document.
╵
╷
│ Error: Error in function call
│ 
│   on .terraform/modules/addons/modules/aks-addons/providers.tf line 32, in provider "helm":
│   32:     client_key             = base64decode(yamldecode(var.kubeconfig).users.0.user.client-key-data)
│     ├────────────────
│     │ while calling yamldecode(src)
│     │ var.kubeconfig is ""
│ 
│ Call to function "yamldecode" failed: on line 1, column 1: missing start of
│ document.
╵
╷
│ Error: Error in function call
│ 
│   on .terraform/modules/addons/modules/aks-addons/providers.tf line 33, in provider "helm":
│   33:     cluster_ca_certificate = base64decode(yamldecode(var.kubeconfig).clusters.0.cluster.certificate-authority-data)
│     ├────────────────
│     │ while calling yamldecode(src)
│     │ var.kubeconfig is ""
│ 
│ Call to function "yamldecode" failed: on line 1, column 1: missing start of
│ document.
╵
╷
│ Error: Error in function call
│ 
│   on .terraform/modules/eso/modules/common/addons/eso/providers.tf line 44, in provider "kubernetes":
│   44:   host                   = yamldecode(var.kubeconfig).clusters.0.cluster.server
│     ├────────────────
│     │ while calling yamldecode(src)
│     │ var.kubeconfig is ""
│ 
│ Call to function "yamldecode" failed: on line 1, column 1: missing start of
│ document.
╵
╷
│ Error: Error in function call
│ 
│   on .terraform/modules/eso/modules/common/addons/eso/providers.tf line 45, in provider "kubernetes":
│   45:   username               = yamldecode(var.kubeconfig).users.0.name
│     ├────────────────
│     │ while calling yamldecode(src)
│     │ var.kubeconfig is ""
│ 
│ Call to function "yamldecode" failed: on line 1, column 1: missing start of
│ document.
╵
╷
│ Error: Error in function call
│ 
│   on .terraform/modules/eso/modules/common/addons/eso/providers.tf line 46, in provider "kubernetes":
│   46:   client_certificate     = base64decode(yamldecode(var.kubeconfig).users.0.user.client-certificate-data)
│     ├────────────────
│     │ while calling yamldecode(src)
│     │ var.kubeconfig is ""
│ 
│ Call to function "yamldecode" failed: on line 1, column 1: missing start of
│ document.
╵
╷
│ Error: Error in function call
│ 
│   on .terraform/modules/eso/modules/common/addons/eso/providers.tf line 47, in provider "kubernetes":
│   47:   client_key             = base64decode(yamldecode(var.kubeconfig).users.0.user.client-key-data)
│     ├────────────────
│     │ while calling yamldecode(src)
│     │ var.kubeconfig is ""
│ 
│ Call to function "yamldecode" failed: on line 1, column 1: missing start of
│ document.
╵
╷
│ Error: Error in function call
│ 
│   on .terraform/modules/eso/modules/common/addons/eso/providers.tf line 48, in provider "kubernetes":
│   48:   cluster_ca_certificate = base64decode(yamldecode(var.kubeconfig).clusters.0.cluster.certificate-authority-data)
│     ├────────────────
│     │ while calling yamldecode(src)
│     │ var.kubeconfig is ""
│ 
│ Call to function "yamldecode" failed: on line 1, column 1: missing start of
│ document.
╵
╷
│ Error: Error in function call
│ 
│   on .terraform/modules/eso/modules/common/addons/eso/providers.tf line 54, in provider "helm":
│   54:     host                   = yamldecode(var.kubeconfig).clusters.0.cluster.server
│     ├────────────────
│     │ while calling yamldecode(src)
│     │ var.kubeconfig is ""
│ 
│ Call to function "yamldecode" failed: on line 1, column 1: missing start of
│ document.
╵
╷
│ Error: Error in function call
│ 
│   on .terraform/modules/eso/modules/common/addons/eso/providers.tf line 55, in provider "helm":
│   55:     client_certificate     = base64decode(yamldecode(var.kubeconfig).users.0.user.client-certificate-data)
│     ├────────────────
│     │ while calling yamldecode(src)
│     │ var.kubeconfig is ""
│ 
│ Call to function "yamldecode" failed: on line 1, column 1: missing start of
│ document.
╵
╷
│ Error: Error in function call
│ 
│   on .terraform/modules/eso/modules/common/addons/eso/providers.tf line 56, in provider "helm":
│   56:     client_key             = base64decode(yamldecode(var.kubeconfig).users.0.user.client-key-data)
│     ├────────────────
│     │ while calling yamldecode(src)
│     │ var.kubeconfig is ""
│ 
│ Call to function "yamldecode" failed: on line 1, column 1: missing start of
│ document.
╵
╷
│ Error: Error in function call
│ 
│   on .terraform/modules/eso/modules/common/addons/eso/providers.tf line 57, in provider "helm":
│   57:     cluster_ca_certificate = base64decode(yamldecode(var.kubeconfig).clusters.0.cluster.certificate-authority-data)
│     ├────────────────
│     │ while calling yamldecode(src)
│     │ var.kubeconfig is ""
│ 
│ Call to function "yamldecode" failed: on line 1, column 1: missing start of
│ document.
╵
╷
│ Error: Error in function call
│ 
│   on .terraform/modules/eso/modules/common/addons/eso/providers.tf line 62, in provider "kubectl":
│   62:   host                   = yamldecode(var.kubeconfig).clusters.0.cluster.server
│     ├────────────────
│     │ while calling yamldecode(src)
│     │ var.kubeconfig is ""
│ 
│ Call to function "yamldecode" failed: on line 1, column 1: missing start of
│ document.
╵
╷
│ Error: Error in function call
│ 
│   on .terraform/modules/eso/modules/common/addons/eso/providers.tf line 63, in provider "kubectl":
│   63:   username               = yamldecode(var.kubeconfig).users.0.name
│     ├────────────────
│     │ while calling yamldecode(src)
│     │ var.kubeconfig is ""
│ 
│ Call to function "yamldecode" failed: on line 1, column 1: missing start of
│ document.
╵
╷
│ Error: Error in function call
│ 
│   on .terraform/modules/eso/modules/common/addons/eso/providers.tf line 64, in provider "kubectl":
│   64:   client_certificate     = base64decode(yamldecode(var.kubeconfig).users.0.user.client-certificate-data)
│     ├────────────────
│     │ while calling yamldecode(src)
│     │ var.kubeconfig is ""
│ 
│ Call to function "yamldecode" failed: on line 1, column 1: missing start of
│ document.
╵
╷
│ Error: Error in function call
│ 
│   on .terraform/modules/eso/modules/common/addons/eso/providers.tf line 65, in provider "kubectl":
│   65:   client_key             = base64decode(yamldecode(var.kubeconfig).users.0.user.client-key-data)
│     ├────────────────
│     │ while calling yamldecode(src)
│     │ var.kubeconfig is ""
│ 
│ Call to function "yamldecode" failed: on line 1, column 1: missing start of
│ document.
╵
╷
│ Error: Error in function call
│ 
│   on .terraform/modules/eso/modules/common/addons/eso/providers.tf line 66, in provider "kubectl":
│   66:   cluster_ca_certificate = base64decode(yamldecode(var.kubeconfig).clusters.0.cluster.certificate-authority-data)
│     ├────────────────
│     │ while calling yamldecode(src)
│     │ var.kubeconfig is ""
│ 
│ Call to function "yamldecode" failed: on line 1, column 1: missing start of
│ document.
╵
Cleaning up project directory and file based variables
00:00
ERROR: Job failed: command terminated with exit code 1

Expected Behaviour

When I output kube_config_admin_raw it should give me a config file instead of an empty string.

Actual Behaviour

No response

Steps to Reproduce

No response

Important Factoids

No response

References

No response

@github-actions github-actions bot added the v/4.x label Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant