-
Notifications
You must be signed in to change notification settings - Fork 31
/
git.go
27 lines (24 loc) · 841 Bytes
/
git.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package v1alpha1
import (
corev1 "k8s.io/api/core/v1"
)
type Git struct {
Image string `json:"image" protobuf:"bytes,1,opt,name=image"`
Command []string `json:"command,omitempty" protobuf:"bytes,6,rep,name=command"`
URL string `json:"url" protobuf:"bytes,2,opt,name=url"`
// +kubebuilder:default=.
Path string `json:"path,omitempty" protobuf:"bytes,3,opt,name=path"`
// +kubebuilder:default=main
Branch string `json:"branch,omitempty" protobuf:"bytes,4,opt,name=branch"`
Env []corev1.EnvVar `json:"env,omitempty" protobuf:"bytes,5,rep,name=env"`
}
func (in Git) getContainer(req getContainerReq) corev1.Container {
return containerBuilder{}.
init(req).
image(in.Image).
command(in.Command...).
appendEnv(in.Env...).
workingDir(PathWorkingDir).
resources(LargeResourceRequirements).
build()
}