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:
2024-11-22 14:54:36 +01:00
parent 3b51f41716
commit 95f3abfa74
7 changed files with 184 additions and 28 deletions

View File

@@ -0,0 +1,20 @@
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
}