Organize new kyma CLI commands around provisioning domain
Description
Design command tree structure for the new cli commands used to provision kyma, provision service instances (i.e any, or more specialised hana and reference)
Include possibility for more generic commands
Reason Organize an untangle current puzzles:
-
./kyma-cli hana provisiondoes create binding but./kyma-cli reference-instancedoesnt - As a kyma cli user I want to create reference instance to existing shared hana instance and bind it - how do I do that now?
for reading data from ENVs (e.g. KUBECONFIG) we have a working code snippet that uses VIper, we could use
Working Viper snippet for working with ENVs
package main
import (
"fmt"
"os"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
type Config struct {
Kubeconfig string `mapstructure:"kubeconfig"`
}
func main() {
config := Config{}
cmd := cobra.Command{
Use: "kyma",
PreRun: func(_ *cobra.Command, _ []string) {
err := viper.Unmarshal(&config)
if err != nil {
fmt.Println(err.Error())
os.Exit(3)
}
},
Run: func(_ *cobra.Command, _ []string) {
fmt.Println(config.Kubeconfig)
},
}
viper.AutomaticEnv()
cmd.Flags().StringVar(&config.Kubeconfig, "kubeconfig", "", "Path to the Kyma kubeconfig file.")
_ = viper.BindPFlag("kubeconfig", cmd.Flags().Lookup("kubeconfig"))
if err := cmd.Execute(); err != nil {
fmt.Println(err.Error())
os.Exit(1)
}
}
Assume the following usage scenario
- create kyma instance
- create hana instance & bind hana instance
- create any service instance (i.e
object store) & bind object store instance - push images & deploy application
- deprovision hana
- deprovision objectstore
- deprovision kyma
https://github.com/kyma-project/community/issues/872
This issue has been automatically marked as stale due to the lack of recent activity. It will soon be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically closed due to the lack of recent activity. /lifecycle rotten