Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Organize new kyma CLI commands around provisioning domain #2029

Closed
kwiatekus opened this issue Apr 3, 2024 · 5 comments
Closed

Organize new kyma CLI commands around provisioning domain #2029

kwiatekus opened this issue Apr 3, 2024 · 5 comments
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@kwiatekus
Copy link
Contributor

kwiatekus commented Apr 3, 2024

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 kwiatekus changed the title Organize new kyma CLI commands Organize new kyma CLI commands tree Apr 3, 2024
@halamix2
Copy link
Member

halamix2 commented Apr 4, 2024

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

@kwiatekus
Copy link
Contributor Author

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 kwiatekus changed the title Organize new kyma CLI commands tree Organize new kyma CLI commands around provisioning domain Apr 15, 2024
@kwiatekus
Copy link
Contributor Author

Copy link

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 github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 18, 2024
Copy link

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

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 26, 2024
@kyma-bot kyma-bot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

3 participants