@@ -25,10 +25,76 @@ import (
25
25
26
26
. "github.com/onsi/ginkgo/v2"
27
27
. "github.com/onsi/gomega"
28
+ appsv1 "k8s.io/api/apps/v1"
29
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
30
+ "k8s.io/utils/ptr"
31
+ operatorv1 "sigs.k8s.io/cluster-api-operator/api/v1alpha2"
28
32
. "sigs.k8s.io/cluster-api-operator/test/framework"
33
+ "sigs.k8s.io/cluster-api/test/framework"
29
34
)
30
35
31
36
var _ = Describe ("Create a proper set of manifests when using helm charts" , func () {
37
+ It ("should deploy a quick-start cluster-api-operator chart" , func () {
38
+ _ , err := fullHelmChart .Run (nil )
39
+ Expect (err ).ToNot (HaveOccurred ())
40
+
41
+ clusterProxy := helmClusterProxy .GetClient ()
42
+ coreProvider := & operatorv1.CoreProvider {
43
+ ObjectMeta : metav1.ObjectMeta {
44
+ Name : coreProviderName ,
45
+ },
46
+ }
47
+ Expect (clusterProxy .Create (ctx , coreProvider )).To (Succeed ())
48
+
49
+ By ("Waiting for the core provider deployment to be ready" )
50
+ framework .WaitForDeploymentsAvailable (ctx , framework.WaitForDeploymentsAvailableInput {
51
+ Getter : clusterProxy ,
52
+ Deployment : & appsv1.Deployment {ObjectMeta : metav1.ObjectMeta {Name : coreProviderDeploymentName }},
53
+ }, e2eConfig .GetIntervals (helmClusterProxy .GetName (), "wait-controllers" )... )
54
+
55
+ By ("Waiting for core provider to be ready" )
56
+ WaitFor (ctx , For (coreProvider ).In (clusterProxy ).ToSatisfy (
57
+ HaveStatusCondition (& coreProvider .Status .Conditions , operatorv1 .ProviderInstalledCondition ),
58
+ ), e2eConfig .GetIntervals (helmClusterProxy .GetName (), "wait-controllers" )... )
59
+
60
+ By ("Waiting for status.IntalledVersion to be set" )
61
+ WaitFor (ctx , For (coreProvider ).In (clusterProxy ).ToSatisfy (func () bool {
62
+ return ptr .Equal (coreProvider .Status .InstalledVersion , ptr .To (coreProvider .Spec .Version ))
63
+ }), e2eConfig .GetIntervals (helmClusterProxy .GetName (), "wait-controllers" )... )
64
+
65
+ bootstrapProvider := & operatorv1.BootstrapProvider {ObjectMeta : metav1.ObjectMeta {
66
+ Name : bootstrapProviderName ,
67
+ }}
68
+ deployment := & appsv1.Deployment {ObjectMeta : metav1.ObjectMeta {
69
+ Name : bootstrapProviderDeploymentName ,
70
+ }}
71
+
72
+ Expect (clusterProxy .Create (ctx , bootstrapProvider )).To (Succeed ())
73
+
74
+ By ("Waiting for the bootstrap provider deployment to be ready" )
75
+ framework .WaitForDeploymentsAvailable (ctx , framework.WaitForDeploymentsAvailableInput {
76
+ Getter : clusterProxy ,
77
+ Deployment : deployment ,
78
+ }, e2eConfig .GetIntervals (helmClusterProxy .GetName (), "wait-controllers" )... )
79
+
80
+ By ("Waiting for bootstrap provider to be ready" )
81
+ WaitFor (ctx , For (bootstrapProvider ).In (clusterProxy ).ToSatisfy (
82
+ HaveStatusCondition (& bootstrapProvider .Status .Conditions , operatorv1 .ProviderInstalledCondition )),
83
+ e2eConfig .GetIntervals (helmClusterProxy .GetName (), "wait-controllers" )... )
84
+
85
+ By ("Waiting for status.IntalledVersion to be set" )
86
+ WaitFor (ctx , For (bootstrapProvider ).In (clusterProxy ).ToSatisfy (func () bool {
87
+ return ptr .Equal (bootstrapProvider .Status .InstalledVersion , & bootstrapProvider .Spec .Version )
88
+ }), e2eConfig .GetIntervals (helmClusterProxy .GetName (), "wait-controllers" )... )
89
+ Expect (clusterProxy .Delete (ctx , bootstrapProvider )).To (Succeed ())
90
+
91
+ By ("Waiting for the bootstrap provider deployment to be deleted" )
92
+ WaitForDelete (ctx , For (deployment ).In (clusterProxy ),
93
+ e2eConfig .GetIntervals (helmClusterProxy .GetName (), "wait-controllers" )... )
94
+
95
+ Expect (clusterProxy .Delete (ctx , coreProvider )).To (Succeed ())
96
+ })
97
+
32
98
It ("should deploy default manifest set for quick-start process" , func () {
33
99
fullRun := & HelmChart {
34
100
BinaryPath : helmChart .BinaryPath ,
0 commit comments