Skip to content

Commit 954335f

Browse files
committed
git pluginのimage変更
1 parent f4a96f5 commit 954335f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

internal/initplugins/gitplugin/gitplugin.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ type gitPlugin struct {
1212
Repourl string `required:"true" json:"repourl"`
1313
Branch string `json:"branch"`
1414
VolumeName string `required:"true" json:"volumeName"`
15+
Image string `required:"true" json:"image"`
1516
InitCommand string `json:"initCommand"`
1617
}
1718

@@ -38,6 +39,7 @@ func (g *gitPlugin) GenerateInitContainerApplyConfiguration() *corev1apply.Conta
3839
command := fmt.Sprintf(`
3940
if [ ! -d /persistent/work ]; then
4041
mkdir -p /persistent/work;
42+
sudo apt install -y git;
4143
git clone -b `+g.Branch+` `+g.Repourl+` /persistent/work;
4244
%v
4345
else
@@ -47,7 +49,7 @@ func (g *gitPlugin) GenerateInitContainerApplyConfiguration() *corev1apply.Conta
4749

4850
initcontainer := corev1apply.Container().
4951
WithName("git").
50-
WithImage("alpine/git").
52+
WithImage(g.Image).
5153
WithCommand("sh", "-c", command).
5254
WithVolumeMounts(corev1apply.VolumeMount().
5355
WithName(g.VolumeName).

0 commit comments

Comments
 (0)