Skip to content

Commit

Permalink
Create aws credential in controller test, remove old test artifacts a…
Browse files Browse the repository at this point in the history
…ctions

Signed-off-by: Kyle Squizzato <[email protected]>
  • Loading branch information
squizzi committed Aug 29, 2024
1 parent 9bc115e commit fcbad81
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,6 @@ jobs:
- name: Run E2E tests
run: |
make test-e2e
- name: Get test logs
run: |
kubectl logs -n hmc-system -l app=e2e-test > test/e2e/e2e-test.log
./bin/clusterctl describe cluster --show-conditions=all > test/e2e/clusterctl.log
- name: Archive test results
uses: actions/upload-artifact@v4
with:
Expand Down
4 changes: 4 additions & 0 deletions test/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ var _ = Describe("controller", Ordered, func() {
kc, err := kubeclient.NewFromLocal(namespace)
ExpectWithOffset(1, err).NotTo(HaveOccurred())

ExpectWithOffset(1, kc.CreateAWSCredentialsKubeSecret(context.Background())).To(Succeed())

By("validating that the hmc-controller and capi provider controllers are running")
verifyControllersUp := func() error {
if err := verifyControllerUp(kc, hmcControllerLabel, "hmc-controller-manager"); err != nil {
Expand Down Expand Up @@ -185,6 +187,8 @@ func verifyControllerUp(kc *kubeclient.KubeClient, labelSelector string, name st
return fmt.Errorf("controller pod in %s status", controllerPod.Status.Phase)
}

_, _ = fmt.Fprintf(GinkgoWriter, "%s controller pod validation succeeded\n", name)

return nil
}

Expand Down
4 changes: 2 additions & 2 deletions test/kubeclient/kubeclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ func new(configBytes []byte, namespace string) (*KubeClient, error) {
}

// CreateAWSCredentialsKubeSecret uses clusterawsadm to encode existing AWS
// credentials and create a secret named 'aws-credentials' in the given
// namespace if one does not already exist.
// credentials and create a secret in the given namespace if one does not
// already exist.
func (kc *KubeClient) CreateAWSCredentialsKubeSecret(ctx context.Context) error {
_, err := kc.Client.CoreV1().Secrets(kc.Namespace).Get(ctx, awsCredentialsSecretName, metav1.GetOptions{})
if !apierrors.IsNotFound(err) {
Expand Down

0 comments on commit fcbad81

Please sign in to comment.