Skip to content

Commit

Permalink
test/e2e stream runtime SDK extension controller logs to artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
chrischdi committed Jul 11, 2022
1 parent 6df168f commit dca7aaa
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions test/e2e/cluster_upgrade_runtimesdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/pkg/errors"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -148,6 +149,36 @@ func clusterUpgradeWithRuntimeSDKSpec(ctx context.Context, inputGetter func() cl
err = input.BootstrapClusterProxy.GetClient().Create(ctx, responses)
Expect(err).ToNot(HaveOccurred(), "Failed to create the responses configmap")

By("Wait for test Extension Deployment to be running")
deploymentList := &appsv1.DeploymentList{}
Eventually(func() error {
if err := input.BootstrapClusterProxy.GetClient().List(ctx, deploymentList, client.InNamespace(namespace.Name)); err != nil {
return err
}
if len(deploymentList.Items) == 0 {
return errors.New("expected to find at least one deployment")
}
return nil
}, time.Minute, 3*time.Second).Should(Succeed(), "Failed to list deployments for the cluster API controllers")

By("Start streaming logs of the Extension Deployment")
Expect(deploymentList.Items).ToNot(BeEmpty(), "The list of controller deployments should not be empty")
for _, deployment := range deploymentList.Items {
d := deployment.DeepCopy()
framework.WaitForDeploymentsAvailable(ctx, framework.WaitForDeploymentsAvailableInput{
Getter: input.BootstrapClusterProxy.GetClient(),
Deployment: d,
}, input.E2EConfig.GetIntervals(specName, "wait-controllers")...)

// Start streaming logs from all controller providers
framework.WatchDeploymentLogs(ctx, framework.WatchDeploymentLogsInput{
GetLister: input.BootstrapClusterProxy.GetClient(),
ClientSet: input.BootstrapClusterProxy.GetClientSet(),
Deployment: d,
LogPath: filepath.Join(input.ArtifactFolder, "clusters", input.BootstrapClusterProxy.GetName(), "logs", namespace.Name),
})
}

By("Creating a workload cluster")

clusterctl.ApplyClusterTemplateAndWait(ctx, clusterctl.ApplyClusterTemplateAndWaitInput{
Expand Down

0 comments on commit dca7aaa

Please sign in to comment.