feat(volume): add "exchange volumes"
This volumes are "emptyDir" and can have init command. For example, in a "same-pod", it allow the user to copy data from image to a directory that is mounted on others pods.
This commit is contained in:
@@ -209,10 +209,21 @@ func (chart *HelmChart) generateDeployment(service types.ServiceConfig, deployme
|
||||
// generate the cronjob if needed
|
||||
chart.setCronJob(service, appName)
|
||||
|
||||
if exchange, ok := service.Labels[labels.LabelExchangeVolume]; ok {
|
||||
// we need to add a volume and a mount point
|
||||
ex, err := labelStructs.NewExchangeVolumes(exchange)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
for _, exchangeVolume := range ex {
|
||||
d.AddLegacyVolume("exchange-"+exchangeVolume.Name, exchangeVolume.Type)
|
||||
d.exchangesVolumes[service.Name] = exchangeVolume
|
||||
}
|
||||
}
|
||||
|
||||
// get the same-pod label if exists, add it to the list.
|
||||
// We later will copy some parts to the target deployment and remove this one.
|
||||
if samePod, ok := service.Labels[labels.LabelSamePod]; ok && samePod != "" {
|
||||
log.Printf("Found same-pod label for %s", service.Name)
|
||||
podToMerge[samePod] = &service
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user