Skip to content

Commit bea4f61

Browse files
committed
Bump the API to v1alpha2 because of the breakage.
1 parent d36def5 commit bea4f61

12 files changed

+62
-61
lines changed

api/v1alpha1/clusterbootstrapconfig_types.go renamed to api/v1alpha2/clusterbootstrapconfig_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
package v1alpha1
17+
package v1alpha2
1818

1919
import (
2020
"time"

api/v1alpha1/clusterbootstrapconfig_types_test.go renamed to api/v1alpha2/clusterbootstrapconfig_types_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
package v1alpha1
17+
package v1alpha2
1818

1919
import (
2020
"testing"

api/v1alpha1/groupversion_info.go renamed to api/v1alpha2/groupversion_info.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
// Package v1alpha1 contains API Schema definitions for the capi v1alpha1 API group
17+
// Package v1alpha2 contains API Schema definitions for the capi v1alpha2 API group
1818
// +kubebuilder:object:generate=true
1919
// +groupName=capi.weave.works
20-
package v1alpha1
20+
package v1alpha2
2121

2222
import (
2323
"k8s.io/apimachinery/pkg/runtime/schema"
@@ -26,7 +26,7 @@ import (
2626

2727
var (
2828
// GroupVersion is group version used to register these objects
29-
GroupVersion = schema.GroupVersion{Group: "capi.weave.works", Version: "v1alpha1"}
29+
GroupVersion = schema.GroupVersion{Group: "capi.weave.works", Version: "v1alpha2"}
3030

3131
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
3232
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

api/v1alpha1/zz_generated.deepcopy.go renamed to api/v1alpha2/zz_generated.deepcopy.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/capi.weave.works_clusterbootstrapconfigs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ spec:
1515
singular: clusterbootstrapconfig
1616
scope: Namespaced
1717
versions:
18-
- name: v1alpha1
18+
- name: v1alpha2
1919
schema:
2020
openAPIV3Schema:
2121
description: ClusterBootstrapConfig is the Schema for the clusterbootstrapconfigs

controllers/bootstrap.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ import (
1212
"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
1313

1414
"github.com/go-logr/logr"
15-
capiv1alpha1 "github.com/weaveworks/cluster-bootstrap-controller/api/v1alpha1"
15+
capiv1alpha2 "github.com/weaveworks/cluster-bootstrap-controller/api/v1alpha2"
1616
)
1717

1818
// bootstrapCluster applies the jobs from a ClusterBootstrapConfig to a cluster.
19-
func bootstrapClusterWithConfig(ctx context.Context, logger logr.Logger, c client.Client, cl *gitopsv1alpha1.GitopsCluster, bc *capiv1alpha1.ClusterBootstrapConfig) error {
19+
func bootstrapClusterWithConfig(ctx context.Context, logger logr.Logger, c client.Client, cl *gitopsv1alpha1.GitopsCluster, bc *capiv1alpha2.ClusterBootstrapConfig) error {
2020
job, err := renderTemplates(cl, jobFromTemplate(cl, bc.Spec.Template))
2121
if err != nil {
2222
return fmt.Errorf("failed to render job from template: %w", err)
@@ -31,7 +31,7 @@ func bootstrapClusterWithConfig(ctx context.Context, logger logr.Logger, c clien
3131
return nil
3232
}
3333

34-
func jobFromTemplate(cl *gitopsv1alpha1.GitopsCluster, jt capiv1alpha1.JobTemplate) *batchv1.Job {
34+
func jobFromTemplate(cl *gitopsv1alpha1.GitopsCluster, jt capiv1alpha2.JobTemplate) *batchv1.Job {
3535
return &batchv1.Job{
3636
ObjectMeta: metav1.ObjectMeta{
3737
GenerateName: jt.GenerateName,

controllers/bootstrap_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
"sigs.k8s.io/controller-runtime/pkg/client"
1818
"sigs.k8s.io/controller-runtime/pkg/client/fake"
1919

20-
capiv1alpha1 "github.com/weaveworks/cluster-bootstrap-controller/api/v1alpha1"
20+
capiv1alpha2 "github.com/weaveworks/cluster-bootstrap-controller/api/v1alpha2"
2121
"github.com/weaveworks/cluster-bootstrap-controller/test"
2222
)
2323

@@ -121,7 +121,7 @@ func makeTestPodSpecWithVolumes(volumes ...corev1.Volume) corev1.PodSpec {
121121
}
122122

123123
func Test_bootstrapClusterWithConfig_sets_job_ttl(t *testing.T) {
124-
bc := makeTestClusterBootstrapConfig(func(cfg *capiv1alpha1.ClusterBootstrapConfig) {
124+
bc := makeTestClusterBootstrapConfig(func(cfg *capiv1alpha2.ClusterBootstrapConfig) {
125125
cfg.Spec.Template.TTLSecondsAfterFinished = ptrutils.Int32Ptr(66)
126126
})
127127
cl := makeTestCluster()
@@ -155,19 +155,19 @@ func makeTestCluster(opts ...func(*gitopsv1alpha1.GitopsCluster)) *gitopsv1alpha
155155
return c
156156
}
157157

158-
func makeTestClusterBootstrapConfig(opts ...func(*capiv1alpha1.ClusterBootstrapConfig)) *capiv1alpha1.ClusterBootstrapConfig {
159-
bc := &capiv1alpha1.ClusterBootstrapConfig{
158+
func makeTestClusterBootstrapConfig(opts ...func(*capiv1alpha2.ClusterBootstrapConfig)) *capiv1alpha2.ClusterBootstrapConfig {
159+
bc := &capiv1alpha2.ClusterBootstrapConfig{
160160
ObjectMeta: metav1.ObjectMeta{
161161
Name: testConfigName,
162162
Namespace: testNamespace,
163163
},
164-
Spec: capiv1alpha1.ClusterBootstrapConfigSpec{
164+
Spec: capiv1alpha2.ClusterBootstrapConfigSpec{
165165
ClusterSelector: metav1.LabelSelector{
166166
MatchLabels: map[string]string{
167167
"testing": "label",
168168
},
169169
},
170-
Template: capiv1alpha1.JobTemplate{
170+
Template: capiv1alpha2.JobTemplate{
171171
GenerateName: "setup-something-",
172172
BackoffLimit: ptrutils.Int32Ptr(13),
173173
Spec: corev1.PodSpec{
@@ -208,7 +208,7 @@ func makeTestClientAndScheme(t *testing.T, objs ...runtime.Object) (*runtime.Sch
208208
t.Helper()
209209
s := runtime.NewScheme()
210210
test.AssertNoError(t, clientgoscheme.AddToScheme(s))
211-
test.AssertNoError(t, capiv1alpha1.AddToScheme(s))
211+
test.AssertNoError(t, capiv1alpha2.AddToScheme(s))
212212
test.AssertNoError(t, batchv1.AddToScheme(s))
213213
test.AssertNoError(t, gitopsv1alpha1.AddToScheme(s))
214214
return s, fake.NewClientBuilder().WithScheme(s).WithRuntimeObjects(objs...).Build()

controllers/clusterbootstrapconfig_controller.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import (
3939
"sigs.k8s.io/controller-runtime/pkg/log"
4040
"sigs.k8s.io/controller-runtime/pkg/source"
4141

42-
capiv1alpha1 "github.com/weaveworks/cluster-bootstrap-controller/api/v1alpha1"
42+
capiv1alpha2 "github.com/weaveworks/cluster-bootstrap-controller/api/v1alpha2"
4343
)
4444

4545
// ClusterBootstrapConfigReconciler reconciles a ClusterBootstrapConfig object
@@ -74,7 +74,7 @@ func NewClusterBootstrapConfigReconciler(c client.Client, s *runtime.Scheme) *Cl
7474
// - https://pkg.go.dev/sigs.k8s.io/[email protected]/pkg/reconcile
7575
func (r *ClusterBootstrapConfigReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
7676
logger := log.FromContext(ctx)
77-
var clusterBootstrapConfig capiv1alpha1.ClusterBootstrapConfig
77+
var clusterBootstrapConfig capiv1alpha2.ClusterBootstrapConfig
7878
if err := r.Client.Get(ctx, req.NamespacedName, &clusterBootstrapConfig); err != nil {
7979
return ctrl.Result{}, client.IgnoreNotFound(err)
8080
}
@@ -116,8 +116,8 @@ func (r *ClusterBootstrapConfigReconciler) Reconcile(ctx context.Context, req ct
116116
mergePatch, err := json.Marshal(map[string]interface{}{
117117
"metadata": map[string]interface{}{
118118
"annotations": map[string]interface{}{
119-
capiv1alpha1.BootstrappedAnnotation: "yes",
120-
capiv1alpha1.BootstrapConfigsAnnotation: appendClusterConfigToBootstrappedList(clusterBootstrapConfig, cluster),
119+
capiv1alpha2.BootstrappedAnnotation: "yes",
120+
capiv1alpha2.BootstrapConfigsAnnotation: appendClusterConfigToBootstrappedList(clusterBootstrapConfig, cluster),
121121
},
122122
},
123123
})
@@ -131,8 +131,8 @@ func (r *ClusterBootstrapConfigReconciler) Reconcile(ctx context.Context, req ct
131131
return ctrl.Result{}, nil
132132
}
133133

134-
func appendClusterConfigToBootstrappedList(config capiv1alpha1.ClusterBootstrapConfig, cluster *gitopsv1alpha1.GitopsCluster) string {
135-
current := cluster.GetAnnotations()[capiv1alpha1.BootstrapConfigsAnnotation]
134+
func appendClusterConfigToBootstrappedList(config capiv1alpha2.ClusterBootstrapConfig, cluster *gitopsv1alpha1.GitopsCluster) string {
135+
current := cluster.GetAnnotations()[capiv1alpha2.BootstrapConfigsAnnotation]
136136
set := sets.NewString(strings.Split(current, ",")...)
137137
id := fmt.Sprintf("%s/%s", config.GetNamespace(), config.GetName())
138138
set.Insert(id)
@@ -142,15 +142,15 @@ func appendClusterConfigToBootstrappedList(config capiv1alpha1.ClusterBootstrapC
142142
// SetupWithManager sets up the controller with the Manager.
143143
func (r *ClusterBootstrapConfigReconciler) SetupWithManager(mgr ctrl.Manager) error {
144144
return ctrl.NewControllerManagedBy(mgr).
145-
For(&capiv1alpha1.ClusterBootstrapConfig{}).
145+
For(&capiv1alpha2.ClusterBootstrapConfig{}).
146146
Watches(
147147
&source.Kind{Type: &gitopsv1alpha1.GitopsCluster{}},
148148
handler.EnqueueRequestsFromMapFunc(r.clusterToClusterBootstrapConfig),
149149
).
150150
Complete(r)
151151
}
152152

153-
func (r *ClusterBootstrapConfigReconciler) getClustersBySelector(ctx context.Context, ns string, config capiv1alpha1.ClusterBootstrapConfig) ([]*gitopsv1alpha1.GitopsCluster, error) {
153+
func (r *ClusterBootstrapConfigReconciler) getClustersBySelector(ctx context.Context, ns string, config capiv1alpha2.ClusterBootstrapConfig) ([]*gitopsv1alpha1.GitopsCluster, error) {
154154
logger := ctrl.LoggerFrom(ctx)
155155
selector, err := metav1.LabelSelectorAsSelector(&config.Spec.ClusterSelector)
156156
if err != nil {
@@ -182,7 +182,7 @@ func (r *ClusterBootstrapConfigReconciler) getClustersBySelector(ctx context.Con
182182
}
183183
}
184184

185-
if metav1.HasAnnotation(cluster.ObjectMeta, capiv1alpha1.BootstrappedAnnotation) {
185+
if metav1.HasAnnotation(cluster.ObjectMeta, capiv1alpha2.BootstrappedAnnotation) {
186186
if alreadyBootstrappedWithConfig(cluster, config) {
187187
continue
188188
}
@@ -194,8 +194,8 @@ func (r *ClusterBootstrapConfigReconciler) getClustersBySelector(ctx context.Con
194194
return clusters, nil
195195
}
196196

197-
func alreadyBootstrappedWithConfig(cluster *gitopsv1alpha1.GitopsCluster, config capiv1alpha1.ClusterBootstrapConfig) bool {
198-
current := cluster.GetAnnotations()[capiv1alpha1.BootstrapConfigsAnnotation]
197+
func alreadyBootstrappedWithConfig(cluster *gitopsv1alpha1.GitopsCluster, config capiv1alpha2.ClusterBootstrapConfig) bool {
198+
current := cluster.GetAnnotations()[capiv1alpha2.BootstrapConfigsAnnotation]
199199
set := sets.NewString(strings.Split(current, ",")...)
200200
id := fmt.Sprintf("%s/%s", config.GetNamespace(), config.GetName())
201201
return set.Has(id)
@@ -210,7 +210,7 @@ func (r *ClusterBootstrapConfigReconciler) clusterToClusterBootstrapConfig(o cli
210210
panic(fmt.Sprintf("Expected a Cluster but got a %T", o))
211211
}
212212

213-
resourceList := capiv1alpha1.ClusterBootstrapConfigList{}
213+
resourceList := capiv1alpha2.ClusterBootstrapConfigList{}
214214
if err := r.Client.List(context.Background(), &resourceList, client.InNamespace(cluster.Namespace)); err != nil {
215215
return nil
216216
}

controllers/clusterbootstrapconfig_controller_test.go

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,16 @@ import (
1818
ctrl "sigs.k8s.io/controller-runtime"
1919
"sigs.k8s.io/controller-runtime/pkg/client"
2020

21-
capiv1alpha1 "github.com/weaveworks/cluster-bootstrap-controller/api/v1alpha1"
21+
capialpha2 "github.com/weaveworks/cluster-bootstrap-controller/api/v1alpha2"
22+
capiv1alpha2 "github.com/weaveworks/cluster-bootstrap-controller/api/v1alpha2"
2223
"github.com/weaveworks/cluster-bootstrap-controller/test"
2324
gitopsv1alpha1 "github.com/weaveworks/cluster-controller/api/v1alpha1"
2425
)
2526

2627
const testWaitDuration = time.Second * 55
2728

2829
func TestReconcile_when_cluster_not_ready(t *testing.T) {
29-
bc := makeTestClusterBootstrapConfig(func(c *capiv1alpha1.ClusterBootstrapConfig) {
30+
bc := makeTestClusterBootstrapConfig(func(c *capiv1alpha2.ClusterBootstrapConfig) {
3031
c.Spec.RequireClusterReady = true
3132
c.Spec.ClusterReadinessBackoff = &metav1.Duration{Duration: testWaitDuration}
3233

@@ -66,7 +67,7 @@ func TestReconcile_when_cluster_not_ready(t *testing.T) {
6667
}
6768

6869
func TestReconcile_when_cluster_secret_not_available(t *testing.T) {
69-
bc := makeTestClusterBootstrapConfig(func(c *capiv1alpha1.ClusterBootstrapConfig) {
70+
bc := makeTestClusterBootstrapConfig(func(c *capiv1alpha2.ClusterBootstrapConfig) {
7071
c.Spec.RequireClusterReady = true
7172
})
7273
cl := makeTestCluster(func(c *gitopsv1alpha1.GitopsCluster) {
@@ -96,7 +97,7 @@ func TestReconcile_when_cluster_secret_not_available(t *testing.T) {
9697
}
9798

9899
func TestReconcile_when_cluster_ready(t *testing.T) {
99-
bc := makeTestClusterBootstrapConfig(func(c *capiv1alpha1.ClusterBootstrapConfig) {
100+
bc := makeTestClusterBootstrapConfig(func(c *capiv1alpha2.ClusterBootstrapConfig) {
100101
c.Spec.RequireClusterReady = true
101102
})
102103
readyNode := makeNode(map[string]string{
@@ -139,7 +140,7 @@ func TestReconcile_when_cluster_ready(t *testing.T) {
139140
}
140141

141142
func TestReconcile_when_cluster_ready_bootstrapped_with_same_config(t *testing.T) {
142-
bc := makeTestClusterBootstrapConfig(func(c *capiv1alpha1.ClusterBootstrapConfig) {
143+
bc := makeTestClusterBootstrapConfig(func(c *capiv1alpha2.ClusterBootstrapConfig) {
143144
c.Spec.RequireClusterReady = true
144145
})
145146
readyNode := makeNode(map[string]string{
@@ -151,8 +152,8 @@ func TestReconcile_when_cluster_ready_bootstrapped_with_same_config(t *testing.T
151152
c.ObjectMeta.Labels = bc.Spec.ClusterSelector.MatchLabels
152153
c.Status.Conditions = append(c.Status.Conditions, makeReadyCondition())
153154
c.ObjectMeta.Annotations = map[string]string{
154-
capiv1alpha1.BootstrappedAnnotation: "true",
155-
capiv1alpha1.BootstrapConfigsAnnotation: fmt.Sprintf("%s/%s", bc.Namespace, bc.Name),
155+
capiv1alpha2.BootstrappedAnnotation: "true",
156+
capiv1alpha2.BootstrapConfigsAnnotation: fmt.Sprintf("%s/%s", bc.Namespace, bc.Name),
156157
}
157158
})
158159
secret := makeTestSecret(types.NamespacedName{
@@ -186,7 +187,7 @@ func TestReconcile_when_cluster_ready_bootstrapped_with_same_config(t *testing.T
186187
}
187188

188189
func TestReconcile_when_cluster_ready_bootstrapped_with_different_config(t *testing.T) {
189-
bc := makeTestClusterBootstrapConfig(func(c *capiv1alpha1.ClusterBootstrapConfig) {
190+
bc := makeTestClusterBootstrapConfig(func(c *capiv1alpha2.ClusterBootstrapConfig) {
190191
c.Spec.RequireClusterReady = true
191192
})
192193
readyNode := makeNode(map[string]string{
@@ -197,8 +198,8 @@ func TestReconcile_when_cluster_ready_bootstrapped_with_different_config(t *test
197198
cl := makeTestCluster(func(c *gitopsv1alpha1.GitopsCluster) {
198199
c.ObjectMeta.Labels = bc.Spec.ClusterSelector.MatchLabels
199200
c.ObjectMeta.Annotations = map[string]string{
200-
capiv1alpha1.BootstrappedAnnotation: "true",
201-
capiv1alpha1.BootstrapConfigsAnnotation: "unknown/unknown",
201+
capiv1alpha2.BootstrappedAnnotation: "true",
202+
capiv1alpha2.BootstrapConfigsAnnotation: "unknown/unknown",
202203
}
203204
c.Status.Conditions = append(c.Status.Conditions, makeReadyCondition())
204205
})
@@ -233,7 +234,7 @@ func TestReconcile_when_cluster_ready_bootstrapped_with_different_config(t *test
233234
}
234235

235236
func TestReconcile_when_cluster_provisioned(t *testing.T) {
236-
bc := makeTestClusterBootstrapConfig(func(c *capiv1alpha1.ClusterBootstrapConfig) {
237+
bc := makeTestClusterBootstrapConfig(func(c *capiv1alpha2.ClusterBootstrapConfig) {
237238
c.Spec.RequireClusterProvisioned = true
238239
})
239240
cl := makeTestCluster(func(c *gitopsv1alpha1.GitopsCluster) {
@@ -271,7 +272,7 @@ func TestReconcile_when_cluster_provisioned(t *testing.T) {
271272
}
272273

273274
func TestReconcile_when_cluster_not_provisioned(t *testing.T) {
274-
bc := makeTestClusterBootstrapConfig(func(c *capiv1alpha1.ClusterBootstrapConfig) {
275+
bc := makeTestClusterBootstrapConfig(func(c *capiv1alpha2.ClusterBootstrapConfig) {
275276
c.Spec.RequireClusterProvisioned = true
276277
})
277278
cl := makeTestCluster(func(c *gitopsv1alpha1.GitopsCluster) {
@@ -309,7 +310,7 @@ func TestReconcile_when_cluster_not_provisioned(t *testing.T) {
309310
}
310311

311312
func TestReconcile_when_cluster_no_matching_labels(t *testing.T) {
312-
bc := makeTestClusterBootstrapConfig(func(c *capiv1alpha1.ClusterBootstrapConfig) {
313+
bc := makeTestClusterBootstrapConfig(func(c *capiv1alpha2.ClusterBootstrapConfig) {
313314
c.Spec.RequireClusterReady = true
314315
})
315316
cl := makeTestCluster(func(c *gitopsv1alpha1.GitopsCluster) {
@@ -342,7 +343,7 @@ func TestReconcile_when_cluster_ready_bootstrapped_with_multiple_config(t *testi
342343
// Multiple configs can bootstrap the same cluster
343344
// If the reconciled cluster is in that list (anywhere) then we don't create
344345
// jobs.
345-
bc := makeTestClusterBootstrapConfig(func(c *capiv1alpha1.ClusterBootstrapConfig) {
346+
bc := makeTestClusterBootstrapConfig(func(c *capiv1alpha2.ClusterBootstrapConfig) {
346347
c.Spec.RequireClusterReady = true
347348
})
348349
readyNode := makeNode(map[string]string{
@@ -353,8 +354,8 @@ func TestReconcile_when_cluster_ready_bootstrapped_with_multiple_config(t *testi
353354
cl := makeTestCluster(func(c *gitopsv1alpha1.GitopsCluster) {
354355
c.ObjectMeta.Labels = bc.Spec.ClusterSelector.MatchLabels
355356
c.ObjectMeta.Annotations = map[string]string{
356-
capiv1alpha1.BootstrappedAnnotation: "true",
357-
capiv1alpha1.BootstrapConfigsAnnotation: fmt.Sprintf("%s,%s/%s", "unknown/unknown", bc.GetNamespace(), bc.GetName()),
357+
capialpha2.BootstrappedAnnotation: "true",
358+
capialpha2.BootstrapConfigsAnnotation: fmt.Sprintf("%s,%s/%s", "unknown/unknown", bc.GetNamespace(), bc.GetName()),
358359
}
359360
c.Status.Conditions = append(c.Status.Conditions, makeReadyCondition())
360361
})
@@ -391,7 +392,7 @@ func TestReconcile_when_cluster_ready_bootstrapped_with_multiple_config(t *testi
391392
func TestReconcile_when_empty_label_selector(t *testing.T) {
392393
// When the label selector is empty, we don't want any jobs created, rather
393394
// than a job for all clusters.
394-
bc := makeTestClusterBootstrapConfig(func(c *capiv1alpha1.ClusterBootstrapConfig) {
395+
bc := makeTestClusterBootstrapConfig(func(c *capialpha2.ClusterBootstrapConfig) {
395396
c.Spec.RequireClusterReady = true
396397
c.Spec.ClusterSelector = metav1.LabelSelector{
397398
MatchLabels: map[string]string{},
@@ -425,7 +426,7 @@ func TestReconcile_when_empty_label_selector(t *testing.T) {
425426
}
426427

427428
func TestReconcile_when_cluster_ready_and_old_label(t *testing.T) {
428-
bc := makeTestClusterBootstrapConfig(func(c *capiv1alpha1.ClusterBootstrapConfig) {
429+
bc := makeTestClusterBootstrapConfig(func(c *capialpha2.ClusterBootstrapConfig) {
429430
c.Spec.RequireClusterReady = true
430431
})
431432
readyNode := makeNode(map[string]string{

controllers/templating_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
batchv1 "k8s.io/api/batch/v1"
88
corev1 "k8s.io/api/core/v1"
99

10-
capiv1alpha1 "github.com/weaveworks/cluster-bootstrap-controller/api/v1alpha1"
10+
capialpha2 "github.com/weaveworks/cluster-bootstrap-controller/api/v1alpha2"
1111
"github.com/weaveworks/cluster-bootstrap-controller/test"
1212

1313
"github.com/google/go-cmp/cmp"
@@ -22,7 +22,7 @@ func Test_renderTemplates(t *testing.T) {
2222
)
2323
renderTests := []struct {
2424
name string
25-
job capiv1alpha1.JobTemplate
25+
job capialpha2.JobTemplate
2626
want *batchv1.Job
2727
}{
2828
{"no template values", makeTestJobTemplate("testing"), jobFromTemplate(testCluster, makeTestJobTemplate("testing"))},
@@ -53,7 +53,7 @@ func Test_renderTemplates_with_errors(t *testing.T) {
5353
)
5454
renderTests := []struct {
5555
name string
56-
job capiv1alpha1.JobTemplate
56+
job capialpha2.JobTemplate
5757
wantErr string
5858
}{
5959
{"invalid syntax", makeTestJobTemplate("{{ abels}"), "failed to parse template: template: job"},
@@ -71,8 +71,8 @@ func Test_renderTemplates_with_errors(t *testing.T) {
7171
}
7272
}
7373

74-
func makeTestJobTemplate(s string) capiv1alpha1.JobTemplate {
75-
return capiv1alpha1.JobTemplate{
74+
func makeTestJobTemplate(s string) capialpha2.JobTemplate {
75+
return capialpha2.JobTemplate{
7676
GenerateName: "setup-something",
7777
Spec: corev1.PodSpec{
7878
Containers: []corev1.Container{

0 commit comments

Comments
 (0)