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

feat(provider): add config_data_base64 parameter #2453

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

yaroslavborbat
Copy link

Description

In some cases kubeconfig is passed to CICD via environment variables, but I would like to use this config when running the provider without creating a kubeconfig file.

For this purpose, the config_data_base64 paramerter is added to the provider configuration, which contains kubeconfig content in base64 format.

Usage examples:

provider "kubernetes" {
  config_data_base64 = "base64 config"
}

or
export KUBE_CONFIG_DATA_BASE64="base64 config"

Acceptance tests

  • Have you added an acceptance test for the functionality being added?
  • Have you run the acceptance tests on this branch?

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestProvider_configure_config_data_base64'
==> Checking that code complies with gofmt requirements...
go vet ./...
TF_ACC=1 go test "/home/yaroslavborbat/work/github/terraform-provider-kubernetes/kubernetes" -v -vet=off -run=TestProvider_configure_config_data_base64 -parallel 8 -timeout 3h
=== RUN   TestProvider_configure_config_data_base64
--- PASS: TestProvider_configure_config_data_base64 (0.01s)
PASS
ok      github.com/hashicorp/terraform-provider-kubernetes/kubernetes   0.034s
...

Release Note

Release note for CHANGELOG:

Added `config_data_base64` provider parameter.

References

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Signed-off-by: Yaroslav Borbat <yaroslav.borbat@flant.com>
Signed-off-by: Yaroslav Borbat <yaroslav.borbat@flant.com>
@yaroslavborbat yaroslavborbat requested a review from a team as a code owner March 25, 2024 11:06
@hashicorp-cla
Copy link

hashicorp-cla commented Mar 25, 2024

CLA assistant check
All committers have signed the CLA.

@alexsomesan
Copy link
Member

Hi @yaroslavborbat and thanks for the contribution. I'd like to understand more about the need that sparked this change. At first glance this seems like a very particular use-case that only a limited amount of users would ever encounter.

Can you please share some details on:

  • why the kubeconfig file cannot be loaded from a file?
  • why is there a need to base64 encode the kubeconfig value?
  • what generates the kubeconfig payload to begin with?

Thanks for sharing the extra context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants