2024-04-24 23:06:45 +02:00
|
|
|
package labelStructs
|
|
|
|
|
|
|
|
import "gopkg.in/yaml.v3"
|
|
|
|
|
|
|
|
type CronJob struct {
|
2024-11-18 17:12:12 +01:00
|
|
|
Image string `yaml:"image,omitempty" json:"image,omitempty"`
|
|
|
|
Command string `yaml:"command" json:"command,omitempty"`
|
|
|
|
Schedule string `yaml:"schedule" json:"schedule,omitempty"`
|
|
|
|
Rbac bool `yaml:"rbac" json:"rbac,omitempty"`
|
2024-04-24 23:06:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func CronJobFrom(data string) (*CronJob, error) {
|
|
|
|
var mapping CronJob
|
|
|
|
if err := yaml.Unmarshal([]byte(data), &mapping); err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return &mapping, nil
|
|
|
|
}
|