Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

skupper init improve help text #1479

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
13 changes: 10 additions & 3 deletions cmd/skupper/skupper_podman.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,13 @@ func (s *SkupperPodman) Network() SkupperNetworkClient {
return s.network
}

func getCmdEnablePodmanSocket() string {
if os.Getuid() == 0 {
return "systemctl enable --now podman.socket"
}
return "systemctl --user enable --now podman.socket"
}

func (s *SkupperPodman) NewClient(cmd *cobra.Command, args []string) {
// endpoint can be provided during init
var endpoint string
Expand Down Expand Up @@ -131,21 +138,21 @@ func (s *SkupperPodman) NewClient(cmd *cobra.Command, args []string) {
fmt.Fprintf(out, "Podman endpoint is not available: %s",
utils.DefaultStr(endpoint, clientpodman.GetDefaultPodmanEndpoint()))
fmt.Fprintln(out)
recommendation = `
recommendation = fmt.Sprintf(`
Recommendation:

Make sure you have an active podman endpoint available.
On most systems you can execute:

systemctl --user enable --now podman.socket
%s

Alternatively you could also create your own service that runs:

podman system service --time=0 <URI>

You can get concrete examples through:

podman help system service`
podman help system service`, getCmdEnablePodmanSocket())
fmt.Fprintln(out, recommendation)
}
s.exit(1)
Expand Down