Skip to content

Commit

Permalink
git pluginのimage変更
Browse files Browse the repository at this point in the history
  • Loading branch information
walnuts1018 committed Apr 15, 2024
1 parent f4a96f5 commit 954335f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/initplugins/gitplugin/gitplugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ type gitPlugin struct {
Repourl string `required:"true" json:"repourl"`
Branch string `json:"branch"`
VolumeName string `required:"true" json:"volumeName"`
Image string `required:"true" json:"image"`
InitCommand string `json:"initCommand"`
}

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

initcontainer := corev1apply.Container().
WithName("git").
WithImage("alpine/git").
WithImage(g.Image).
WithCommand("sh", "-c", command).
WithVolumeMounts(corev1apply.VolumeMount().
WithName(g.VolumeName).
Expand Down

0 comments on commit 954335f

Please sign in to comment.