From f0e2e388dd367396907b0e4e7d4702b796fda092 Mon Sep 17 00:00:00 2001 From: Om Saran Date: Sat, 11 Feb 2023 15:33:11 -0600 Subject: [PATCH 1/5] Add ability to get json for "minikube service list" --- cmd/minikube/cmd/service_list.go | 46 ++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 14 deletions(-) diff --git a/cmd/minikube/cmd/service_list.go b/cmd/minikube/cmd/service_list.go index 97df14d1564b..23a6cdcb84f0 100644 --- a/cmd/minikube/cmd/service_list.go +++ b/cmd/minikube/cmd/service_list.go @@ -17,6 +17,7 @@ limitations under the License. package cmd import ( + "encoding/json" "os" "runtime" "strings" @@ -32,6 +33,7 @@ import ( ) var serviceListNamespace string +var profileOutput string // serviceListCmd represents the service list command var serviceListCmd = &cobra.Command{ @@ -40,6 +42,7 @@ var serviceListCmd = &cobra.Command{ Long: `Lists the URLs for the services in your local cluster`, Run: func(cmd *cobra.Command, args []string) { co := mustload.Healthy(ClusterFlagValue()) + output := strings.ToLower(profileOutput) serviceURLs, err := service.GetServiceURLs(co.API, co.Config.Name, serviceListNamespace, serviceURLTemplate) if err != nil { @@ -48,28 +51,43 @@ var serviceListCmd = &cobra.Command{ os.Exit(reason.ExSvcUnavailable) } - var data [][]string - for _, serviceURL := range serviceURLs { - if len(serviceURL.URLs) == 0 { - data = append(data, []string{serviceURL.Namespace, serviceURL.Name, "No node port"}) - } else { - servicePortNames := strings.Join(serviceURL.PortNames, "\n") - serviceURLs := strings.Join(serviceURL.URLs, "\n") + switch output { + case "table": + printServicesTable(serviceURLs, co) + case "json": + printServicesJSON(serviceURLs) + } + }, +} - // if we are running Docker on OSX we empty the internal service URLs - if runtime.GOOS == "darwin" && co.Config.Driver == oci.Docker { - serviceURLs = "" - } +func printServicesTable(serviceURLs service.URLs, co mustload.ClusterController) { + var data [][]string + for _, serviceURL := range serviceURLs { + if len(serviceURL.URLs) == 0 { + data = append(data, []string{serviceURL.Namespace, serviceURL.Name, "No node port"}) + } else { + servicePortNames := strings.Join(serviceURL.PortNames, "\n") + serviceURLs := strings.Join(serviceURL.URLs, "\n") - data = append(data, []string{serviceURL.Namespace, serviceURL.Name, servicePortNames, serviceURLs}) + // if we are running Docker on OSX we empty the internal service URLs + if runtime.GOOS == "darwin" && co.Config.Driver == oci.Docker { + serviceURLs = "" } + + data = append(data, []string{serviceURL.Namespace, serviceURL.Name, servicePortNames, serviceURLs}) } + } - service.PrintServiceList(os.Stdout, data) - }, + service.PrintServiceList(os.Stdout, data) +} + +func printServicesJSON(serviceURLs service.URLs) { + jsonString, _ := json.Marshal(serviceURLs) + os.Stdout.Write(jsonString) } func init() { + serviceListCmd.Flags().StringVarP(&profileOutput, "output", "o", "table", "The output format. One of 'json', 'table'") serviceListCmd.Flags().StringVarP(&serviceListNamespace, "namespace", "n", core.NamespaceAll, "The services namespace") serviceCmd.AddCommand(serviceListCmd) } From e33b5af7b77e8f24bd11ae986b998f126d5b89fd Mon Sep 17 00:00:00 2001 From: Om Saran Date: Wed, 15 Feb 2023 15:44:48 -0600 Subject: [PATCH 2/5] Add integration test and fix behvaior on wrong output format for service list --- cmd/minikube/cmd/service_list.go | 4 +++ test/integration/functional_test.go | 39 +++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/cmd/minikube/cmd/service_list.go b/cmd/minikube/cmd/service_list.go index 23a6cdcb84f0..edca0574927a 100644 --- a/cmd/minikube/cmd/service_list.go +++ b/cmd/minikube/cmd/service_list.go @@ -18,6 +18,7 @@ package cmd import ( "encoding/json" + "fmt" "os" "runtime" "strings" @@ -25,6 +26,7 @@ import ( "github.com/spf13/cobra" core "k8s.io/api/core/v1" "k8s.io/minikube/pkg/drivers/kic/oci" + "k8s.io/minikube/pkg/minikube/exit" "k8s.io/minikube/pkg/minikube/mustload" "k8s.io/minikube/pkg/minikube/out" "k8s.io/minikube/pkg/minikube/reason" @@ -56,6 +58,8 @@ var serviceListCmd = &cobra.Command{ printServicesTable(serviceURLs, co) case "json": printServicesJSON(serviceURLs) + default: + exit.Message(reason.Usage, fmt.Sprintf("invalid output format: %s. Valid values: 'table', 'json'", output)) } }, } diff --git a/test/integration/functional_test.go b/test/integration/functional_test.go index a221a73d49fa..dc622160f717 100644 --- a/test/integration/functional_test.go +++ b/test/integration/functional_test.go @@ -44,6 +44,7 @@ import ( "k8s.io/minikube/pkg/minikube/detect" "k8s.io/minikube/pkg/minikube/localpath" "k8s.io/minikube/pkg/minikube/reason" + "k8s.io/minikube/pkg/minikube/service" "k8s.io/minikube/pkg/util/retry" "github.com/blang/semver/v4" @@ -1454,6 +1455,8 @@ func validateServiceCmd(ctx context.Context, t *testing.T, profile string) { t.Errorf("expected 'service list' to contain *hello-node* but got -%q-", rr.Stdout.String()) } + validateServiceCmdJSON(ctx, t) + // docs: Run `minikube service` with `--https --url` to make sure the HTTPS endpoint URL of the service is printed cmdContext := exec.CommandContext(ctx, Target(), "-p", profile, "service", "--namespace=default", "--https", "--url", "hello-node") if NeedsPortForward() { @@ -1520,6 +1523,42 @@ func validateServiceCmd(ctx context.Context, t *testing.T, profile string) { } } +func validateServiceCmdJSON(ctx context.Context, t *testing.T) { + // docs: Run `minikube service list -o JSON` and make sure the services are correctly listed as JSON output + t.Run("service_json_output", func(t *testing.T) { + targetSvcName := "hello-node" + // helper function to run command then, return target service object from json output. + extractServiceObjFunc := func(rr *RunResult) *service.SvcURL { + var jsonObjects service.URLs + err := json.Unmarshal(rr.Stdout.Bytes(), &jsonObjects) + if err != nil { + t.Errorf("failed to decode json from profile list: args %q: %v", rr.Command(), err) + return nil + } + + for _, svc := range jsonObjects { + if svc.Name == targetSvcName { + return &svc + } + } + return nil + } + + start := time.Now() + rr, err := Run(t, exec.CommandContext(ctx, Target(), "service", "list", "-o", "json")) + elapsed := time.Since(start) + if err != nil { + t.Errorf("failed to list services with json format. args %q: %v", rr.Command(), err) + } + t.Logf("Took %q to run %q", elapsed, rr.Command()) + + pr := extractServiceObjFunc(rr) + if pr == nil { + t.Errorf("expected the json of 'service list' to include %q but got *%q*. args: %q", targetSvcName, rr.Stdout.String(), rr.Command()) + } + }) +} + func validateServiceCmdConnect(ctx context.Context, t *testing.T, profile string) { defer PostMortemLogs(t, profile) From 2057e1d3adb4328e694397f11c260e6d7537bfcb Mon Sep 17 00:00:00 2001 From: Om Saran Date: Wed, 15 Feb 2023 21:18:26 -0600 Subject: [PATCH 3/5] Fix service cmd functional test to give by passing correct profile --- test/integration/functional_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/integration/functional_test.go b/test/integration/functional_test.go index dc622160f717..5f4b79cbfef1 100644 --- a/test/integration/functional_test.go +++ b/test/integration/functional_test.go @@ -1455,7 +1455,7 @@ func validateServiceCmd(ctx context.Context, t *testing.T, profile string) { t.Errorf("expected 'service list' to contain *hello-node* but got -%q-", rr.Stdout.String()) } - validateServiceCmdJSON(ctx, t) + validateServiceCmdJSON(ctx, t, profile) // docs: Run `minikube service` with `--https --url` to make sure the HTTPS endpoint URL of the service is printed cmdContext := exec.CommandContext(ctx, Target(), "-p", profile, "service", "--namespace=default", "--https", "--url", "hello-node") @@ -1523,7 +1523,7 @@ func validateServiceCmd(ctx context.Context, t *testing.T, profile string) { } } -func validateServiceCmdJSON(ctx context.Context, t *testing.T) { +func validateServiceCmdJSON(ctx context.Context, t *testing.T, profile string) { // docs: Run `minikube service list -o JSON` and make sure the services are correctly listed as JSON output t.Run("service_json_output", func(t *testing.T) { targetSvcName := "hello-node" @@ -1545,7 +1545,7 @@ func validateServiceCmdJSON(ctx context.Context, t *testing.T) { } start := time.Now() - rr, err := Run(t, exec.CommandContext(ctx, Target(), "service", "list", "-o", "json")) + rr, err := Run(t, exec.CommandContext(ctx, Target(), "-p", profile, "service", "list", "-o", "json")) elapsed := time.Since(start) if err != nil { t.Errorf("failed to list services with json format. args %q: %v", rr.Command(), err) From 00d5b2acc5926d4402d6a6571b9004a395b91988 Mon Sep 17 00:00:00 2001 From: Om Saran Date: Mon, 20 Feb 2023 09:52:03 -0600 Subject: [PATCH 4/5] Update test name, logging and generate docs --- site/content/en/docs/commands/service.md | 1 + site/content/en/docs/contrib/tests.en.md | 5 +++++ test/integration/functional_test.go | 7 +++---- translations/de.json | 8 ++++---- translations/es.json | 8 ++++---- translations/fr.json | 4 ++++ translations/ja.json | 6 ++++-- translations/ko.json | 8 ++++---- translations/pl.json | 8 ++++---- translations/ru.json | 8 ++++---- translations/strings.txt | 8 ++++---- translations/zh-CN.json | 8 ++++---- 12 files changed, 45 insertions(+), 34 deletions(-) diff --git a/site/content/en/docs/commands/service.md b/site/content/en/docs/commands/service.md index 672821a13915..9f2ca7599f85 100644 --- a/site/content/en/docs/commands/service.md +++ b/site/content/en/docs/commands/service.md @@ -105,6 +105,7 @@ minikube service list [flags] ``` -n, --namespace string The services namespace + -o, --output string The output format. One of 'json', 'table' (default "table") ``` ### Options inherited from parent commands diff --git a/site/content/en/docs/contrib/tests.en.md b/site/content/en/docs/contrib/tests.en.md index 4025bac8df00..c80f7d3420b5 100644 --- a/site/content/en/docs/contrib/tests.en.md +++ b/site/content/en/docs/contrib/tests.en.md @@ -300,6 +300,11 @@ Steps: - Run `minikube service` with `--url --format={{.IP}}` to make sure the IP address of the service is printed - Run `minikube service` with a regular `--url` to make sure the HTTP endpoint URL of the service is printed +#### validateServiceCmdJSON + +Steps: +- Run `minikube service list -o JSON` and make sure the services are correctly listed as JSON output + #### validateServiceCmdConnect Steps: diff --git a/test/integration/functional_test.go b/test/integration/functional_test.go index 5f4b79cbfef1..92f4213caee3 100644 --- a/test/integration/functional_test.go +++ b/test/integration/functional_test.go @@ -1525,15 +1525,14 @@ func validateServiceCmd(ctx context.Context, t *testing.T, profile string) { func validateServiceCmdJSON(ctx context.Context, t *testing.T, profile string) { // docs: Run `minikube service list -o JSON` and make sure the services are correctly listed as JSON output - t.Run("service_json_output", func(t *testing.T) { + t.Run("ServiceJSONOutput", func(t *testing.T) { targetSvcName := "hello-node" // helper function to run command then, return target service object from json output. extractServiceObjFunc := func(rr *RunResult) *service.SvcURL { var jsonObjects service.URLs err := json.Unmarshal(rr.Stdout.Bytes(), &jsonObjects) if err != nil { - t.Errorf("failed to decode json from profile list: args %q: %v", rr.Command(), err) - return nil + t.Fatalf("failed to decode json from profile list: args %q: %v", rr.Command(), err) } for _, svc := range jsonObjects { @@ -1548,7 +1547,7 @@ func validateServiceCmdJSON(ctx context.Context, t *testing.T, profile string) { rr, err := Run(t, exec.CommandContext(ctx, Target(), "-p", profile, "service", "list", "-o", "json")) elapsed := time.Since(start) if err != nil { - t.Errorf("failed to list services with json format. args %q: %v", rr.Command(), err) + t.Fatalf("failed to list services with json format. args %q: %v", rr.Command(), err) } t.Logf("Took %q to run %q", elapsed, rr.Command()) diff --git a/translations/de.json b/translations/de.json index f86c2bfb37ed..680c8558ead2 100644 --- a/translations/de.json +++ b/translations/de.json @@ -23,7 +23,7 @@ "--kvm-numa-count range is 1-8": "Der Wertebereich für --kvm-numa-count ist 1-8", "--network flag is only valid with the docker/podman and KVM drivers, it will be ignored": "Der Parameter --network kann nur mit dem docker/podman und den KVM Treibern verwendet werden, er wird ignoriert werden", "--network flag is only valid with the docker/podman, KVM and Qemu drivers, it will be ignored": "", - "--network with QEMU must be 'user' or 'socket_vmnet'": "", + "--network with QEMU must be 'builtin' or 'socket_vmnet'": "", "--static-ip is only implemented on Docker and Podman drivers, flag will be ignored": "", "--static-ip overrides --subnet, --subnet will be ignored": "", "1) Recreate the cluster with Kubernetes {{.new}}, by running:\n\t \n\t\t minikube delete{{.profile}}\n\t\t minikube start{{.profile}} --kubernetes-version={{.prefix}}{{.new}}\n\t \n\t\t2) Create a second cluster with Kubernetes {{.new}}, by running:\n\t \n\t\t minikube start -p {{.suggestedName}} --kubernetes-version={{.prefix}}{{.new}}\n\t \n\t\t3) Use the existing cluster at version Kubernetes {{.old}}, by running:\n\t \n\t\t minikube start{{.profile}} --kubernetes-version={{.prefix}}{{.old}}\n\t\t": "1) Erstellen Sie den Cluster mit Kubernetes {{.new}} neu, indem Sie folgende Befehle ausführen:\n\t \n\t\t minikube delete{{.profile}}\n\t\t minikube start{{.profile}} --kubernetes-version={{.prefix}}{{.new}}\n\t \n\t\t2) Erstellen Sie einen zweiten Cluster mit Kubernetes {{.new}}, indem Sie folgende Befehle ausführen:\n\t \n\t\t minikube start -p {{.suggestedName}} --kubernetes-version={{.prefix}}{{.new}}\n\t \n\t\t3) Verwenden Sie den existierenden Cluster mit Version {{.old}} von Kubernetes, indem Sie folgende Befehle ausführen:\n\t \n\t\t minikube start{{.profile}} --kubernetes-version={{.prefix}}{{.old}}\n\t\t", @@ -988,14 +988,14 @@ "minikube is not meant for production use. You are opening non-local traffic": "Minikube ist nicht für die Verwendung in Produktion gedacht. Nicht lokaler Traffik wird zugelassen", "minikube is unable to access the Google Container Registry. You may need to configure it to use a HTTP proxy.": "Minikube ist nicht in der Lage auf die Google Container Registry zuzugreifen. Eventuell müssen Sie einen HTTP Proxy konfigurieren.", "minikube is unable to connect to the VM: {{.error}}\n\n\tThis is likely due to one of two reasons:\n\n\t- VPN or firewall interference\n\t- {{.hypervisor}} network configuration issue\n\n\tSuggested workarounds:\n\n\t- Disable your local VPN or firewall software\n\t- Configure your local VPN or firewall to allow access to {{.ip}}\n\t- Restart or reinstall {{.hypervisor}}\n\t- Use an alternative --vm-driver\n\t- Use --force to override this connectivity check\n\t": "Minikube kann nicht zur VM verbinden: {{.error}}\n\n\tDies ist wahrscheinlich aufgrund einem von zwei Gründen:\n\n\t- VPN oder Firewall Probleme\n\t- {{.hypervisor}} Netzwerk Konfiguration Issue\n\n\tVorgeschlagene Workarounds:\n\n\t- Deaktiviere die lokale VPN oder Firewall Software\n\t- Konfigure das lokale VPN oder die Firewall so, dass Zugriff auf die IP {{.ip}} erlaubt ist\n\t- Restarte oder Reinstalliere {{.hypervisor}}\n\t- Verwende einen alternativen --vm-dirver\n\t- Verwende --force um die Konnektivitäts-Prüfung zu überspringen\n\t", - "minikube mount is not currently implemented with the user network on QEMU": "", + "minikube mount is not currently implemented with the builtin network on QEMU": "", "minikube profile was successfully set to {{.profile_name}}": "Minikube Profil wurde erfolgreich gesetzt auf {{.profile_name}}", "minikube provisions and manages local Kubernetes clusters optimized for development workflows.": "Minikube provisioniert und managed lokale Kubernetes Cluster optimiert für Entwicklungs-Workflows.", "minikube quickly sets up a local Kubernetes cluster": "Minikube installiert schnell einen lokalen Kubernetes Cluster", - "minikube service is not currently implemented with the user network on QEMU": "", + "minikube service is not currently implemented with the builtin network on QEMU": "", "minikube skips various validations when --force is supplied; this may lead to unexpected behavior": "Minikube überspringt diverse Validierungen wenn --force angegeben ist; das könnte zu unerwartetem Verhalten führen", "minikube status --output OUTPUT. json, text": "", - "minikube tunnel is not currently implemented with the user network on QEMU": "", + "minikube tunnel is not currently implemented with the builtin network on QEMU": "", "minikube {{.version}} is available! Download it: {{.url}}": "Minikube {{.version}} ist verfügbar. Lade es herunter: {{.url}}", "mkcmp is used to compare performance of two minikube binaries": "mkcmp wird verwendet um die Performance von zwei Minikube Binaries zu vergleichen", "mount argument \"{{.value}}\" must be in form: \u003csource directory\u003e:\u003ctarget directory\u003e": "Das Argument \"{{.value}}\" für Mount muss in der Form \u003cQuell Verzeichnis\u003e:\u003cZiel Verzeichnis\u003e", diff --git a/translations/es.json b/translations/es.json index 0351f158a5e0..bac8f74fe87d 100644 --- a/translations/es.json +++ b/translations/es.json @@ -24,7 +24,7 @@ "--kvm-numa-count range is 1-8": "--kvm-numa-count el rango es 1-8", "--network flag is only valid with the docker/podman and KVM drivers, it will be ignored": "el flag --network es válido solamente con docker/podman y KVM, será ignorado", "--network flag is only valid with the docker/podman, KVM and Qemu drivers, it will be ignored": "", - "--network with QEMU must be 'user' or 'socket_vmnet'": "", + "--network with QEMU must be 'builtin' or 'socket_vmnet'": "", "--static-ip is only implemented on Docker and Podman drivers, flag will be ignored": "", "--static-ip overrides --subnet, --subnet will be ignored": "", "1) Recreate the cluster with Kubernetes {{.new}}, by running:\n\t \n\t\t minikube delete{{.profile}}\n\t\t minikube start{{.profile}} --kubernetes-version={{.prefix}}{{.new}}\n\t \n\t\t2) Create a second cluster with Kubernetes {{.new}}, by running:\n\t \n\t\t minikube start -p {{.suggestedName}} --kubernetes-version={{.prefix}}{{.new}}\n\t \n\t\t3) Use the existing cluster at version Kubernetes {{.old}}, by running:\n\t \n\t\t minikube start{{.profile}} --kubernetes-version={{.prefix}}{{.old}}\n\t\t": "", @@ -983,14 +983,14 @@ "minikube is not meant for production use. You are opening non-local traffic": "", "minikube is unable to access the Google Container Registry. You may need to configure it to use a HTTP proxy.": "", "minikube is unable to connect to the VM: {{.error}}\n\n\tThis is likely due to one of two reasons:\n\n\t- VPN or firewall interference\n\t- {{.hypervisor}} network configuration issue\n\n\tSuggested workarounds:\n\n\t- Disable your local VPN or firewall software\n\t- Configure your local VPN or firewall to allow access to {{.ip}}\n\t- Restart or reinstall {{.hypervisor}}\n\t- Use an alternative --vm-driver\n\t- Use --force to override this connectivity check\n\t": "", - "minikube mount is not currently implemented with the user network on QEMU": "", + "minikube mount is not currently implemented with the builtin network on QEMU": "", "minikube profile was successfully set to {{.profile_name}}": "", "minikube provisions and manages local Kubernetes clusters optimized for development workflows.": "", "minikube quickly sets up a local Kubernetes cluster": "", - "minikube service is not currently implemented with the user network on QEMU": "", + "minikube service is not currently implemented with the builtin network on QEMU": "", "minikube skips various validations when --force is supplied; this may lead to unexpected behavior": "", "minikube status --output OUTPUT. json, text": "", - "minikube tunnel is not currently implemented with the user network on QEMU": "", + "minikube tunnel is not currently implemented with the builtin network on QEMU": "", "minikube {{.version}} is available! Download it: {{.url}}": "", "mkcmp is used to compare performance of two minikube binaries": "", "mount argument \"{{.value}}\" must be in form: \u003csource directory\u003e:\u003ctarget directory\u003e": "", diff --git a/translations/fr.json b/translations/fr.json index 6496b13b7473..3526a79d4c71 100644 --- a/translations/fr.json +++ b/translations/fr.json @@ -24,6 +24,7 @@ "--kvm-numa-count range is 1-8": "la tranche de --kvm-numa-count est 1 à 8", "--network flag is only valid with the docker/podman and KVM drivers, it will be ignored": "l'indicateur --network est valide uniquement avec les pilotes docker/podman et KVM, il va être ignoré", "--network flag is only valid with the docker/podman, KVM and Qemu drivers, it will be ignored": "L'indicateur --network n'est valide qu'avec les pilotes docker/podman, KVM et Qemu, il sera ignoré", + "--network with QEMU must be 'builtin' or 'socket_vmnet'": "", "--network with QEMU must be 'user' or 'socket_vmnet'": "--network avec QEMU doit être 'user' ou 'socket_vmnet'", "--static-ip is only implemented on Docker and Podman drivers, flag will be ignored": "--static-ip n'est implémenté que sur les pilotes Docker et Podman, l'indicateur sera ignoré", "--static-ip overrides --subnet, --subnet will be ignored": "--static-ip remplace --subnet, --subnet sera ignoré", @@ -965,14 +966,17 @@ "minikube is not meant for production use. You are opening non-local traffic": "minikube n'est pas destiné à une utilisation en production. Vous ouvrez du trafic non local", "minikube is unable to access the Google Container Registry. You may need to configure it to use a HTTP proxy.": "minikube ne peut pas accéder à Google Container Registry. Vous devrez peut-être le configurer pour utiliser un proxy HTTP.", "minikube is unable to connect to the VM: {{.error}}\n\n\tThis is likely due to one of two reasons:\n\n\t- VPN or firewall interference\n\t- {{.hypervisor}} network configuration issue\n\n\tSuggested workarounds:\n\n\t- Disable your local VPN or firewall software\n\t- Configure your local VPN or firewall to allow access to {{.ip}}\n\t- Restart or reinstall {{.hypervisor}}\n\t- Use an alternative --vm-driver\n\t- Use --force to override this connectivity check\n\t": "minikube ne parvient pas à se connecter à la VM : {{.error}}\n\n\tCela est probablement dû à l'une des deux raisons suivantes :\n\n\t- Interférence VPN ou pare-feu\n\t- {{.hypervisor}} problème de configuration réseau\n\n\tSolutions suggérées :\n\n\t- Désactivez votre logiciel VPN ou pare-feu local\n\t- Configurez votre VPN ou pare-feu local pour autoriser l'accès à {{.ip}}\n \t- Redémarrez ou réinstallez {{.hypervisor}}\n\t- Utilisez un autre --vm-driver\n\t- Utilisez --force pour annuler cette vérification de connectivité\n\t", + "minikube mount is not currently implemented with the builtin network on QEMU": "", "minikube mount is not currently implemented with the user network on QEMU": "Le montage minikube n'est pas actuellement implémenté avec le réseau utilisateur sur QEMU", "minikube profile was successfully set to {{.profile_name}}": "Le profil de minikube a été défini avec succès sur {{.profile_name}}", "minikube provisions and manages local Kubernetes clusters optimized for development workflows.": "minikube provisionne et gère des clusters Kubernetes locaux optimisés pour les workflows de développement.", "minikube quickly sets up a local Kubernetes cluster": "minikube configure rapidement un cluster Kubernetes local", + "minikube service is not currently implemented with the builtin network on QEMU": "", "minikube service is not currently implemented with the qemu2 driver. See https://github.com/kubernetes/minikube/issues/14146 for details.": "Le service minikube n'est actuellement pas implémenté avec le pilote qemu2. Voir https://github.com/kubernetes/minikube/issues/14146 pour plus de détails.", "minikube service is not currently implemented with the user network on QEMU": "Le service minikube n'est pas actuellement implémenté avec le réseau utilisateur sur QEMU", "minikube skips various validations when --force is supplied; this may lead to unexpected behavior": "minikube ignore diverses validations lorsque --force est fourni ; cela peut conduire à un comportement inattendu", "minikube status --output OUTPUT. json, text": "état minikube --sortie SORTIE. json, texte", + "minikube tunnel is not currently implemented with the builtin network on QEMU": "", "minikube tunnel is not currently implemented with the qemu2 driver. See https://github.com/kubernetes/minikube/issues/14146 for details.": "Le tunnel minikube n'est actuellement pas implémenté avec le pilote qemu2. Voir https://github.com/kubernetes/minikube/issues/14146 pour plus de détails.", "minikube tunnel is not currently implemented with the user network on QEMU": "Le tunnel minikube n'est pas actuellement implémenté avec le réseau utilisateur sur QEMU", "minikube {{.version}} is available! Download it: {{.url}}": "minikube {{.version}} est disponible ! Téléchargez-le ici : {{.url}}", diff --git a/translations/ja.json b/translations/ja.json index 08fa1d7dcc91..548f70b6b86c 100644 --- a/translations/ja.json +++ b/translations/ja.json @@ -23,6 +23,7 @@ "--kvm-numa-count range is 1-8": "--kvm-numa-count の範囲は 1~8 です", "--network flag is only valid with the docker/podman and KVM drivers, it will be ignored": "--network フラグは、docker/podman および KVM ドライバーでのみ有効であるため、無視されます", "--network flag is only valid with the docker/podman, KVM and Qemu drivers, it will be ignored": "--network フラグは、docker/podman, KVM および Qemu ドライバーでのみ有効であるため、無視されます", + "--network with QEMU must be 'builtin' or 'socket_vmnet'": "", "--network with QEMU must be 'user' or 'socket_vmnet'": "QEMU を用いる場合、--network は、'user' か 'socket_vmnet' でなければなりません", "--static-ip is only implemented on Docker and Podman drivers, flag will be ignored": "", "--static-ip overrides --subnet, --subnet will be ignored": "", @@ -922,16 +923,17 @@ "minikube is not meant for production use. You are opening non-local traffic": "minikube は本番適用を意図されたものではありません。あなたは非ローカルのトラフィックを開こうとしています", "minikube is unable to access the Google Container Registry. You may need to configure it to use a HTTP proxy.": "minikube が Google Container Registry に接続できません。 HTTP プロキシーを使用するように設定する必要があるかもしれません。", "minikube is unable to connect to the VM: {{.error}}\n\n\tThis is likely due to one of two reasons:\n\n\t- VPN or firewall interference\n\t- {{.hypervisor}} network configuration issue\n\n\tSuggested workarounds:\n\n\t- Disable your local VPN or firewall software\n\t- Configure your local VPN or firewall to allow access to {{.ip}}\n\t- Restart or reinstall {{.hypervisor}}\n\t- Use an alternative --vm-driver\n\t- Use --force to override this connectivity check\n\t": "minikube が VM に接続できません: {{.error}}\n\n\t考えられる理由は以下の 2 つです:\n\n\t- VPN またはファイアウォールによる干渉\n\t- {{.hypervisor}} のネットワーク設定の問題\n\n\t回避策には以下があります:\n\n\t- ローカルの VPN またはファイアウォールを無効化\n\t- {{.ip}} へのアクセスを許可するようにローカルの VPN またはファイアウォールを設定\n\t- {{.hypervisor}} を再起動または再インストール\n\t- 代わりの --vm-driver を使用\n\t- --force を使用してこの接続チェックを上書き\n\t", + "minikube mount is not currently implemented with the builtin network on QEMU": "", "minikube mount is not currently implemented with the user network on QEMU": "minikube mount は、QEMU 上のユーザーネットワークでは実装されていません", "minikube profile was successfully set to {{.profile_name}}": "無事 minikube のプロファイルが {{.profile_name}} に設定されました", "minikube provisions and manages local Kubernetes clusters optimized for development workflows.": "minikube は、開発ワークフロー用に最適化されたローカル Kubernetes クラスターを構築・管理します。", "minikube quickly sets up a local Kubernetes cluster": "minikube はローカル Kubernetes クラスターを迅速にセットアップします", + "minikube service is not currently implemented with the builtin network on QEMU": "", "minikube service is not currently implemented with the qemu2 driver. See https://github.com/kubernetes/minikube/issues/14146 for details.": "minikube サービスは現在、qemu2 ドライバーでは実装されていません。詳細については、https://github.com/kubernetes/minikube/issues/14146 を参照してください。", - "minikube service is not currently implemented with the user network on QEMU": "", "minikube skips various validations when --force is supplied; this may lead to unexpected behavior": "minikube は --force が付与された場合、様々な検証をスキップします (これは予期せぬ挙動を引き起こすかも知れません)", "minikube status --output OUTPUT. json, text": "minikube status --output OUTPUT. json, text", + "minikube tunnel is not currently implemented with the builtin network on QEMU": "", "minikube tunnel is not currently implemented with the qemu2 driver. See https://github.com/kubernetes/minikube/issues/14146 for details.": "minikube トンネルは現在、qemu2 ドライバーでは実装されていません。 詳細については、https://github.com/kubernetes/minikube/issues/14146 を参照してください。", - "minikube tunnel is not currently implemented with the user network on QEMU": "", "minikube {{.version}} is available! Download it: {{.url}}": "minikube {{.version}} が利用可能です!次の URL からダウンロードしてください: {{.url}}", "mkcmp is used to compare performance of two minikube binaries": "mkcmp で 2 つの minikube のバイナリーのパフォーマンスを比較できます", "mount argument \"{{.value}}\" must be in form: \u003csource directory\u003e:\u003ctarget directory\u003e": "マウント引数「{{.value}}」は次の形式でなければなりません: \u003cソースディレクトリー\u003e:\u003cターゲットディレクトリー\u003e", diff --git a/translations/ko.json b/translations/ko.json index c71765bec122..8da4b6f8e511 100644 --- a/translations/ko.json +++ b/translations/ko.json @@ -28,7 +28,7 @@ "--container-runtime must be set to \"containerd\" or \"cri-o\" for rootless": "", "--kvm-numa-count range is 1-8": "--kvm-numa-count 범위는 1부터 8입니다", "--network flag is only valid with the docker/podman, KVM and Qemu drivers, it will be ignored": "--network 는 docker나 podman 에서만 유효합니다. KVM이나 Qemu 드라이버에서는 인자가 무시됩니다", - "--network with QEMU must be 'user' or 'socket_vmnet'": "", + "--network with QEMU must be 'builtin' or 'socket_vmnet'": "", "--static-ip is only implemented on Docker and Podman drivers, flag will be ignored": "", "--static-ip overrides --subnet, --subnet will be ignored": "", "1) Recreate the cluster with Kubernetes {{.new}}, by running:\n\t \n\t\t minikube delete{{.profile}}\n\t\t minikube start{{.profile}} --kubernetes-version={{.prefix}}{{.new}}\n\t \n\t\t2) Create a second cluster with Kubernetes {{.new}}, by running:\n\t \n\t\t minikube start -p {{.suggestedName}} --kubernetes-version={{.prefix}}{{.new}}\n\t \n\t\t3) Use the existing cluster at version Kubernetes {{.old}}, by running:\n\t \n\t\t minikube start{{.profile}} --kubernetes-version={{.prefix}}{{.old}}\n\t\t": "", @@ -991,14 +991,14 @@ "minikube is not meant for production use. You are opening non-local traffic": "", "minikube is unable to access the Google Container Registry. You may need to configure it to use a HTTP proxy.": "", "minikube is unable to connect to the VM: {{.error}}\n\n\tThis is likely due to one of two reasons:\n\n\t- VPN or firewall interference\n\t- {{.hypervisor}} network configuration issue\n\n\tSuggested workarounds:\n\n\t- Disable your local VPN or firewall software\n\t- Configure your local VPN or firewall to allow access to {{.ip}}\n\t- Restart or reinstall {{.hypervisor}}\n\t- Use an alternative --vm-driver\n\t- Use --force to override this connectivity check\n\t": "", - "minikube mount is not currently implemented with the user network on QEMU": "", + "minikube mount is not currently implemented with the builtin network on QEMU": "", "minikube profile was successfully set to {{.profile_name}}": "", "minikube provisions and manages local Kubernetes clusters optimized for development workflows.": "minikube는 개발 워크플로우에 최적화된 로컬 쿠버네티스를 제공하고 관리합니다.", "minikube quickly sets up a local Kubernetes cluster": "", - "minikube service is not currently implemented with the user network on QEMU": "", + "minikube service is not currently implemented with the builtin network on QEMU": "", "minikube skips various validations when --force is supplied; this may lead to unexpected behavior": "", "minikube status --output OUTPUT. json, text": "", - "minikube tunnel is not currently implemented with the user network on QEMU": "", + "minikube tunnel is not currently implemented with the builtin network on QEMU": "", "minikube {{.version}} is available! Download it: {{.url}}": "minikube {{.version}} 이 사용가능합니다! 다음 경로에서 다운받으세요: {{.url}}", "mkcmp is used to compare performance of two minikube binaries": "", "mount argument \"{{.value}}\" must be in form: \u003csource directory\u003e:\u003ctarget directory\u003e": "", diff --git a/translations/pl.json b/translations/pl.json index 7f5424f83443..748221711772 100644 --- a/translations/pl.json +++ b/translations/pl.json @@ -27,7 +27,7 @@ "--container-runtime must be set to \"containerd\" or \"cri-o\" for rootless": "", "--kvm-numa-count range is 1-8": "", "--network flag is only valid with the docker/podman, KVM and Qemu drivers, it will be ignored": "", - "--network with QEMU must be 'user' or 'socket_vmnet'": "", + "--network with QEMU must be 'builtin' or 'socket_vmnet'": "", "--static-ip is only implemented on Docker and Podman drivers, flag will be ignored": "", "--static-ip overrides --subnet, --subnet will be ignored": "", "1) Recreate the cluster with Kubernetes {{.new}}, by running:\n\t \n\t\t minikube delete{{.profile}}\n\t\t minikube start{{.profile}} --kubernetes-version={{.prefix}}{{.new}}\n\t \n\t\t2) Create a second cluster with Kubernetes {{.new}}, by running:\n\t \n\t\t minikube start -p {{.suggestedName}} --kubernetes-version={{.prefix}}{{.new}}\n\t \n\t\t3) Use the existing cluster at version Kubernetes {{.old}}, by running:\n\t \n\t\t minikube start{{.profile}} --kubernetes-version={{.prefix}}{{.old}}\n\t\t": "", @@ -996,14 +996,14 @@ "minikube is not meant for production use. You are opening non-local traffic": "minikube nie jest przeznaczony do użycia w środowisku produkcyjnym. Otwierasz klaster na ruch nielokalny", "minikube is unable to access the Google Container Registry. You may need to configure it to use a HTTP proxy.": "uzyskanie dostępu do Google Container Registry poprzez minikube nie powiodło się. Możliwe, że musisz skonfigurować ustawienia proxy HTTP w minikube", "minikube is unable to connect to the VM: {{.error}}\n\n\tThis is likely due to one of two reasons:\n\n\t- VPN or firewall interference\n\t- {{.hypervisor}} network configuration issue\n\n\tSuggested workarounds:\n\n\t- Disable your local VPN or firewall software\n\t- Configure your local VPN or firewall to allow access to {{.ip}}\n\t- Restart or reinstall {{.hypervisor}}\n\t- Use an alternative --vm-driver\n\t- Use --force to override this connectivity check\n\t": "", - "minikube mount is not currently implemented with the user network on QEMU": "", + "minikube mount is not currently implemented with the builtin network on QEMU": "", "minikube profile was successfully set to {{.profile_name}}": "profil minikube został z powodzeniem zmieniony na: {{.profile_name}}", "minikube provisions and manages local Kubernetes clusters optimized for development workflows.": "minikube dostarcza lokalne klastry Kubernetesa zoptymalizowane do celów rozwoju oprogramowania oraz zarządza nimi", "minikube quickly sets up a local Kubernetes cluster": "minikube szybko inicjalizuje lokalny klaster Kubernetesa", - "minikube service is not currently implemented with the user network on QEMU": "", + "minikube service is not currently implemented with the builtin network on QEMU": "", "minikube skips various validations when --force is supplied; this may lead to unexpected behavior": "użycie flagi --force sprawia, że minikube pomija pewne walidacje, co może skutkować niespodziewanym zachowaniem", "minikube status --output OUTPUT. json, text": "", - "minikube tunnel is not currently implemented with the user network on QEMU": "", + "minikube tunnel is not currently implemented with the builtin network on QEMU": "", "minikube {{.version}} is available! Download it: {{.url}}": "minikube {{.version}} jest dostępne! Pobierz je z: {{.url}}", "mkcmp is used to compare performance of two minikube binaries": "", "mount argument \"{{.value}}\" must be in form: \u003csource directory\u003e:\u003ctarget directory\u003e": "", diff --git a/translations/ru.json b/translations/ru.json index 434642839909..9f7e3585bbc1 100644 --- a/translations/ru.json +++ b/translations/ru.json @@ -22,7 +22,7 @@ "--container-runtime must be set to \"containerd\" or \"cri-o\" for rootless": "", "--kvm-numa-count range is 1-8": "", "--network flag is only valid with the docker/podman, KVM and Qemu drivers, it will be ignored": "", - "--network with QEMU must be 'user' or 'socket_vmnet'": "", + "--network with QEMU must be 'builtin' or 'socket_vmnet'": "", "--static-ip is only implemented on Docker and Podman drivers, flag will be ignored": "", "--static-ip overrides --subnet, --subnet will be ignored": "", "1) Recreate the cluster with Kubernetes {{.new}}, by running:\n\t \n\t\t minikube delete{{.profile}}\n\t\t minikube start{{.profile}} --kubernetes-version={{.prefix}}{{.new}}\n\t \n\t\t2) Create a second cluster with Kubernetes {{.new}}, by running:\n\t \n\t\t minikube start -p {{.suggestedName}} --kubernetes-version={{.prefix}}{{.new}}\n\t \n\t\t3) Use the existing cluster at version Kubernetes {{.old}}, by running:\n\t \n\t\t minikube start{{.profile}} --kubernetes-version={{.prefix}}{{.old}}\n\t\t": "1) Пересоздайте кластер с Kubernetes {{.new}}, выполнив:\n\t \n\t\t minikube delete{{.profile}}\n\t\t minikube start{{.profile}} --kubernetes-version={{.prefix}}{{.new}}\n\t \n\t\t2) Создайье второй кластер с Kubernetes {{.new}}, выполнив:\n\t \n\t\t minikube start -p {{.suggestedName}} --kubernetes-version={{.prefix}}{{.new}}\n\t \n\t\t3) Используйте существующий кластер с версией Kubernetes {{.old}}, выполнив:\n\t \n\t\t minikube start{{.profile}} --kubernetes-version={{.prefix}}{{.old}}\n\t\t", @@ -915,14 +915,14 @@ "minikube is not meant for production use. You are opening non-local traffic": "", "minikube is unable to access the Google Container Registry. You may need to configure it to use a HTTP proxy.": "", "minikube is unable to connect to the VM: {{.error}}\n\n\tThis is likely due to one of two reasons:\n\n\t- VPN or firewall interference\n\t- {{.hypervisor}} network configuration issue\n\n\tSuggested workarounds:\n\n\t- Disable your local VPN or firewall software\n\t- Configure your local VPN or firewall to allow access to {{.ip}}\n\t- Restart or reinstall {{.hypervisor}}\n\t- Use an alternative --vm-driver\n\t- Use --force to override this connectivity check\n\t": "", - "minikube mount is not currently implemented with the user network on QEMU": "", + "minikube mount is not currently implemented with the builtin network on QEMU": "", "minikube profile was successfully set to {{.profile_name}}": "", "minikube provisions and manages local Kubernetes clusters optimized for development workflows.": "", "minikube quickly sets up a local Kubernetes cluster": "", - "minikube service is not currently implemented with the user network on QEMU": "", + "minikube service is not currently implemented with the builtin network on QEMU": "", "minikube skips various validations when --force is supplied; this may lead to unexpected behavior": "", "minikube status --output OUTPUT. json, text": "", - "minikube tunnel is not currently implemented with the user network on QEMU": "", + "minikube tunnel is not currently implemented with the builtin network on QEMU": "", "minikube {{.version}} is available! Download it: {{.url}}": "", "mkcmp is used to compare performance of two minikube binaries": "", "mount argument \"{{.value}}\" must be in form: \u003csource directory\u003e:\u003ctarget directory\u003e": "", diff --git a/translations/strings.txt b/translations/strings.txt index 7232ce983a1c..7405b1c2befc 100644 --- a/translations/strings.txt +++ b/translations/strings.txt @@ -22,7 +22,7 @@ "--container-runtime must be set to \"containerd\" or \"cri-o\" for rootless": "", "--kvm-numa-count range is 1-8": "", "--network flag is only valid with the docker/podman, KVM and Qemu drivers, it will be ignored": "", - "--network with QEMU must be 'user' or 'socket_vmnet'": "", + "--network with QEMU must be 'builtin' or 'socket_vmnet'": "", "--static-ip is only implemented on Docker and Podman drivers, flag will be ignored": "", "--static-ip overrides --subnet, --subnet will be ignored": "", "1) Recreate the cluster with Kubernetes {{.new}}, by running:\n\t \n\t\t minikube delete{{.profile}}\n\t\t minikube start{{.profile}} --kubernetes-version={{.prefix}}{{.new}}\n\t \n\t\t2) Create a second cluster with Kubernetes {{.new}}, by running:\n\t \n\t\t minikube start -p {{.suggestedName}} --kubernetes-version={{.prefix}}{{.new}}\n\t \n\t\t3) Use the existing cluster at version Kubernetes {{.old}}, by running:\n\t \n\t\t minikube start{{.profile}} --kubernetes-version={{.prefix}}{{.old}}\n\t\t": "", @@ -915,14 +915,14 @@ "minikube is not meant for production use. You are opening non-local traffic": "", "minikube is unable to access the Google Container Registry. You may need to configure it to use a HTTP proxy.": "", "minikube is unable to connect to the VM: {{.error}}\n\n\tThis is likely due to one of two reasons:\n\n\t- VPN or firewall interference\n\t- {{.hypervisor}} network configuration issue\n\n\tSuggested workarounds:\n\n\t- Disable your local VPN or firewall software\n\t- Configure your local VPN or firewall to allow access to {{.ip}}\n\t- Restart or reinstall {{.hypervisor}}\n\t- Use an alternative --vm-driver\n\t- Use --force to override this connectivity check\n\t": "", - "minikube mount is not currently implemented with the user network on QEMU": "", + "minikube mount is not currently implemented with the builtin network on QEMU": "", "minikube profile was successfully set to {{.profile_name}}": "", "minikube provisions and manages local Kubernetes clusters optimized for development workflows.": "", "minikube quickly sets up a local Kubernetes cluster": "", - "minikube service is not currently implemented with the user network on QEMU": "", + "minikube service is not currently implemented with the builtin network on QEMU": "", "minikube skips various validations when --force is supplied; this may lead to unexpected behavior": "", "minikube status --output OUTPUT. json, text": "", - "minikube tunnel is not currently implemented with the user network on QEMU": "", + "minikube tunnel is not currently implemented with the builtin network on QEMU": "", "minikube {{.version}} is available! Download it: {{.url}}": "", "mkcmp is used to compare performance of two minikube binaries": "", "mount argument \"{{.value}}\" must be in form: \u003csource directory\u003e:\u003ctarget directory\u003e": "", diff --git a/translations/zh-CN.json b/translations/zh-CN.json index 6ccfb22dac43..2afa05c8a5ba 100644 --- a/translations/zh-CN.json +++ b/translations/zh-CN.json @@ -30,7 +30,7 @@ "--kvm-numa-count range is 1-8": "--kvm-numa-count 取值范围为 1-8", "--network flag is only valid with the docker/podman and KVM drivers, it will be ignored": "--network 标识仅对 docker/podman 和 KVM 驱动程序有效,它将被忽略", "--network flag is only valid with the docker/podman, KVM and Qemu drivers, it will be ignored": "", - "--network with QEMU must be 'user' or 'socket_vmnet'": "", + "--network with QEMU must be 'builtin' or 'socket_vmnet'": "", "--static-ip is only implemented on Docker and Podman drivers, flag will be ignored": "", "--static-ip overrides --subnet, --subnet will be ignored": "", "1) Recreate the cluster with Kubernetes {{.new}}, by running:\n\t \n\t\t minikube delete{{.profile}}\n\t\t minikube start{{.profile}} --kubernetes-version={{.prefix}}{{.new}}\n\t \n\t\t2) Create a second cluster with Kubernetes {{.new}}, by running:\n\t \n\t\t minikube start -p {{.suggestedName}} --kubernetes-version={{.prefix}}{{.new}}\n\t \n\t\t3) Use the existing cluster at version Kubernetes {{.old}}, by running:\n\t \n\t\t minikube start{{.profile}} --kubernetes-version={{.prefix}}{{.old}}\n\t\t": "", @@ -1106,14 +1106,14 @@ "minikube is unable to access the Google Container Registry. You may need to configure it to use a HTTP proxy.": "", "minikube is unable to connect to the VM: {{.error}}\n\n\tThis is likely due to one of two reasons:\n\n\t- VPN or firewall interference\n\t- {{.hypervisor}} network configuration issue\n\n\tSuggested workarounds:\n\n\t- Disable your local VPN or firewall software\n\t- Configure your local VPN or firewall to allow access to {{.ip}}\n\t- Restart or reinstall {{.hypervisor}}\n\t- Use an alternative --vm-driver\n\t- Use --force to override this connectivity check\n\t": "", "minikube is unable to connect to the VM: {{.error}}\n\nThis is likely due to one of two reasons:\n\n- VPN or firewall interference\n- {{.hypervisor}} network configuration issue\n\nSuggested workarounds:\n\n- Disable your local VPN or firewall software\n- Configure your local VPN or firewall to allow access to {{.ip}}\n- Restart or reinstall {{.hypervisor}}\n- Use an alternative --vm-driver": "minikube 无法连接到虚拟机:{{.error}}\n\n可能是由于以下两个原因之一导致:\n\n-VPN 或防火墙冲突\n- {{.hypervisor}} 网络配置问题\n建议的方案:\n\n- 禁用本地的 VPN 或者防火墙软件\n- 配置本地 VPN 或防火墙软件,放行 {{.ip}}\n- 重启或者重装 {{.hypervisor}}\n- 使用另外的 --vm-driver", - "minikube mount is not currently implemented with the user network on QEMU": "", + "minikube mount is not currently implemented with the builtin network on QEMU": "", "minikube profile was successfully set to {{.profile_name}}": "", "minikube provisions and manages local Kubernetes clusters optimized for development workflows.": "", "minikube quickly sets up a local Kubernetes cluster": "", - "minikube service is not currently implemented with the user network on QEMU": "", + "minikube service is not currently implemented with the builtin network on QEMU": "", "minikube skips various validations when --force is supplied; this may lead to unexpected behavior": "", "minikube status --output OUTPUT. json, text": "", - "minikube tunnel is not currently implemented with the user network on QEMU": "", + "minikube tunnel is not currently implemented with the builtin network on QEMU": "", "minikube {{.version}} is available! Download it: {{.url}}": "", "mkcmp is used to compare performance of two minikube binaries": "mkcmp 用于对比两个 minikube 二进制的性能", "mount argument \"{{.value}}\" must be in form: \u003csource directory\u003e:\u003ctarget directory\u003e": "", From c721b056fc16e14048be95266837785cb205078a Mon Sep 17 00:00:00 2001 From: Om Saran Date: Tue, 21 Feb 2023 20:05:41 -0600 Subject: [PATCH 5/5] Make table and json output consistent --- cmd/minikube/cmd/service_list.go | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/cmd/minikube/cmd/service_list.go b/cmd/minikube/cmd/service_list.go index edca0574927a..b8fcfb7e6f4e 100644 --- a/cmd/minikube/cmd/service_list.go +++ b/cmd/minikube/cmd/service_list.go @@ -57,7 +57,7 @@ var serviceListCmd = &cobra.Command{ case "table": printServicesTable(serviceURLs, co) case "json": - printServicesJSON(serviceURLs) + printServicesJSON(serviceURLs, co) default: exit.Message(reason.Usage, fmt.Sprintf("invalid output format: %s. Valid values: 'table', 'json'", output)) } @@ -85,8 +85,20 @@ func printServicesTable(serviceURLs service.URLs, co mustload.ClusterController) service.PrintServiceList(os.Stdout, data) } -func printServicesJSON(serviceURLs service.URLs) { - jsonString, _ := json.Marshal(serviceURLs) +func printServicesJSON(serviceURLs service.URLs, co mustload.ClusterController) { + processedServiceURLs := serviceURLs + + if runtime.GOOS == "darwin" && co.Config.Driver == oci.Docker { + // To ensure we don't modify the original serviceURLs + processedServiceURLs = make(service.URLs, len(serviceURLs)) + copy(processedServiceURLs, serviceURLs) + + for idx := range processedServiceURLs { + processedServiceURLs[idx].URLs = make([]string, 0) + } + } + + jsonString, _ := json.Marshal(processedServiceURLs) os.Stdout.Write(jsonString) }