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(k8s): add configmap support #1214

Merged
merged 1 commit into from Dec 11, 2022
Merged

Conversation

abrahamjoc
Copy link
Contributor

Description

Read the Gruntwork contribution guidelines.

  • Run the relevant tests successfully, including pre-commit checks.
  • Include release notes. If this PR is backward incompatible, include a migration guide.

Release Notes (draft)

Added / Removed / Updated [X].

Added func to get k8s ConfigMap.

  • GetConfigMap
  • GetConfigMapE
  • WaitUntilConfigMapAvailable

@abrahamjoc
Copy link
Contributor Author

abrahamjoc commented Dec 9, 2022

Here, output of go test.

=== RUN   TestGetConfigMapEReturnsErrorForNonExistantConfigMap
=== PAUSE TestGetConfigMapEReturnsErrorForNonExistantConfigMap
=== CONT  TestGetConfigMapEReturnsErrorForNonExistantConfigMap
--- PASS: TestGetConfigMapEReturnsErrorForNonExistantConfigMap (0.07s)
TestGetConfigMapEReturnsCorrectConfigMapInCorrectNamespace 2022-12-09T11:49:08-03:00 logger.go:66: namespace/2blxun created
TestWaitUntilConfigMapAvailableReturnsSuccessfully 2022-12-09T11:49:08-03:00 logger.go:66: namespace/nxsfh6 created
TestGetConfigMapEReturnsCorrectConfigMapInCorrectNamespace 2022-12-09T11:49:08-03:00 logger.go:66: configmap/test-config-map created
TestWaitUntilConfigMapAvailableReturnsSuccessfully 2022-12-09T11:49:08-03:00 logger.go:66: configmap/test-config-map created
TestGetConfigMapEReturnsCorrectConfigMapInCorrectNamespace 2022-12-09T11:49:08-03:00 client.go:42: Configuring Kubernetes client using config file /home/abraham/.kube/config with context 
TestWaitUntilConfigMapAvailableReturnsSuccessfully 2022-12-09T11:49:08-03:00 retry.go:91: Wait for configmap test-config-map to be provisioned.
TestWaitUntilConfigMapAvailableReturnsSuccessfully 2022-12-09T11:49:08-03:00 client.go:42: Configuring Kubernetes client using config file /home/abraham/.kube/config with context 
TestGetConfigMapEReturnsCorrectConfigMapInCorrectNamespace 2022-12-09T11:49:08-03:00 logger.go:66: Running command kubectl with args [--namespace 2blxun delete -f /tmp/TestGetConfigMapEReturnsCorrectConfigMapInCorrectNamespace337781714]
TestWaitUntilConfigMapAvailableReturnsSuccessfully 2022-12-09T11:49:08-03:00 configmap.go:52: configmap is now available
TestWaitUntilConfigMapAvailableReturnsSuccessfully 2022-12-09T11:49:08-03:00 logger.go:66: Running command kubectl with args [--namespace nxsfh6 delete -f /tmp/TestWaitUntilConfigMapAvailableReturnsSuccessfully3778149765]
TestGetConfigMapEReturnsCorrectConfigMapInCorrectNamespace 2022-12-09T11:49:08-03:00 logger.go:66: Warning: deleting cluster-scoped resources, not scoped to the provided namespace
TestWaitUntilConfigMapAvailableReturnsSuccessfully 2022-12-09T11:49:08-03:00 logger.go:66: Warning: deleting cluster-scoped resources, not scoped to the provided namespace
TestGetConfigMapEReturnsCorrectConfigMapInCorrectNamespace 2022-12-09T11:49:08-03:00 logger.go:66: namespace "2blxun" deleted
TestWaitUntilConfigMapAvailableReturnsSuccessfully 2022-12-09T11:49:08-03:00 logger.go:66: namespace "nxsfh6" deleted
TestGetConfigMapEReturnsCorrectConfigMapInCorrectNamespace 2022-12-09T11:49:08-03:00 logger.go:66: configmap "test-config-map" deleted
TestWaitUntilConfigMapAvailableReturnsSuccessfully 2022-12-09T11:49:08-03:00 logger.go:66: configmap "test-config-map" deleted
=== RUN   TestGetConfigMapEReturnsCorrectConfigMapInCorrectNamespace
=== PAUSE TestGetConfigMapEReturnsCorrectConfigMapInCorrectNamespace
=== CONT  TestGetConfigMapEReturnsCorrectConfigMapInCorrectNamespace
TestWaitUntilConfigMapAvailableReturnsSuccessfully 2022-12-09T11:49:07-03:00 logger.go:66: Running command kubectl with args [--namespace nxsfh6 apply -f /tmp/TestWaitUntilConfigMapAvailableReturnsSuccessfully3891172061]
TestGetConfigMapEReturnsCorrectConfigMapInCorrectNamespace 2022-12-09T11:49:07-03:00 logger.go:66: Running command kubectl with args [--namespace 2blxun apply -f /tmp/TestGetConfigMapEReturnsCorrectConfigMapInCorrectNamespace1114146349]
--- PASS: TestGetConfigMapEReturnsCorrectConfigMapInCorrectNamespace (6.90s)
=== RUN   TestWaitUntilConfigMapAvailableReturnsSuccessfully
=== PAUSE TestWaitUntilConfigMapAvailableReturnsSuccessfully
=== CONT  TestWaitUntilConfigMapAvailableReturnsSuccessfully
TestGetConfigMapEReturnsErrorForNonExistantConfigMap 2022-12-09T11:49:07-03:00 client.go:42: Configuring Kubernetes client using config file /home/abraham/.kube/config with context 
--- PASS: TestWaitUntilConfigMapAvailableReturnsSuccessfully (6.93s)
PASS

Process finished with the exit code 0

Copy link
Member

@denis256 denis256 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 failed tests aren't related with added changes

@denis256 denis256 merged commit 5d6baeb into gruntwork-io:master Dec 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants