@@ -35,104 +35,98 @@ func testRenderManifest(t *testing.T, filename string, config *OperatorConfig, e
35
35
36
36
func TestClusterManifest (t * testing.T ) {
37
37
config := OperatorConfig {
38
- VpcName : "TestClusterManifest-VpcName " ,
39
- SshKey : "TestClusterManifest-SshKey " ,
40
- ClusterName : "TestClusterManifest-ClusterName " ,
41
- ClusterDomain : "TestClusterManifest.ClusterDomain" , // TODO(frobware) - currently not a template value
42
- Region : "TestClusterManifest-Region " ,
43
- Image : "TestClusterManifest-Image " ,
38
+ ClusterName : "TestClusterManifest-ClusterName " ,
39
+ ClusterID : "TestClusterManifest-ClusterID " ,
40
+ Region : "TestClusterManifest-Region " ,
41
+ AvailabilityZone : "TestClusterManifest-AvailabilityZone" ,
42
+ Image : "TestClusterManifest-Image " ,
43
+ Replicas : "TestClusterManifest-Replicas " ,
44
44
}
45
45
46
46
testRenderManifest (t , "../../machines/cluster.yaml" , & config , `
47
+ ---
47
48
apiVersion: "cluster.k8s.io/v1alpha1"
48
49
kind: Cluster
49
50
metadata:
50
- name: test
51
- namespace: test
51
+ name: TestClusterManifest-ClusterName
52
+ namespace: default
52
53
spec:
53
54
clusterNetwork:
54
55
services:
55
56
cidrBlocks:
56
- - "10.0.0.1/24"
57
+ - "10.0.0.1/24"
57
58
pods:
58
59
cidrBlocks:
59
- - "10.0.0.2/24"
60
- serviceDomain: example.com
61
- providerConfig:
62
- value:
63
- apiVersion: awsproviderconfig/v1alpha1
64
- kind: AWSClusterProviderConfig
65
- clusterId: TestClusterManifest-VpcName
66
- clusterVersionRef:
67
- namespace: test
68
- name: test
69
- hardware:
70
- aws:
71
- region: TestClusterManifest-Region
72
- keyPairName: TestClusterManifest-SshKey
73
- defaultHardwareSpec:
74
- aws:
75
- instanceType: m4.large
76
- machineSets:
77
- - nodeType: Master
78
- size: 1
79
- - shortName: infra
80
- nodeType: Compute
81
- infra: true
82
- size: 1
83
- - shortName: compute
84
- nodeType: Compute
85
- size: 1` )
60
+ - "10.0.0.2/24"
61
+ serviceDomain: unused
62
+ ` )
86
63
}
87
64
88
65
func TestMachineSetManifest (t * testing.T ) {
89
66
config := OperatorConfig {
90
- VpcName : "TestMachineSetManifest-VpcName " ,
91
- SshKey : "TestMachineSetManifest-SshKey " ,
92
- ClusterName : "TestMachineSetManifest-ClusterName " ,
93
- ClusterDomain : "TestMachineSetManifest.ClusterDomain" , // TODO(frobware) - currently not a template value
94
- Region : "TestMachineSetManifest-Region " ,
95
- Image : "TestMachineSetManifest-Image " ,
67
+ ClusterName : "TestClusterManifest-ClusterName " ,
68
+ ClusterID : "TestClusterManifest-ClusterID " ,
69
+ Region : "TestClusterManifest-Region " ,
70
+ AvailabilityZone : "TestClusterManifest-AvailabilityZone" ,
71
+ Image : "TestClusterManifest-Image " ,
72
+ Replicas : "TestClusterManifest-Replicas " ,
96
73
}
97
74
98
75
testRenderManifest (t , "../../machines/machine-set.yaml" , & config , `
76
+ ---
99
77
apiVersion: cluster.k8s.io/v1alpha1
100
78
kind: MachineSet
101
79
metadata:
102
80
name: worker
103
- namespace: test
81
+ namespace: default
104
82
labels:
105
- machineapioperator.openshift.io/cluster: test
83
+ sigs.k8s.io/cluster-api-cluster: TestClusterManifest-ClusterName
84
+ sigs.k8s.io/cluster-api-machine-role: worker
85
+ sigs.k8s.io/cluster-api-machine-type: worker
106
86
spec:
107
- replicas: 3
87
+ replicas: TestClusterManifest-Replicas
108
88
selector:
109
89
matchLabels:
110
- machineapioperator.openshift .io/machineset: worker
111
- machineapioperator.openshift .io/cluster: test
90
+ sigs.k8s .io/cluster-api- machineset: worker
91
+ sigs.k8s .io/cluster-api-cluster: TestClusterManifest-ClusterName
112
92
template:
113
93
metadata:
114
94
labels:
115
- machineapioperator.openshift.io/machineset: worker
116
- machineapioperator.openshift.io/cluster: test
95
+ sigs.k8s.io/cluster-api-machineset: worker
96
+ sigs.k8s.io/cluster-api-cluster: TestClusterManifest-ClusterName
97
+ sigs.k8s.io/cluster-api-machine-role: worker
98
+ sigs.k8s.io/cluster-api-machine-type: worker
117
99
spec:
118
100
providerConfig:
119
101
value:
120
- apiVersion: awsproviderconfig /v1alpha1
102
+ apiVersion: aws.cluster.k8s.io /v1alpha1
121
103
kind: AWSMachineProviderConfig
122
- clusterId: TestMachineSetManifest-VpcName
123
- clusterHardware:
124
- aws:
125
- keyPairName: TestMachineSetManifest-SshKey
126
- region: TestMachineSetManifest-Region
127
- hardware:
128
- aws:
129
- instanceType: m4.large
130
- infra: false
131
- vmImage:
132
- awsImage: TestMachineSetManifest-Image
104
+ ami:
105
+ id: TestClusterManifest-Image
106
+ instanceType: m4.large
107
+ placement:
108
+ region: TestClusterManifest-Region
109
+ availabilityZone: TestClusterManifest-AvailabilityZone
110
+ subnet:
111
+ filters:
112
+ - name: "tag:Name"
113
+ values:
114
+ - TestClusterManifest-ClusterName-worker-TestClusterManifest-AvailabilityZone
115
+ publicIp: true
116
+ iamInstanceProfile:
117
+ id: TestClusterManifest-ClusterName-master-profile
118
+ keyName: tectonic
119
+ tags:
120
+ - name: tectonicClusterID
121
+ value: TestClusterManifest-ClusterID
122
+ securityGroups:
123
+ - filters:
124
+ - name: "tag:Name"
125
+ values:
126
+ - TestClusterManifest-ClusterName_worker_sg
127
+ userDataSecret:
128
+ name: ignition-worker
133
129
versions:
134
- kubelet: 0.0.0
135
- controlPlane: 0.0.0
136
- roles:
137
- - Master` )
130
+ kubelet: ""
131
+ controlPlane: ""` )
138
132
}
0 commit comments