Skip to content

Commit

Permalink
Fixed: (#1084)
Browse files Browse the repository at this point in the history
Existing workers may keep cri.name empty without failing validation
Selecting a container runtime validates correctly
Machine image included internal properties in create shoot editor
additional container runtimes selection did no longer show up
  • Loading branch information
grolu authored Aug 12, 2021
1 parent 19f26f4 commit b760288
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
15 changes: 11 additions & 4 deletions frontend/src/components/ShootWorkers/ContainerRuntime.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ SPDX-License-Identifier: Apache-2.0
</template>

<script>
import { required } from 'vuelidate/lib/validators'
import { requiredIf } from 'vuelidate/lib/validators'
import { getValidationErrors, defaultCriNameByKubernetesVersion } from '@/utils'
import find from 'lodash/find'
import map from 'lodash/map'
Expand All @@ -52,7 +52,7 @@ const validationErrors = {

const validations = {
criName: {
required
required: requiredIf('criNameIsRequired')
}
}

Expand All @@ -69,6 +69,10 @@ export default {
kubernetesVersion: {
type: String,
required: true
},
criNameIsRequired: {
type: Boolean,
default: false
}
},
data () {
Expand All @@ -83,7 +87,7 @@ export default {
return map(this.machineImageCri, 'name')
},
criContainerRuntimeTypes () {
const containerRuntime = find(this.machineImageCri, ['name', this.containerRuntime])
const containerRuntime = find(this.machineImageCri, ['name', this.criName])
const ociRuntimes = get(containerRuntime, 'containerRuntimes', [])
return map(ociRuntimes, 'type')
},
Expand All @@ -92,7 +96,10 @@ export default {
return get(this.worker, 'cri.name')
},
set (value) {
set(this.worker, 'cri.name', value)
this.$set(this.worker, 'cri', {
...this.worker.cri,
name: value
})
}
},
selectedCriContainerRuntimeTypes: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ SPDX-License-Identifier: Apache-2.0
:machine-image-cri="machineImageCri"
:worker="worker"
:kubernetes-version="kubernetesVersion"
:cri-name-is-required="isNew"
@valid="onContainerRuntimeValid">
</container-runtime>
</div>
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ import forOwn from 'lodash/forOwn'
import replace from 'lodash/replace'
import sample from 'lodash/sample'
import split from 'lodash/split'
import pick from 'lodash/pick'

import moment from '@/utils/moment'
import { ioPlugin } from '@/utils/Emitter'
Expand Down Expand Up @@ -1114,7 +1115,7 @@ const getters = {
maxSurge: 1,
machine: {
type: machineType.name,
image: machineImage
image: pick(machineImage, ['name', 'version'])
},
zones,
cri: {
Expand Down

0 comments on commit b760288

Please sign in to comment.