cli icon indicating copy to clipboard operation
cli copied to clipboard

Organize new kyma CLI commands around provisioning domain

Open kwiatekus opened this issue 1 year ago • 3 comments

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 provision does create binding but ./kyma-cli reference-instance doesnt
  • 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?

kwiatekus avatar Apr 03 '24 14:04 kwiatekus

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)
	}
}

halamix2 avatar Apr 04 '24 06:04 halamix2

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

kwiatekus avatar Apr 04 '24 11:04 kwiatekus

https://github.com/kyma-project/community/issues/872

kwiatekus avatar Apr 18 '24 08:04 kwiatekus

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.

github-actions[bot] avatar Jun 18 '24 00:06 github-actions[bot]

This issue has been automatically closed due to the lack of recent activity. /lifecycle rotten

github-actions[bot] avatar Jun 26 '24 00:06 github-actions[bot]