diff --git a/go.mod b/go.mod index 69f61bb783..baf76e79c0 100644 --- a/go.mod +++ b/go.mod @@ -283,7 +283,6 @@ require ( replace ( // Workflow plugin @ https://github.com/kiegroup/kie-tools/commit/d7d9c8f53e9525ad825d0910d5e1cb8b8e68b5d8 github.com/imdario/mergo => github.com/imdario/mergo v0.3.16 - github.com/kiegroup/kie-tools/packages/kn-plugin-workflow => github.com/kiegroup/kie-tools/packages/kn-plugin-workflow v0.28.1-0.20231005204834-d7d9c8f53e95 // K8s version lock k8s.io/api => k8s.io/api v0.26.9 k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.26.9 diff --git a/go.sum b/go.sum index 6a45a7bba8..39e6741396 100644 --- a/go.sum +++ b/go.sum @@ -617,8 +617,8 @@ github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dv github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= -github.com/kiegroup/kie-tools/packages/kn-plugin-workflow v0.28.1-0.20231005204834-d7d9c8f53e95 h1:OkLknMd0mm2qmfFIYZd4Mj7PvKK2lgDsG50Tt2lTsjA= -github.com/kiegroup/kie-tools/packages/kn-plugin-workflow v0.28.1-0.20231005204834-d7d9c8f53e95/go.mod h1:gFeW4Dnz1g5WOXuISjFcAwHfY2gpCcVzr7ruWSp4zQk= +github.com/kiegroup/kie-tools/packages/kn-plugin-workflow v0.32.0 h1:271P1mUC/sqm8f+a2xyXI5byAEnVzGpgqrHklys+XCI= +github.com/kiegroup/kie-tools/packages/kn-plugin-workflow v0.32.0/go.mod h1:gFeW4Dnz1g5WOXuISjFcAwHfY2gpCcVzr7ruWSp4zQk= github.com/kiegroup/kogito-serverless-operator/api v1.44.1 h1:pRwSNVefulFgsN7McyipCVgnkZ80fDKbWs7gb0ZtyjY= github.com/kiegroup/kogito-serverless-operator/api v1.44.1/go.mod h1:5BDk81IC8ink9DAqBVlHm5CjWDuDhzxzYz27mf6144A= github.com/kiegroup/kogito-serverless-operator/workflowproj v1.44.1 h1:j85PVxJMF1RPD1gdmW3S9LOjFVgWXUzbvCeOAJUO2gA= diff --git a/vendor/github.com/kiegroup/kie-tools/packages/kn-plugin-workflow/pkg/command/gen_manifest.go b/vendor/github.com/kiegroup/kie-tools/packages/kn-plugin-workflow/pkg/command/gen_manifest.go index 0884d2bd35..78b6980fb3 100644 --- a/vendor/github.com/kiegroup/kie-tools/packages/kn-plugin-workflow/pkg/command/gen_manifest.go +++ b/vendor/github.com/kiegroup/kie-tools/packages/kn-plugin-workflow/pkg/command/gen_manifest.go @@ -50,9 +50,10 @@ func NewGenManifest() *cobra.Command { SuggestFor: []string{"gen-manifests", "generate-manifest"}, //nolint:misspell } - cmd.Run = func(cmd *cobra.Command, args []string) { - generateManifestsCmd(cmd, args) + cmd.RunE = func(cmd *cobra.Command, args []string) error { + return generateManifestsCmd(cmd, args) } + cmd.Flags().StringP("namespace", "n", "", "Target namespace of your deployment.") cmd.Flags().StringP("manifestPath", "c", "", "Target directory of your generated Operator manifests.") cmd.Flags().StringP("supportFilesFolder", "s", "", "Specify a custom support files folder") @@ -72,8 +73,8 @@ func generateManifestsCmd(cmd *cobra.Command, args []string) error { fmt.Println("šŸ› ļøļø Generating a list of Operator manifests for a SonataFlow project...") fmt.Printf("šŸ“‚ Manifests will be generated in %s\n", cfg.ManifestPath) - if err := checkEnvironment(&cfg); err != nil { - return fmt.Errorf("āŒ ERROR: checking environment: %w", err) + if err := setupEnvironment(&cfg); err != nil { + return fmt.Errorf("āŒ ERROR: setup environment: %w", err) } if err := generateManifests(&cfg); err != nil { @@ -116,6 +117,25 @@ func runGenManifestCmdConfig(cmd *cobra.Command) (cfg DeployUndeployCmdConfig, e return cfg, nil } +func setupEnvironment(cfg *DeployUndeployCmdConfig) error { + fmt.Println("\nšŸ”Ž Checking your environment...") + + //setup namespace + if len(cfg.NameSpace) == 0 { + if defaultNamespace, err := common.GetKubectlNamespace(); err == nil { + cfg.NameSpace = defaultNamespace + fmt.Printf(" - āœ… resolved namespace: %s\n", cfg.NameSpace) + } else { + cfg.NameSpace = "default" + fmt.Printf(" - āœ… resolved namespace (default): %s\n", cfg.NameSpace) + } + } else { + fmt.Printf(" - āœ… resolved namespace: %s\n", cfg.NameSpace) + } + + return nil +} + func resolveManifestDir(folderName string) (string, error) { if folderName == "" { folderName = "manifests" diff --git a/vendor/modules.txt b/vendor/modules.txt index 0ce900dd92..ee104956f5 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -784,7 +784,7 @@ github.com/kelseyhightower/envconfig # github.com/kevinburke/ssh_config v1.2.0 ## explicit github.com/kevinburke/ssh_config -# github.com/kiegroup/kie-tools/packages/kn-plugin-workflow v0.32.0 => github.com/kiegroup/kie-tools/packages/kn-plugin-workflow v0.28.1-0.20231005204834-d7d9c8f53e95 +# github.com/kiegroup/kie-tools/packages/kn-plugin-workflow v0.32.0 ## explicit; go 1.20 github.com/kiegroup/kie-tools/packages/kn-plugin-workflow/pkg/command github.com/kiegroup/kie-tools/packages/kn-plugin-workflow/pkg/command/quarkus @@ -2273,7 +2273,6 @@ sigs.k8s.io/structured-merge-diff/v4/value ## explicit; go 1.12 sigs.k8s.io/yaml # github.com/imdario/mergo => github.com/imdario/mergo v0.3.16 -# github.com/kiegroup/kie-tools/packages/kn-plugin-workflow => github.com/kiegroup/kie-tools/packages/kn-plugin-workflow v0.28.1-0.20231005204834-d7d9c8f53e95 # k8s.io/api => k8s.io/api v0.26.9 # k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.26.9 # k8s.io/apimachinery => k8s.io/apimachinery v0.26.9