SSH keys related logging
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/promote/production Build is failing

This commit is contained in:
Adam Štrauch 2023-06-30 00:46:15 +02:00
parent 4a4da2c080
commit e9fb6a6b46
Signed by: cx
GPG key ID: 018304FFA8988F8D

View file

@ -244,7 +244,9 @@ func (p *Processor) Create(appTemplate apps.App) error {
time.Sleep(5 * time.Second) // We wait for a little bit longer to make sure the container is fully started
// Setup SSH keys if it's noted in the request
log.Println("Checking if SSH key is required")
if len(appTemplate.Setup.SSHKeys) > 0 && len(appTemplate.Snapshot) == 0 {
log.Println("Setting up SSH keys")
err = p.UpdateKeys(appTemplate.Setup.SSHKeys)
if err != nil {
return fmt.Errorf("failed to update keys: %v", err)
@ -456,6 +458,7 @@ func (p *Processor) UpdateKeys(keys string) error {
return err
}
log.Println("Storing keys into " + sshPubKeysLocation)
err = container.AppendFile(sshPubKeysLocation, keys+"\n", "0600")
if err != nil {
return err