Skip to content

Commit

Permalink
fix: Fix volumeTemplate in statfulset
Browse files Browse the repository at this point in the history
Signed-off-by: leoliu <leoliu@yunify.com>
  • Loading branch information
leoliu committed Jul 22, 2020
1 parent 1d12ab5 commit 1fd10d7
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/components/Forms/Workload/VolumeSettings/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -288,13 +288,15 @@ class VolumeSettings extends React.Component {
newVolumeMounts.forEach(vm => {
const existVolume = findVolume(volumes, vm.volume)

const path = `containerLogConfigs.${vm.containerName}.${vm.name ||
existVolume.name}`
if (existVolume) {
const path = `containerLogConfigs.${vm.containerName}.${vm.name ||
existVolume.name}`

if (vm.logPath) {
set(logConfig, path, vm.logPath.split(','))
} else {
unset(logConfig, path)
if (vm.logPath) {
set(logConfig, path, vm.logPath.split(','))
} else {
unset(logConfig, path)
}
}
})

Expand Down Expand Up @@ -380,7 +382,7 @@ class VolumeSettings extends React.Component {

handleVolumeTemplate(newVolume = {}, newVolumeMounts = []) {
newVolumeMounts.forEach(vm => {
vm.name = newVolume.name
vm.name = newVolume.name || get(newVolume, 'metadata.name')
})

this.updateVolumeTemplate(newVolume)
Expand Down

0 comments on commit 1fd10d7

Please sign in to comment.