Skip to content

Commit

Permalink
Merge pull request #3649 from fabriziopandini/fix-e2e-logs
Browse files Browse the repository at this point in the history
🌱 Fix some typos and grammar in e2e logs
  • Loading branch information
k8s-ci-robot authored Sep 16, 2020
2 parents 624ddb0 + d2db1db commit 90f6e46
Show file tree
Hide file tree
Showing 13 changed files with 22 additions and 25 deletions.
4 changes: 2 additions & 2 deletions test/e2e/kcp_adoption.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ func KCPAdoptionSpec(ctx context.Context, inputGetter func() KCPAdoptionSpecInpu
ControlPlane: controlPlane,
})

By("taking stable ownership of the Machines")
By("Taking stable ownership of the Machines")
must := func(r *labels.Requirement, err error) labels.Requirement {
if err != nil {
panic(err)
Expand Down Expand Up @@ -184,7 +184,7 @@ func KCPAdoptionSpec(ctx context.Context, inputGetter func() KCPAdoptionSpecInpu
clusterv1.ClusterLabelName: clusterName,
})).To(Succeed())

By("taking ownership of the cluster's PKI material")
By("Taking ownership of the cluster's PKI material")
secrets := corev1.SecretList{}
Expect(client.List(ctx, &secrets, ctrlclient.InNamespace(namespace.Name), ctrlclient.MatchingLabels{
clusterv1.ClusterLabelName: cluster.Name,
Expand Down
5 changes: 2 additions & 3 deletions test/e2e/self_hosted.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func SelfHostedSpec(ctx context.Context, inputGetter func() SelfHostedSpecInput)
Namespace: namespace.Name,
})

log.Logf("Waiting for the cluster infrastructure to be provisioned")
log.Logf("Waiting for the cluster to be reconciled after moving to self hosted")
selfHostedCluster = framework.DiscoveryAndWaitForCluster(ctx, framework.DiscoveryAndWaitForClusterInput{
Getter: selfHostedClusterProxy.GetClient(),
Namespace: selfHostedNamespace.Name,
Expand All @@ -155,7 +155,6 @@ func SelfHostedSpec(ctx context.Context, inputGetter func() SelfHostedSpecInput)
})

AfterEach(func() {
//TODO: refactor in to an helper func e.g. "MoveToBootstrapAndWait"
if selfHostedNamespace != nil {
// Dump all Cluster API related resources to artifacts before pivoting back.
framework.DumpAllResources(ctx, framework.DumpAllResourcesInput{
Expand All @@ -174,7 +173,7 @@ func SelfHostedSpec(ctx context.Context, inputGetter func() SelfHostedSpecInput)
Namespace: selfHostedNamespace.Name,
})

log.Logf("Waiting for the cluster infrastructure to be provisioned")
log.Logf("Waiting for the cluster to be reconciled after moving back to booststrap")
cluster = framework.DiscoveryAndWaitForCluster(ctx, framework.DiscoveryAndWaitForClusterInput{
Getter: input.BootstrapClusterProxy.GetClient(),
Namespace: namespace.Name,
Expand Down
6 changes: 3 additions & 3 deletions test/framework/cluster_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ type WaitForClusterToProvisionInput struct {

// WaitForClusterToProvision will wait for a cluster to have a phase status of provisioned.
func WaitForClusterToProvision(ctx context.Context, input WaitForClusterToProvisionInput, intervals ...interface{}) {
By("waiting for cluster to enter the provisioned phase")
By("Waiting for cluster to enter the provisioned phase")
Eventually(func() (string, error) {
cluster := &clusterv1.Cluster{}
key := client.ObjectKey{
Expand All @@ -147,7 +147,7 @@ func DeleteCluster(ctx context.Context, input DeleteClusterInput) {
if options.SkipResourceCleanup {
return
}
By(fmt.Sprintf("deleting cluster %s", input.Cluster.GetName()))
By(fmt.Sprintf("Deleting cluster %s", input.Cluster.GetName()))
Expect(input.Deleter.Delete(ctx, input.Cluster)).To(Succeed())
}

Expand All @@ -162,7 +162,7 @@ func WaitForClusterDeleted(ctx context.Context, input WaitForClusterDeletedInput
if options.SkipResourceCleanup {
return
}
By(fmt.Sprintf("waiting for cluster %s to be deleted", input.Cluster.GetName()))
By(fmt.Sprintf("Waiting for cluster %s to be deleted", input.Cluster.GetName()))
Eventually(func() bool {
cluster := &clusterv1.Cluster{}
key := client.ObjectKey{
Expand Down
2 changes: 1 addition & 1 deletion test/framework/control_plane.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type WaitForControlPlaneToBeUpToDateInput struct {

// WaitForControlPlaneToBeUpToDate will wait for a control plane to be fully up-to-date.
func WaitForControlPlaneToBeUpToDate(ctx context.Context, input WaitForControlPlaneToBeUpToDateInput, intervals ...interface{}) {
By("waiting for the control plane to be ready")
By("Waiting for the control plane to be ready")
Eventually(func() (int32, error) {
controlplane := &controlplanev1.KubeadmControlPlane{}
key := client.ObjectKey{
Expand Down
8 changes: 4 additions & 4 deletions test/framework/controlplane_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ type WaitForKubeadmControlPlaneMachinesToExistInput struct {

// WaitForKubeadmControlPlaneMachinesToExist will wait until all control plane machines have node refs.
func WaitForKubeadmControlPlaneMachinesToExist(ctx context.Context, input WaitForKubeadmControlPlaneMachinesToExistInput, intervals ...interface{}) {
By("waiting for all control plane nodes to exist")
By("Waiting for all control plane nodes to exist")
inClustersNamespaceListOption := client.InNamespace(input.Cluster.Namespace)
// ControlPlane labels
matchClusterListOption := client.MatchingLabels{
Expand Down Expand Up @@ -120,7 +120,7 @@ func WaitForOneKubeadmControlPlaneMachineToExist(ctx context.Context, input Wait
Expect(input.Lister).ToNot(BeNil(), "Invalid argument. input.Getter can't be nil when calling WaitForOneKubeadmControlPlaneMachineToExist")
Expect(input.ControlPlane).ToNot(BeNil(), "Invalid argument. input.ControlPlane can't be nil when calling WaitForOneKubeadmControlPlaneMachineToExist")

By("waiting for one control plane node to exist")
By("Waiting for one control plane node to exist")
inClustersNamespaceListOption := client.InNamespace(input.Cluster.Namespace)
// ControlPlane labels
matchClusterListOption := client.MatchingLabels{
Expand Down Expand Up @@ -152,7 +152,7 @@ type WaitForControlPlaneToBeReadyInput struct {

// WaitForControlPlaneToBeReady will wait for a control plane to be ready.
func WaitForControlPlaneToBeReady(ctx context.Context, input WaitForControlPlaneToBeReadyInput, intervals ...interface{}) {
By("waiting for the control plane to be ready")
By("Waiting for the control plane to be ready")
Eventually(func() (bool, error) {
controlplane := &controlplanev1.KubeadmControlPlane{}
key := client.ObjectKey{
Expand Down Expand Up @@ -314,7 +314,7 @@ func UpgradeControlPlaneAndWaitForUpgrade(ctx context.Context, input UpgradeCont

Expect(patchHelper.Patch(ctx, input.ControlPlane)).To(Succeed())

log.Logf("Waiting for machines to have the upgraded kubernetes version")
log.Logf("Waiting for control-plane machines to have the upgraded kubernetes version")
WaitForControlPlaneMachinesToBeUpgraded(ctx, WaitForControlPlaneMachinesToBeUpgradedInput{
Lister: mgmtClient,
Cluster: input.Cluster,
Expand Down
2 changes: 1 addition & 1 deletion test/framework/daemonset_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type WaitForKubeProxyUpgradeInput struct {

// WaitForKubeProxyUpgrade waits until kube-proxy version matches with the kubernetes version. This is called during KCP upgrade.
func WaitForKubeProxyUpgrade(ctx context.Context, input WaitForKubeProxyUpgradeInput, intervals ...interface{}) {
By("ensuring kube-proxy has the correct image")
By("Ensuring kube-proxy has the correct image")

Eventually(func() (bool, error) {
ds := &appsv1.DaemonSet{}
Expand Down
4 changes: 2 additions & 2 deletions test/framework/deployment_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ type WaitForDeploymentsAvailableInput struct {
// all the desired replicas are in place.
// This can be used to check if Cluster API controllers installed in the management cluster are working.
func WaitForDeploymentsAvailable(ctx context.Context, input WaitForDeploymentsAvailableInput, intervals ...interface{}) {
By(fmt.Sprintf("waiting for deployment %s/%s to be available", input.Deployment.GetNamespace(), input.Deployment.GetName()))
By(fmt.Sprintf("Waiting for deployment %s/%s to be available", input.Deployment.GetNamespace(), input.Deployment.GetName()))
deployment := &appsv1.Deployment{}
Eventually(func() bool {
key := client.ObjectKey{
Expand Down Expand Up @@ -233,7 +233,7 @@ type WaitForDNSUpgradeInput struct {

// WaitForDNSUpgrade waits until CoreDNS version matches with the CoreDNS upgrade version. This is called during KCP upgrade.
func WaitForDNSUpgrade(ctx context.Context, input WaitForDNSUpgradeInput, intervals ...interface{}) {
By("ensuring CoreDNS has the correct image")
By("Ensuring CoreDNS has the correct image")

Eventually(func() (bool, error) {
d := &appsv1.Deployment{}
Expand Down
2 changes: 1 addition & 1 deletion test/framework/deprecated.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ func (input *ControlplaneClusterInput) ControlPlaneCluster() {
Expect(mgmtClient.Create(ctx, input.MachineDeployment.InfraMachineTemplate)).To(Succeed())
}

By("waiting for the workload nodes to exist")
By("Waiting for the workload nodes to exist")
Eventually(func() ([]corev1.Node, error) {
workloadClient, err := input.Management.GetWorkloadClient(ctx, input.Cluster.Namespace, input.Cluster.Name)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions test/framework/machine_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package framework

import (
"context"
"fmt"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
Expand Down Expand Up @@ -120,8 +121,7 @@ func WaitForControlPlaneMachinesToBeUpgraded(ctx context.Context, input WaitForC
Expect(input.KubernetesUpgradeVersion).ToNot(BeEmpty(), "Invalid argument. input.KubernetesUpgradeVersion can't be empty when calling WaitForControlPlaneMachinesToBeUpgraded")
Expect(input.MachineCount).To(BeNumerically(">", 0), "Invalid argument. input.MachineCount can't be smaller than 1 when calling WaitForControlPlaneMachinesToBeUpgraded")

By("ensuring all machines have upgraded kubernetes version")
log.Logf("Ensuring all MachineDeployment Machines have upgraded kubernetes version %s", input.KubernetesUpgradeVersion)
By(fmt.Sprintf("Ensuring all control-plane machines have upgraded kubernetes version %s", input.KubernetesUpgradeVersion))

Eventually(func() (int, error) {
machines := GetControlPlaneMachinesByCluster(ctx, GetControlPlaneMachinesByClusterInput{
Expand Down
2 changes: 1 addition & 1 deletion test/framework/machinedeployment_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func WaitForMachineDeploymentNodesToExist(ctx context.Context, input WaitForMach
Expect(input.Lister).ToNot(BeNil(), "Invalid argument. input.Lister can't be nil when calling WaitForMachineDeploymentNodesToExist")
Expect(input.MachineDeployment).ToNot(BeNil(), "Invalid argument. input.MachineDeployment can't be nil when calling WaitForMachineDeploymentNodesToExist")

By("waiting for the workload nodes to exist")
By("Waiting for the workload nodes to exist")
Eventually(func() (int, error) {
selectorMap, err := metav1.LabelSelectorAsMap(&input.MachineDeployment.Spec.Selector)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions test/framework/machines.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type WaitForClusterMachineNodeRefsInput struct {

// WaitForClusterMachineNodesRefs waits until all nodes associated with a machine deployment exist.
func WaitForClusterMachineNodeRefs(ctx context.Context, input WaitForClusterMachineNodeRefsInput, intervals ...interface{}) {
By("waiting for the machines' nodes to exist")
By("Waiting for the machines' nodes to exist")
machines := &clusterv1.MachineList{}

Expect(input.GetLister.List(ctx, machines, byClusterOptions(input.Cluster.Name, input.Cluster.Namespace)...)).To(Succeed(), "Failed to get Cluster machines %s/%s", input.Cluster.Namespace, input.Cluster.Name)
Expand All @@ -61,7 +61,7 @@ type WaitForClusterMachinesReadyInput struct {
}

func WaitForClusterMachinesReady(ctx context.Context, input WaitForClusterMachinesReadyInput, intervals ...interface{}) {
By("waiting for the machines' nodes to be ready")
By("Waiting for the machines' nodes to be ready")
machines := &clusterv1.MachineList{}

Expect(input.GetLister.List(ctx, machines, byClusterOptions(input.Cluster.Name, input.Cluster.Namespace)...)).To(Succeed(), "Failed to get Cluster machines %s/%s", input.Cluster.Namespace, input.Cluster.Name)
Expand Down
2 changes: 0 additions & 2 deletions test/framework/pod_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"context"
"strings"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"

"github.com/pkg/errors"
Expand Down Expand Up @@ -55,7 +54,6 @@ func WaitForPodListCondition(ctx context.Context, input WaitForPodListConditionI
}
return true, nil
}, intervals...).Should(BeTrue())
By("pod condition satisfied")
}

// EtcdImageTagCondition returns a podListCondition that ensures the pod image
Expand Down
2 changes: 1 addition & 1 deletion test/infrastructure/docker/docker/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ func (m *Machine) ExecBootstrap(ctx context.Context, data string) error {
err := cmd.Run(ctx)
if err != nil {
m.log.Info("Failed running command", "command", command, "stdout", outStd.String(), "stderr", outErr.String(), "bootstrap data", data)
return errors.Wrap(err, "failed to run cloud conifg")
return errors.Wrap(errors.WithStack(err), "failed to run cloud config")
}
}

Expand Down

0 comments on commit 90f6e46

Please sign in to comment.