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

Manage aws auth configmap without needing temp files #260

Closed

Conversation

mbarrien
Copy link
Contributor

@mbarrien mbarrien commented Jan 31, 2019

PR o'clock

Description

This PR builds on top of #228 and removes the need for temp files altogether by using shell heredocs and file descriptors. This should be handled by most shells, although I've only tested in Bash.

Instead of writing temporary files, we use 2 heredocs to write to file descriptors 3 and 4, with each containing the contents of the config map and the kubectl respectively. We continue with the write_aws_auth_config variable from #228.

Unclear to me is whether this works in zsh, Windows, or pure sh. If it doesn't feel free to reject, but I feel this is MUCH cleaner of an implementation than all this local file management.

Checklist

  • terraform fmt and terraform validate both work from the root and examples/eks_test_fixture directories (look in CI for an example)
  • Tests for the changes have been added and passing (for bug fixes/features)
  • Test results are pasted in this PR (in lieu of CI)
  • I've added my change to CHANGELOG.md
  • Any breaking changes are highlighted above

@mbarrien
Copy link
Contributor Author

Hmm... this may not work for kubectl versions above 1.10.x; 1.11+ reads the kubeconfig multiple times within a single invocation and since a heredoc is not readable multiple times, this fails.

@mbarrien mbarrien closed this Jan 31, 2019
@max-rocket-internet
Copy link
Contributor

I feel this is MUCH cleaner of an implementation than all this local file management.

Agreed.

Sad it didn't work out though!

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, 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 Nov 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants