@@ -123,81 +123,6 @@ func TestLoadInitConfigurationFromFile(t *testing.T) {
123
123
}
124
124
}
125
125
126
- /*
127
- func TestInitConfigurationMarshallingFromFile(t *testing.T) {
128
- controlPlaneV1beta1YAMLAbstracted := controlPlaneV1beta1YAML
129
- controlPlaneInternalYAMLAbstracted := controlPlaneInternalYAML
130
- controlPlaneDefaultedYAMLAbstracted := controlPlaneDefaultedYAML
131
- if runtime.GOOS != "linux" {
132
- controlPlaneV1beta1YAMLAbstracted = controlPlaneV1beta1YAMLNonLinux
133
- controlPlaneInternalYAMLAbstracted = controlPlaneInternalYAMLNonLinux
134
- controlPlaneDefaultedYAMLAbstracted = controlPlaneDefaultedYAMLNonLinux
135
- }
136
-
137
- var tests = []struct {
138
- name, in, out string
139
- groupVersion schema.GroupVersion
140
- expectedErr bool
141
- }{
142
- // These tests are reading one file, loading it using LoadInitConfigurationFromFile that all of kubeadm is using for unmarshal of our API types,
143
- // and then marshals the internal object to the expected groupVersion
144
- //{ // v1beta1 -> internal NB. test commented after changes required for upgrading to go v1.12
145
- // name: "v1beta1ToInternal",
146
- // in: controlPlaneV1beta1YAMLAbstracted,
147
- // out: controlPlaneInternalYAMLAbstracted,
148
- // groupVersion: kubeadm.SchemeGroupVersion,
149
- //},
150
- { // v1beta1 -> internal -> v1beta1
151
- name: "v1beta1Tov1beta1",
152
- in: controlPlaneV1beta1YAMLAbstracted,
153
- out: controlPlaneV1beta1YAMLAbstracted,
154
- groupVersion: kubeadmapiv1beta1.SchemeGroupVersion,
155
- },
156
- // These tests are reading one file that has only a subset of the fields populated, loading it using LoadInitConfigurationFromFile,
157
- // and then marshals the internal object to the expected groupVersion
158
- { // v1beta1 -> default -> validate -> internal -> v1beta1
159
- name: "incompleteYAMLToDefaultedv1beta1",
160
- in: controlPlaneIncompleteYAML,
161
- out: controlPlaneDefaultedYAMLAbstracted,
162
- groupVersion: kubeadmapiv1beta1.SchemeGroupVersion,
163
- },
164
- { // v1beta1 -> validation should fail
165
- name: "invalidYAMLShouldFail",
166
- in: controlPlaneInvalidYAML,
167
- expectedErr: true,
168
- },
169
- }
170
-
171
- for _, rt := range tests {
172
- t.Run(rt.name, func(t2 *testing.T) {
173
-
174
- internalcfg, err := LoadInitConfigurationFromFile(rt.in)
175
- if err != nil {
176
- if rt.expectedErr {
177
- return
178
- }
179
- t2.Fatalf("couldn't unmarshal test data: %v", err)
180
- }
181
-
182
- actual, err := MarshalInitConfigurationToBytes(internalcfg, rt.groupVersion)
183
- if err != nil {
184
- t2.Fatalf("couldn't marshal internal object: %v", err)
185
- }
186
-
187
- expected, err := ioutil.ReadFile(rt.out)
188
- if err != nil {
189
- t2.Fatalf("couldn't read test data: %v", err)
190
- }
191
-
192
- if !bytes.Equal(expected, actual) {
193
- t2.Errorf("the expected and actual output differs.\n\tin: %s\n\tout: %s\n\tgroupversion: %s\n\tdiff: \n%s\n",
194
- rt.in, rt.out, rt.groupVersion.String(), diff(expected, actual))
195
- }
196
- })
197
- }
198
- }
199
- */
200
-
201
126
func TestDefaultTaintsMarshaling (t * testing.T ) {
202
127
tests := []struct {
203
128
desc string
0 commit comments