Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
67b17a1
Improve hints
grego952 Nov 21, 2025
90d11e0
Merge branch 'main' into improve-hints
grego952 Nov 24, 2025
520a8e9
Merge branch 'main' into improve-hints
grego952 Dec 1, 2025
6657374
Improve the remaining messages
grego952 Dec 2, 2025
7d11485
Merge branch 'main' into improve-hints
grego952 Dec 2, 2025
b06f831
Fix tests
grego952 Dec 2, 2025
0675a8c
Merge branch 'improve-hints' of https://github.com/grego952/cli into …
grego952 Dec 2, 2025
ed0d7df
Merge branch 'main' into improve-hints
grego952 Dec 2, 2025
be3e4a5
Fix tests
grego952 Dec 2, 2025
bb142b4
Merge branch 'main' into improve-hints
grego952 Dec 2, 2025
74a5976
Fix tests continues
grego952 Dec 3, 2025
b0a181a
Merge branch 'main' into improve-hints
grego952 Dec 3, 2025
06df48b
Merge branch 'main' of https://github.com/kyma-project/cli into impro…
grego952 Dec 3, 2025
c027f87
Merge branch 'improve-hints' of https://github.com/grego952/cli into …
grego952 Dec 3, 2025
106ca90
Improve hints
grego952 Nov 21, 2025
d9d9a1a
Improve the remaining messages
grego952 Dec 2, 2025
4a7a8ce
Fix tests
grego952 Dec 2, 2025
89ac395
Added ServiceAccount namespace option for authorize cmd (#2753)
musztardem Dec 1, 2025
345299a
gomod(deps): bump github.com/google/go-containerregistry from 0.20.6 …
dependabot[bot] Dec 2, 2025
1d02ef0
gomod(deps): bump github.com/docker/cli from 29.0.3+incompatible to 2…
dependabot[bot] Dec 2, 2025
8030530
gomod(deps): bump the k8s-io group with 3 updates (#2758)
dependabot[bot] Dec 2, 2025
0121d10
Fix tests
grego952 Dec 2, 2025
cff9af5
gomod(deps): bump github.com/buildpacks/pack from 0.38.2 to 0.39.0 (#…
dependabot[bot] Dec 2, 2025
f1aa4e7
Fix tests continues
grego952 Dec 3, 2025
358325b
Improve `module delete` example (#2764)
pPrecel Dec 3, 2025
5d2192e
add filtering istio messages by level (#2756)
anoipm Dec 3, 2025
4447550
Merge branch 'improve-hints' of https://github.com/grego952/cli into …
grego952 Dec 3, 2025
fe8a9ba
Fix hints
grego952 Dec 3, 2025
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
8 changes: 4 additions & 4 deletions internal/authorization/rbacbuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,19 +133,19 @@ func (b *RBACBuilder) validateForRoleBinding() clierror.Error {
return clierror.New("subjectName is required")
}
if b.role == "" && b.clusterrole == "" {
return clierror.New("either role or clusterrole must be specified for RoleBinding")
return clierror.New("specify either Role or ClusterRole for RoleBinding")
}
if b.role != "" && b.clusterrole != "" {
return clierror.New("cannot specify both role and clusterrole for RoleBinding")
return clierror.New("cannot specify both Role and ClusterRole for RoleBinding")
}
if b.namespace == "" && b.clusterrole != "" {
return clierror.New(
fmt.Sprintf("failed to apply binding for the '%s' ClusterRole", b.clusterrole),
"either specify a namespace or enable cluster-wide flag for ClusterRoleBinding",
"either specify a namespace or enable the cluster-wide flag for ClusterRoleBinding",
)
}
if b.namespace == "" {
return clierror.New("namespace is required for RoleBinding")
return clierror.New("provide namespace for RoleBinding")
}
if b.subjectKind != nil && b.subjectKind.name == SERVICE_ACCOUNT && b.namespace == "" && b.serviceAccountNamespace == "" {
return clierror.New("namespace is required for ServiceAccount subject")
Expand Down
6 changes: 3 additions & 3 deletions internal/authorization/rbacbuilder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ func TestRBACBuilder_BuildRoleBinding(t *testing.T) {
ForSubjectName("owner/repo").
ForNamespace("default")
},
expectedError: "either role or clusterrole must be specified for RoleBinding",
expectedError: "specify either Role or ClusterRole for RoleBinding",
},
{
name: "error when both role and clusterrole are specified",
Expand All @@ -243,7 +243,7 @@ func TestRBACBuilder_BuildRoleBinding(t *testing.T) {
ForClusterRole("cluster-admin").
ForNamespace("default")
},
expectedError: "cannot specify both role and clusterrole for RoleBinding",
expectedError: "cannot specify both Role and ClusterRole for RoleBinding",
},
{
name: "error when namespace is missing",
Expand All @@ -254,7 +254,7 @@ func TestRBACBuilder_BuildRoleBinding(t *testing.T) {
ForSubjectName("owner/repo").
ForRole("reader")
},
expectedError: "namespace is required for RoleBinding",
expectedError: "provide namespace for RoleBinding",
},
{
name: "successful build for ServiceAccount",
Expand Down
4 changes: 2 additions & 2 deletions internal/cmd/alpha/hana/map.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ func runHanaMap(config *hanaMapConfig) clierror.Error {
func getClusterID(ctx context.Context, client kubernetes.Interface) (string, clierror.Error) {
secret, geterr := client.CoreV1().Secrets("kyma-system").Get(ctx, "sap-btp-manager", metav1.GetOptions{})
if geterr != nil {
return "", clierror.Wrap(geterr, clierror.New("failed to get secret kyma-system/sap-btp-manager"))
return "", clierror.Wrap(geterr, clierror.New("failed to get Secret kyma-system/sap-btp-manager"))
}

if secret.Data["cluster_id"] == nil {
return "", clierror.New("cluster_id not found in the secret kyma-system/sap-btp-manager")
return "", clierror.New("cluster_id not found in the Secret kyma-system/sap-btp-manager")
}

return string(secret.Data["cluster_id"]), nil
Expand Down
4 changes: 2 additions & 2 deletions internal/cmd/alpha/kubeconfig/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ func (cfg *generateConfig) validate() clierror.Error {
// check if request token is provided
return clierror.New(
"ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable is required if --id-token-request-url flag or ACTIONS_ID_TOKEN_REQUEST_URL env were provided",
"make sure you're running the command in Github Actions environment",
"make sure you're running the command in the GitHub Actions environment",
)
}
if cfg.server != "" && (cfg.ca == "" && cfg.caData == "") {
Expand Down Expand Up @@ -324,7 +324,7 @@ func setupServiceAccountWithBindings(cfg *generateConfig, kubeClient kube.Client
if cfg.permanent {
err = resources.CreateServiceAccountToken(cfg.Ctx, kubeClient, cfg.serviceAccount, cfg.namespace)
if err != nil {
return clierror.Wrap(err, clierror.New("failed to create secret"))
return clierror.Wrap(err, clierror.New("failed to create Secret"))
}
}
return nil
Expand Down
4 changes: 2 additions & 2 deletions internal/cmd/alpha/provision/provision.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func runProvision(config *provisionConfig) clierror.Error {

kymaParameters, err := buildParameters(config)
if err != nil {
return clierror.WrapE(err, clierror.New("failed to prepare kyma parameters"))
return clierror.WrapE(err, clierror.New("failed to prepare Kyma parameters"))
}

ProvisionEnvironment := &cis.ProvisionEnvironment{
Expand All @@ -93,7 +93,7 @@ func runProvision(config *provisionConfig) clierror.Error {

response, err := localCISClient.Provision(ProvisionEnvironment)
if err != nil {
return clierror.WrapE(err, clierror.New("failed to provision kyma runtime"))
return clierror.WrapE(err, clierror.New("failed to provision Kyma runtime"))
}

out.Msgfln("Kyma environment provisioning, environment name: '%s', id: '%s'", response.Name, response.ID)
Expand Down
20 changes: 10 additions & 10 deletions internal/cmd/app/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ func (apc *appPushConfig) complete() clierror.Error {
apc.dockerfileSrcContext, err = os.Getwd()
if err != nil {
return clierror.Wrap(err, clierror.New("failed to get current working directory",
"Please provide the path to the dockerfile context using --dockerfile-context flag"))
"Provide the path to the Dockerfile context using --dockerfile-context flag"))
}
}
}
Expand Down Expand Up @@ -233,7 +233,7 @@ func runAppPush(cfg *appPushConfig) clierror.Error {
out.Msgfln("\nCreating service %s/%s", cfg.namespace, cfg.name)
err := resources.CreateService(cfg.Ctx, client, cfg.name, cfg.namespace, int32(*cfg.containerPort.Value))
if err != nil {
return clierror.Wrap(err, clierror.New("failed to create service"))
return clierror.Wrap(err, clierror.New("failed to create Service"))
}
}

Expand All @@ -243,20 +243,20 @@ func runAppPush(cfg *appPushConfig) clierror.Error {

err := resources.CreateAPIRule(cfg.Ctx, client.RootlessDynamic(), cfg.name, cfg.namespace, cfg.name, uint32(*cfg.containerPort.Value))
if err != nil {
return clierror.Wrap(err, clierror.New("failed to create API Rule resource", "Make sure API Gateway module is installed", "Make sure APIRule CRD is available in v2 version"))
return clierror.Wrap(err, clierror.New("failed to create the APIRule resource", "Make sure the API Gateway module is installed", "Make sure APIRule CRD is available in the v2 version"))
}

// try to get domain from resulting virtual service
// Check if the user can watch virtualservices
authRes, authErr := resources.CreateSelfSubjectAccessReview(cfg.Ctx, client, "watch", "virtualservices", cfg.namespace, "networking.istio.io")

if authErr != nil {
return clierror.Wrap(authErr, clierror.New("failed to check permissions to get virtualservices"))
return clierror.Wrap(authErr, clierror.New("failed to check permissions to get VirtualServices"))
}
if authRes.Status.Allowed {
url, clierr = client.Istio().GetHostFromVirtualServiceByApiruleName(cfg.Ctx, cfg.name, cfg.namespace)
if clierr != nil {
return clierror.WrapE(clierr, clierror.New("failed to get host address of ApiRule's Virtual Service"))
return clierror.WrapE(clierr, clierror.New("failed to get host address of APIRule's VirtualService"))
}
}

Expand All @@ -272,12 +272,12 @@ func runAppPush(cfg *appPushConfig) clierror.Error {
func createDeployment(cfg *appPushConfig, client kube.Client, image, imagePullSecret string) clierror.Error {
configmapEnvs, err := envs.BuildFromConfigmap(cfg.Ctx, client, cfg.namespace, cfg.configmapEnvs)
if err != nil {
return clierror.Wrap(err, clierror.New("failed to build envs from configmap"))
return clierror.Wrap(err, clierror.New("failed to build envs from ConfigMap"))
}

secretEnvs, err := envs.BuildFromSecret(cfg.Ctx, client, cfg.namespace, cfg.secretEnvs)
if err != nil {
return clierror.Wrap(err, clierror.New("failed to build envs from secret"))
return clierror.Wrap(err, clierror.New("failed to build envs from Secret"))
}

fileEnvs, err := envs.BuildFromFile(cfg.fileEnvs)
Expand Down Expand Up @@ -307,7 +307,7 @@ func createDeployment(cfg *appPushConfig, client kube.Client, image, imagePullSe
Insecure: cfg.insecure,
})
if err != nil {
return clierror.Wrap(err, clierror.New("failed to create deployment"))
return clierror.Wrap(err, clierror.New("failed to create Deployment"))
}

return nil
Expand All @@ -317,7 +317,7 @@ func buildAndImportImage(client kube.Client, cfg *appPushConfig, registryConfig
out.Msgln("Building image\n")
imageName, err := buildImage(cfg)
if err != nil {
return "", clierror.Wrap(err, clierror.New("failed to build image from dockerfile"))
return "", clierror.Wrap(err, clierror.New("failed to build image from Dockerfile"))
}

pushFunc := registry.NewPushWithPortforwardFunc(
Expand Down Expand Up @@ -346,7 +346,7 @@ func buildAndImportImage(client kube.Client, cfg *appPushConfig, registryConfig
pushFunc,
)
if cliErr != nil {
return "", clierror.WrapE(cliErr, clierror.New("failed to import image to in-cluster docker registry"))
return "", clierror.WrapE(cliErr, clierror.New("failed to import image to the in-cluster Docker registry"))
}

return pushedImage, nil
Expand Down
4 changes: 2 additions & 2 deletions internal/cmd/module/manage.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func manageModuleMissingInKyma(cfg *manageConfig, client kube.Client) clierror.E
return nil
}
if !errors.Is(err, modules.ErrModuleInstalledVersionNotInKymaChannel) {
return clierror.Wrap(err, clierror.New("failed to set module as managed"))
return clierror.Wrap(err, clierror.New("failed to set the module as managed"))
}

// If not found, prompt for alternative channel
Expand Down Expand Up @@ -134,7 +134,7 @@ func promptForAlternativeChannel(channelsAndVersions map[string]string) (string,
}

out.Msgln("The version of the module you have installed is not available in the default Kyma channel.")
out.Msgln("To proceed, please select one of the available channels below to manage the module with the desired version.")
out.Msgln("To proceed, select one of the available channels below to manage the module with the desired version.")

channelPrompt := prompt.NewOneOfEnumList("Available versions:\n", "Type the option number: ", channelOpts)
selectedChannel, err := channelPrompt.Prompt()
Expand Down
4 changes: 2 additions & 2 deletions internal/cmd/module/unmanage.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ func runUnmanage(cfg *unmanageConfig) clierror.Error {

err := client.Kyma().UnmanageModule(cfg.Ctx, cfg.module)
if err != nil {
return clierror.Wrap(err, clierror.New("failed to set module as unmanaged"))
return clierror.Wrap(err, clierror.New("failed to set the module as unmanaged"))
}

err = client.Kyma().WaitForModuleState(cfg.Ctx, cfg.module, "Unmanaged")
if err != nil {
return clierror.Wrap(err, clierror.New("failed to check module state"))
return clierror.Wrap(err, clierror.New("failed to check the module state"))
}

out.Msgfln("Module %s set to unmanaged", cfg.module)
Expand Down
2 changes: 1 addition & 1 deletion internal/cmdcommon/kubeconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func (kcc *kubeClientConfig) GetKubeClient() (kube.Client, error) {
func (kcc *kubeClientConfig) GetKubeClientWithClierr() (kube.Client, clierror.Error) {
if kcc.kubeClientErr != nil {
return nil, clierror.Wrap(kcc.kubeClientErr,
clierror.New("failed to create connection with the target Kyma environment", "Make sure that kubeconfig is proper."),
clierror.New("failed to create connection with the target Kyma environment", "Make sure that kubeconfig is correct."),
)
}

Expand Down
8 changes: 4 additions & 4 deletions internal/extensions/actions/call_files_to_save.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ type callFilesToSaveConfig struct {

func (c *callFilesToSaveConfig) validate() clierror.Error {
if c.TargetPod.Namespace == "" {
return clierror.New("empty target pod namespace")
return clierror.New("empty target Pod namespace")
}
if c.TargetPod.Selector == nil {
return clierror.New("empty target pod selector")
return clierror.New("empty target Pod selector")
}
if c.TargetPod.Port == "" {
return clierror.New("empty target pod port")
return clierror.New("empty target Pod port")
}
if c.TargetPod.Path == "" {
return clierror.New("empty target pod path")
return clierror.New("empty target Pod path")
}
if c.OutputDir == "" {
return clierror.New("empty output directory path")
Expand Down
2 changes: 1 addition & 1 deletion internal/extensions/actions/common/configurator.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func (c *TemplateConfigurator[T]) Configure(cfgTmpl types.ActionConfig, overwrit
clierr := c.configure(cfgTmpl, overwrites)
if clierr != nil {
return clierror.WrapE(clierr, clierror.New("failed to configure action",
"make sure the cli version is compatible with the extension"))
"make sure the CLI version is compatible with the extension"))
}

return nil
Expand Down
6 changes: 3 additions & 3 deletions internal/extensions/actions/function_init.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ func (c *functionInitActionConfig) validate() clierror.Error {
if !filepath.IsLocal(runtimeCfg.DepsFilename) {
return clierror.New(
fmt.Sprintf("invalid dependency filename %s for runtime %s", runtimeCfg.DepsFilename, runtimeName),
"dependency filename must be a local path or single file name",
"dependency filename must be a local path or a single file name",
)
}

if !filepath.IsLocal(runtimeCfg.HandlerFilename) {
return clierror.New(
fmt.Sprintf("invalid handler filename %s for runtime %s", runtimeCfg.HandlerFilename, runtimeName),
"handler filename must be a local path or single file name",
"handler filename must be a local path or a single file name",
)
}
}
Expand Down Expand Up @@ -138,6 +138,6 @@ func getOutputDirAcceptance(path string) clierror.Error {

return clierror.New(
"command execution aborted",
"you must provide a local path for the output directory or accept the default one by typing 'y' and pressing enter",
"provide a local path for the output directory or accept the default one by typing 'y' and pressing enter",
)
}
2 changes: 1 addition & 1 deletion internal/extensions/actions/registry_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (a *registryConfigAction) Run(cmd *cobra.Command, _ []string) clierror.Erro
if a.Cfg.Output != "" {
writeErr := os.WriteFile(a.Cfg.Output, []byte(outputString), 0600)
if writeErr != nil {
return clierror.New("failed to write docker config to file")
return clierror.New("failed to write the Docker config to file")
}
return nil
}
Expand Down
4 changes: 2 additions & 2 deletions internal/extensions/actions/registry_image-import.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type registryImageImportActionConfig struct {
func (c *registryImageImportActionConfig) validate() clierror.Error {
imageElems := strings.Split(c.Image, ":")
if len(imageElems) != 2 {
return clierror.New(fmt.Sprintf("image '%s' not in expected format 'image:tag'", c.Image))
return clierror.New(fmt.Sprintf("image '%s' not in the expected format 'image:tag'", c.Image))
}

return nil
Expand Down Expand Up @@ -81,7 +81,7 @@ func (a *registryImageImportAction) Run(cmd *cobra.Command, _ []string) clierror
pushFunc,
)
if err != nil {
return clierror.WrapE(err, clierror.New("failed to import image to in-cluster docker registry"))
return clierror.WrapE(err, clierror.New("failed to import the image to the in-cluster Docker registry"))
}

pullImageName := fmt.Sprintf("%s/%s", registryConfig.SecretData.PullRegAddr, pushedImage)
Expand Down
4 changes: 2 additions & 2 deletions internal/extensions/call/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (c *PodCaller) Call(method, path string, parameters map[string]string) ([]b
c.podSelector,
)
if err != nil {
return nil, clierror.Wrap(err, clierror.New("failed to get target pod"))
return nil, clierror.Wrap(err, clierror.New("failed to get target Pod"))
}

req, err := buildRequest(method, targetPod.GetName(), targetPod.GetNamespace(), c.podPort, path, parameters)
Expand All @@ -53,7 +53,7 @@ func (c *PodCaller) Call(method, path string, parameters map[string]string) ([]b
req,
)
if err != nil {
return nil, clierror.Wrap(err, clierror.New("failed to send request to target pod"))
return nil, clierror.Wrap(err, clierror.New("failed to send request to target Pod"))
}
defer resp.Body.Close()

Expand Down
2 changes: 1 addition & 1 deletion internal/extensions/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var (
emptyActionRun = func(cmd *cobra.Command, _ []string) error { return cmd.Help() }
unsupportedActionRun = func(_ *cobra.Command, _ []string) {
clierror.Check(clierror.New("unsupported action",
"make sure the cli version is compatible with the extension"))
"make sure the CLI version is compatible with the extension"))
}
)

Expand Down
2 changes: 1 addition & 1 deletion internal/github/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func GetToken(url, requestToken, audience string) (string, clierror.Error) {

response, err := http.DefaultClient.Do(request)
if err != nil {
return "", clierror.Wrap(err, clierror.New("failed to get token from Github"))
return "", clierror.Wrap(err, clierror.New("failed to get token from GitHub"))
}
defer response.Body.Close()

Expand Down
2 changes: 1 addition & 1 deletion internal/github/token_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func Test_getGithubToken(t *testing.T) {
{
name: "wrong URL",
url: "doesnotexist",
wantedErr: clierror.Wrap(errors.New("Get \"doesnotexist\": unsupported protocol scheme \"\""), clierror.New("failed to get token from Github")),
wantedErr: clierror.Wrap(errors.New("Get \"doesnotexist\": unsupported protocol scheme \"\""), clierror.New("failed to get token from GitHub")),
},
{
name: "token request",
Expand Down
2 changes: 1 addition & 1 deletion internal/kubeconfig/kubeconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func Prepare(ctx context.Context, client kube.Client, name, namespace, time, out
var loopErr error
secret, loopErr = client.Static().CoreV1().Secrets(namespace).Get(ctx, name, metav1.GetOptions{})
if loopErr != nil {
return nil, clierror.Wrap(loopErr, clierror.New("failed to get secret"))
return nil, clierror.Wrap(loopErr, clierror.New("failed to get Secret"))
}
}

Expand Down
6 changes: 3 additions & 3 deletions internal/modules/disable.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ func disable(printer *out.Printer, ctx context.Context, client kube.Client, modu
return clierr
}

printer.Msgfln("removing %s module from the target Kyma environment", module)
printer.Msgfln("removing the %s module from the target Kyma environment", module)
err := client.Kyma().DisableModule(ctx, module)
if err != nil {
return clierror.Wrap(err, clierror.New("failed to disable module"))
return clierror.Wrap(err, clierror.New("failed to disable the module"))
}

printer.Msgfln("%s module disabled", module)
Expand All @@ -40,7 +40,7 @@ func disable(printer *out.Printer, ctx context.Context, client kube.Client, modu
func removeModuleCR(printer *out.Printer, ctx context.Context, client kube.Client, module string) clierror.Error {
info, err := client.Kyma().GetModuleInfo(ctx, module)
if err != nil {
return clierror.Wrap(err, clierror.New("failed to get module info from the target Kyma environment"))
return clierror.Wrap(err, clierror.New("failed to get the module info from the target Kyma environment"))
}

if info.Spec.CustomResourcePolicy == kyma.CustomResourcePolicyCreateAndDelete {
Expand Down
Loading
Loading