Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions api/v1alpha1/amaltheasession_children.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const servicePortName string = prefix + "http"
const servicePort int32 = 80
const sessionVolumeName string = prefix + "volume"
const shmVolumeName string = prefix + "dev-shm"
const sshKnownHostsName string = "ssh-known-hosts"

// StatefulSet returns a AmaltheaSession StatefulSet object
func (cr *AmaltheaSession) StatefulSet() appsv1.StatefulSet {
Expand Down Expand Up @@ -371,6 +372,32 @@ func (cr *AmaltheaSession) initClones() ([]v1.Container, []v1.Volume) {
vols := []v1.Volume{}
containers := []v1.Container{}

vols = append(
vols,
v1.Volume{
Name: sshKnownHostsName,
VolumeSource: v1.VolumeSource{
ConfigMap: &v1.ConfigMapVolumeSource{
LocalObjectReference: v1.LocalObjectReference{
Name: sshKnownHostsName,
},
Items: []v1.KeyToPath{
{
Key: "known_hosts",
Path: "ssh_known_hosts",
},
},
Optional: ptr.To(true),
},
},
},
)
volMounts = append(volMounts, v1.VolumeMount{
Name: sshKnownHostsName,
MountPath: "/etc/ssh",
},
)

for irepo, repo := range cr.Spec.CodeRepositories {
args := []string{"clone", "--remote", repo.Remote, "--path", cr.Spec.Session.Storage.MountPath + "/" + repo.ClonePath}

Expand Down