-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(MINOR) New methods for Kubernetes job assertion and EKS interactions (…
…#26) ### SUMMARY This resolves #21 , with the exception that currently the reason for the job failure (e.g. job logs) is not outputted by the test. Streaming / capturing logs proved to be more complex, so a separate issue will be opened to enhance the method in the future. * A new package `k8s` has been added with some methods around asserting things against Kubernetes clusters. * New methods have been added to the `aws` package around interacting with EKS clusters. * An integration test using `kind` has been added for this new method. A new Make target of `k8s-integration-test` has been added to run this. * The GitHub workflow for validating PRs has been updated to run these integrations tests with a matrix of k8s versions from 1.19-1.21. ### DEVELOPER IMPACT #### ADDED * A new `k8s` package has been added with numerous methods around asserting tests against Kubernetes clusters: * `k8s.AssertJobSucceeds`: This method runs a job against a Kubernetes cluster, and asserts that it finishes successfully. * `k8s.GetClientsetE`: This method is a wrapper around some Kubernetes API methods that makes constructing a new [`Clientset`](https://pkg.go.dev/k8s.io/client-go@v0.23.1/kubernetes#Clientset) object easy in various ways. Several functional option methods have been added in support of this, including: * `k8s.WithGetClientsetEHost`: This method configures a host name to be used by the clientset. * `k8s.WithGetClientsetEToken`: This method configures a bearer token to be used by the clientset. * `k8s.WithGetClientsetETLSCAData`: This method configures the CA certificate to be trusted by the clientset when connecting to the Kubernetes API endpoint. * `k8s.WithGetClientsetEKubeconfigPath`: This method configures the clientset using an existing config file. It should only be used in isolation for best results. * New methods around EKS clusters have been added to the `aws` package. * `aws.GetEKSClusterE`: This method retrieves useful information around EKS clusters, such as cluster endpoints. * `aws.GetEKSTokenE`: This method returns a bearer token that can be used to authenticate against EKS clusters using the Kubernetes `client-go` library and other methods in the `k8s` package. #### CHANGED * The module now requires Go v1.17 at a minimum. This is due to an upstream issue with the Kubernetes API library; please see [this PR comment](kubernetes/kubernetes#106666 (comment)).
- Loading branch information
1 parent
372195b
commit 9502340
Showing
17 changed files
with
2,497 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.