Skip to content

Commit

Permalink
feat: make command and args configurable via file
Browse files Browse the repository at this point in the history
Signed-off-by: Maria Kotlyarevskaya <mariia.kotliarevskaia@gmail.com>
  • Loading branch information
Jasstkn authored and alexellis committed Sep 6, 2022
1 parent 47071d3 commit 7832f18
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@ var (
)

type Job struct {
JobName string `yaml:"name"`
Image string `yaml:"image"`
Namespace string `yaml:"namespace"`
ServiceAccount string `yaml:"service_account,omitempty"`
JobName string `yaml:"name"`
Image string `yaml:"image"`
Namespace string `yaml:"namespace,omitempty"`
ServiceAccount string `yaml:"service_account,omitempty"`
Command []string `yaml:"command,omitempty"`
Args []string `yaml:"args,omitempty"`
}

func main() {
Expand Down Expand Up @@ -76,6 +78,8 @@ func main() {
image := jobFile.Image
namespace := jobFile.Namespace
sa := jobFile.ServiceAccount
command := jobFile.Command
args := jobFile.Args

if len(namespace) == 0 {
namespace = "default"
Expand Down Expand Up @@ -137,6 +141,8 @@ func main() {
Image: image,
Name: name,
ImagePullPolicy: corev1.PullAlways,
Command: command,
Args: args,
},
},
},
Expand Down

0 comments on commit 7832f18

Please sign in to comment.