EKS

package
v1.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 3, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AwsxEksConfigCmd = &cobra.Command{
	Use:   "getEksConfig",
	Short: "getEksConfig command gets eks configuration",
	Long:  `getEksConfig command gets eks configuration`,

	Run: func(cmd *cobra.Command, args []string) {
		fmt.Println("executing getEksConfig command")
		var authFlag, clientAuth, err = authenticate.AuthenticateCommand(cmd)
		if err != nil {
			log.Printf("error during authentication: %v\n", err)
			err := cmd.Help()
			if err != nil {
				return
			}
			return
		}
		if authFlag {
			clusterName, _ := cmd.Flags().GetString("clusterName")
			if clusterName == "" {
				log.Printf("eks cluster name missing")
				err := cmd.Help()
				if err != nil {
					return
				}
				return
			}
			instances, err := GetEksInstanceByClusterName(clusterName, clientAuth, nil)
			if err != nil {
				log.Println("error getting getEksConfig by instance id: ", err)
				return
			}
			fmt.Println(instances)
		}
	},
}
View Source
var AwsxEksListCmd = &cobra.Command{
	Use:   "getEksList",
	Short: "getEksList command gets list of eks instances of an aws account",
	Long:  `getEksList command gets list of eks instances of an aws account`,

	Run: func(cmd *cobra.Command, args []string) {
		fmt.Println("executing getEksList command")
		var authFlag, clientAuth, err = authenticate.AuthenticateCommand(cmd)
		if err != nil {
			log.Printf("error during authentication: %v\n", err)
			err := cmd.Help()
			if err != nil {
				return
			}
			return
		}
		if authFlag {
			resp, err := ListEksInstances(clientAuth, nil)
			if err != nil {
				log.Println("error getting getEksList: ", err)
				return
			}
			fmt.Println(resp)
		}
	},
}

Functions

func GetEksInstanceByClusterName

func GetEksInstanceByClusterName(clusterName string, clientAuth *model.Auth, client *eks.EKS) (*eks.DescribeClusterOutput, error)

func ListEksInstances

func ListEksInstances(clientAuth *model.Auth, client *eks.EKS) ([]*eks.DescribeClusterOutput, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL