43 lines
1.3 KiB
Go
43 lines
1.3 KiB
Go
package models
|
|
|
|
type VolumeClaimTemplate struct {
|
|
Metadata struct {
|
|
Name string `yaml:"name"`
|
|
Annotations map[string]string `yaml:"annotations,omitempty"`
|
|
} `yaml:"metadata"`
|
|
Spec VolumeSpec `yaml:"spec"`
|
|
}
|
|
|
|
type VolumeSpec struct {
|
|
AccessModes []string `yaml:"accessModes,flow"`
|
|
Resources struct {
|
|
Requests struct {
|
|
Storage string `yaml:"storage"`
|
|
} `yaml:"requests"`
|
|
} `yaml:"resources"`
|
|
}
|
|
|
|
// PVCRef references a pre-provisioned PersistentVolumeClaim by name.
|
|
type PVCRef struct {
|
|
ClaimName string `yaml:"claimName"`
|
|
}
|
|
|
|
// SecretRef references a K8s Secret to mount as a volume.
|
|
type SecretRef struct {
|
|
SecretName string `yaml:"secretName"`
|
|
}
|
|
|
|
// EmptyDirRef declares an emptyDir volume. Set Medium to "Memory" for /dev/shm-style RAM backing.
|
|
type EmptyDirRef struct {
|
|
Medium string `yaml:"medium,omitempty"`
|
|
}
|
|
|
|
// ExistingVolume represents any volume mounted into an Argo workflow spec.
|
|
// Exactly one of PersistentVolumeClaim, Secret, or EmptyDir should be non-nil.
|
|
type ExistingVolume struct {
|
|
Name string `yaml:"name"`
|
|
PersistentVolumeClaim *PVCRef `yaml:"persistentVolumeClaim,omitempty"`
|
|
Secret *SecretRef `yaml:"secret,omitempty"`
|
|
EmptyDir *EmptyDirRef `yaml:"emptyDir,omitempty"`
|
|
}
|