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.
21 lines
515 B
Go
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
|
|
}
|