Files
katenary/generator/labels/labelStructs/exchangeVolume.go
Patrice Ferlet 95f3abfa74 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.
2024-11-22 14:54:36 +01:00

21 lines
515 B
Go

package labelStructs
import "gopkg.in/yaml.v3"
type ExchangeVolume struct {
Name string `yaml:"name" json:"name"`
MountPath string `yaml:"mountPath" json:"mountPath"`
Type string `yaml:"type,omitempty" json:"type,omitempty"`
Init string `yaml:"init,omitempty" json:"init,omitempty"`
}
func NewExchangeVolumes(data string) ([]*ExchangeVolume, error) {
mapping := []*ExchangeVolume{}
if err := yaml.Unmarshal([]byte(data), &mapping); err != nil {
return nil, err
}
return mapping, nil
}