-
Notifications
You must be signed in to change notification settings - Fork 31
/
git.go
29 lines (26 loc) · 975 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
28
29
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 corev1.Container{
Name: CtrMain,
Image: in.Image,
ImagePullPolicy: req.imagePullPolicy,
Command: in.Command,
Env: in.Env,
WorkingDir: PathWorkingDir,
VolumeMounts: []corev1.VolumeMount{req.volumeMount},
Resources: LargeResourceRequirements,
}
}