Skip to content

Commit

Permalink
extend use to other commands
Browse files Browse the repository at this point in the history
  • Loading branch information
aaron-kasten committed Oct 4, 2024
1 parent 78f1d84 commit ebef358
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/controllers/repositoryserver/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ func (h *RepoServerHandler) createOrUpdateClientUsers(ctx context.Context) error
LogDirectory: command.DefaultLogDirectory,
},
})
cmd = append([]string{"tail", "-v", "-F", "/tmp/kopia-log/cli-logs/latest.log", "&"}, cmd...)
stdout, stderr, err := kube.Exec(ctx, h.KubeCli, h.RepositoryServer.Namespace, h.RepositoryServer.Status.ServerInfo.PodName, repoServerPodContainerName, cmd, nil)
format.Log(h.RepositoryServer.Status.ServerInfo.PodName, repoServerPodContainerName, stdout)
format.Log(h.RepositoryServer.Status.ServerInfo.PodName, repoServerPodContainerName, stderr)
Expand Down Expand Up @@ -168,6 +169,7 @@ func (h *RepoServerHandler) createOrUpdateClientUsers(ctx context.Context) error
NewUsername: serverUsername,
UserPassword: string(password),
})
cmd = append([]string{"tail", "-v", "-F", "/tmp/kopia-log/cli-logs/latest.log", "&"}, cmd...)
stdout, stderr, err := kube.Exec(ctx, h.KubeCli, h.RepositoryServer.Namespace, h.RepositoryServer.Status.ServerInfo.PodName, repoServerPodContainerName, cmd, nil)
format.Log(h.RepositoryServer.Status.ServerInfo.PodName, repoServerPodContainerName, stdout)
format.Log(h.RepositoryServer.Status.ServerInfo.PodName, repoServerPodContainerName, stderr)
Expand All @@ -186,6 +188,7 @@ func (h *RepoServerHandler) createOrUpdateClientUsers(ctx context.Context) error
NewUsername: serverUsername,
UserPassword: string(password),
})
cmd = append([]string{"tail", "-v", "-F", "/tmp/kopia-log/cli-logs/latest.log", "&"}, cmd...)
stdout, stderr, err := kube.Exec(ctx, h.KubeCli, h.RepositoryServer.Namespace, h.RepositoryServer.Status.ServerInfo.PodName, repoServerPodContainerName, cmd, nil)
format.Log(h.RepositoryServer.Status.ServerInfo.PodName, repoServerPodContainerName, stdout)
format.Log(h.RepositoryServer.Status.ServerInfo.PodName, repoServerPodContainerName, stderr)
Expand Down Expand Up @@ -219,6 +222,7 @@ func (h *RepoServerHandler) refreshServer(ctx context.Context) error {
ServerPassword: password,
Fingerprint: fingerprint,
})
cmd = append([]string{"tail", "-v", "-F", "/tmp/kopia-log/cli-logs/latest.log", "&"}, cmd...)
stdout, stderr, err := kube.Exec(ctx, h.KubeCli, h.RepositoryServer.Namespace, h.RepositoryServer.Status.ServerInfo.PodName, repoServerPodContainerName, cmd, nil)
format.Log(h.RepositoryServer.Status.ServerInfo.PodName, repoServerPodContainerName, stdout)
format.Log(h.RepositoryServer.Status.ServerInfo.PodName, repoServerPodContainerName, stderr)
Expand Down Expand Up @@ -258,5 +262,6 @@ func (h *RepoServerHandler) getServerStatusCommand(ctx context.Context, serverAd
ServerPassword: password,
Fingerprint: fingerprint,
})
cmd = append([]string{"tail", "-v", "-F", "/tmp/kopia-log/cli-logs/latest.log", "&"}, cmd...)
return cmd, nil
}

0 comments on commit ebef358

Please sign in to comment.