Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed worker zone network management for existing shoots #2048

Merged
merged 3 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 7 additions & 11 deletions frontend/src/components/ShootWorkers/GWorkerConfiguration.vue
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ import {
ref,
computed,
provide,
watch,
} from 'vue'
import { useVuelidate } from '@vuelidate/core'
import yaml from 'js-yaml'
Expand All @@ -133,6 +132,7 @@ import {
isEmpty,
pick,
isEqual,
map,
} from '@/lodash'

export default {
Expand All @@ -154,8 +154,7 @@ export default {
const {
providerWorkers,
providerInfrastructureConfigNetworksZones,
initialZones,
usedZones,
initialProviderInfrastructureConfigNetworksZones,
setShootManifest,
} = useShootContext()

Expand All @@ -167,16 +166,17 @@ export default {
const disableWorkerAnimation = ref(false)
const newZonesAlert = ref(true)

const newZones = computed(() => {
const newZoneNetworks = computed(() => {
const initialNetworkNames = map(initialProviderInfrastructureConfigNetworksZones.value, 'name')
return filter(providerInfrastructureConfigNetworksZones.value, ({ name }) => {
return !includes(initialZones.value, name)
return !includes(initialNetworkNames, name)
})
})

const newZonesYaml = computed(() => {
return isEmpty(newZones.value)
return isEmpty(newZoneNetworks.value)
? undefined
: yaml.dump(newZones.value)
: yaml.dump(newZoneNetworks.value)
})

const editorData = computed({
Expand Down Expand Up @@ -222,10 +222,6 @@ export default {
disableLineHighlighting: true,
}))

watch(usedZones, value => {
providerInfrastructureConfigNetworksZones.value = filter(providerInfrastructureConfigNetworksZones.value, zone => includes(value, zone.name))
})

return {
v$: useVuelidate(),
shootItem,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ import {
set,
head,
pick,
every,
} from '@/lodash'

export default {
Expand Down Expand Up @@ -422,8 +423,14 @@ export default {
return sortBy(concat(this.selectedZones, this.unselectedZones), 'text')
},
zoneHint () {
const allAvailable = every(this.allZones, zone =>
includes(this.availableZones, zone),
)
if (allAvailable) {
return ''
}
if (this.maxAdditionalZones >= this.availableZones.length) {
return undefined
return ''
}
if (this.maxAdditionalZones === 0) {
return 'Your network configuration does not allow to add more zones that are not already used by this cluster'
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/composables/useShootContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ export function createShootContextComposable (options = {}) {
return uniq(flatMap(workers, 'zones'))
})

const initialProviderInfrastructureConfigNetworksZones = computed(() => {
return get(initialManifest.value, 'spec.provider.infrastructureConfig.networks.zones')
})

/* manifest */
const manifest = ref({})

Expand Down Expand Up @@ -982,6 +986,7 @@ export function createShootContextComposable (options = {}) {
providerInfrastructureConfigFirewallSize,
providerInfrastructureConfigFloatingPoolName,
providerInfrastructureConfigNetworksZones,
initialProviderInfrastructureConfigNetworksZones,
providerInfrastructureConfigPartitionID,
providerInfrastructureConfigProjectID,
/* provider - workers */
Expand Down