Skip to content

Commit 9f1a794

Browse files
committed
Fix e2e tests
1 parent 78de586 commit 9f1a794

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

cmd/clusterctl/client/tree/discovery.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ package tree
1919
import (
2020
"context"
2121

22-
"github.com/pkg/errors"
2322
corev1 "k8s.io/api/core/v1"
2423
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2524
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
@@ -90,10 +89,9 @@ func Discovery(ctx context.Context, c client.Client, namespace, name string, opt
9089

9190
// Adds cluster infra
9291
clusterInfra, err := external.GetObjectFromContractVersionedRef(ctx, c, cluster.Spec.InfrastructureRef, cluster.Namespace)
93-
if err != nil {
94-
return nil, errors.Wrap(err, "get InfraCluster reference from Cluster")
92+
if err == nil {
93+
tree.Add(cluster, clusterInfra, ObjectMetaName("ClusterInfrastructure"))
9594
}
96-
tree.Add(cluster, clusterInfra, ObjectMetaName("ClusterInfrastructure"))
9795

9896
if options.ShowClusterResourceSets {
9997
addClusterResourceSetsToObjectTree(ctx, c, cluster, tree)

test/e2e/data/infrastructure-docker/main/clusterclass-quick-start.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,9 +291,11 @@ spec:
291291
controlPlane: true
292292
jsonPatches:
293293
- op: add
294-
path: /spec/template/spec/rollout/strategy/rollingUpdate/maxSurge
294+
path: /spec/template/spec/rollout/strategy
295295
valueFrom:
296-
template: "{{ .kubeadmControlPlaneMaxSurge }}"
296+
template: |
297+
rollingUpdate:
298+
maxSurge: {{ .kubeadmControlPlaneMaxSurge }}"
297299
- name: controlPlaneTaint
298300
enabledIf: "{{ not .controlPlaneTaint }}"
299301
definitions:

test/framework/alltypes_helpers.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,15 @@ func DumpAllResources(ctx context.Context, input DumpAllResourcesInput) {
134134
Expect(input.Namespace).NotTo(BeEmpty(), "input.Namespace is required for DumpAllResources")
135135
Expect(input.LogPath).NotTo(BeEmpty(), "input.LogPath is required for DumpAllResources")
136136

137+
resources := GetCAPIResources(ctx, GetCAPIResourcesInput{
138+
Lister: input.Lister,
139+
Namespace: input.Namespace,
140+
IncludeTypes: input.IncludeTypes,
141+
})
142+
137143
// Describe all clusters (this is a sort of summary of all the resources being bumped).
144+
// Note: intentionally calling GetCAPIResources first as DescribeAllCluster is more likely to fail
145+
// and then we wouldn't have the CAPI resources available.
138146
DescribeAllCluster(ctx, DescribeAllClusterInput{
139147
Lister: input.Lister,
140148
KubeConfigPath: input.KubeConfigPath,
@@ -143,12 +151,6 @@ func DumpAllResources(ctx context.Context, input DumpAllResourcesInput) {
143151
Namespace: input.Namespace,
144152
})
145153

146-
resources := GetCAPIResources(ctx, GetCAPIResourcesInput{
147-
Lister: input.Lister,
148-
Namespace: input.Namespace,
149-
IncludeTypes: input.IncludeTypes,
150-
})
151-
152154
for i := range resources {
153155
r := resources[i]
154156
dumpObject(r, input.LogPath)

0 commit comments

Comments
 (0)