Documentation ¶
Index ¶
- Constants
- Variables
- func BuildLogCommandArgs(kubeconfig string, namespace, podName, container string, tail int64, ...) []string
- func BuildLokiCommandArgs(kubeconfig string, namespace, podName, container string, tail int64, ...) []string
- func CheckIPPortReachable(ip string, port string) error
- func CheckShootIsTargeted(target TargetInterface) bool
- func CheckToolInstalled(cliName string) bool
- func CreateDir(dirname string, permission os.FileMode)
- func CreateFileIfNotExists(filename string, permission os.FileMode)
- func ExecCmd(input []byte, cmd string, suppressedOutput bool, environment ...string) (err error)
- func ExecCmdReturnOutput(cmd string, args ...string) (output string, err error)
- func ExecCmdSaveOutputFile(input []byte, cmd string, fileName string, environment ...string) (err error)
- func Execute()
- func FetchShootFromTarget(target TargetInterface) (*gardencorev1beta1.Shoot, error)
- func FileExists(path string) (bool, error)
- func GardenctlDebugLog(logMsg string)
- func GardenctlInfoLog(logMsg string)
- func GetFromTargetInfo(targetReader TargetReader, key string) string
- func GetGardenClusterKubeConfigFromConfig(pathGardenConfig, pathTarget string)
- func GetGardenConfig(pathGardenConfig string, gardenConfig *GardenConfig)
- func GetOrphanInfraResources(rs []string, terraformstate string) error
- func GetProjectObject(targetReader TargetReader, name string) (*v1beta1.Project, error)
- func GetSeedObject(targetReader TargetReader, name string) (*v1beta1.Seed, error)
- func GetShootObject(targetReader TargetReader, name string) (*v1beta1.Shoot, error)
- func GetTargetName(targetReader TargetReader, Kind string) (string, error)
- func GetTargetedProjectObject(targetReader TargetReader) (*v1beta1.Project, error)
- func GetTargetedSeedObject(targetReader TargetReader) (*v1beta1.Seed, error)
- func GetTargetedShootObject(targetReader TargetReader) (*v1beta1.Shoot, error)
- func HomeDir() string
- func IsControlPlaneTargeted(targetReader TargetReader) bool
- func IsTargeted(targetReader TargetReader, args ...string) bool
- func NewAliyunCmd(targetReader TargetReader) *cobra.Command
- func NewAwsCmd(targetReader TargetReader) *cobra.Command
- func NewAzCmd(targetReader TargetReader) *cobra.Command
- func NewBashCompletionCmd() *cobra.Command
- func NewCompletionCmd() *cobra.Command
- func NewConfigFromBytes(kubeconfig string) *restclient.Config
- func NewDiagCmd(reader TargetReader, ioStreams IOStreams) *cobra.Command
- func NewDownloadCmd(targetReader TargetReader) *cobra.Command
- func NewDropCmd(targetReader TargetReader, targetWriter TargetWriter, ioStreams IOStreams) *cobra.Command
- func NewGcloudCmd(targetReader TargetReader) *cobra.Command
- func NewGetCmd(targetReader TargetReader, configReader ConfigReader, ...) *cobra.Command
- func NewHistoryCmd(targetWriter TargetWriter, historyWriter HistoryWriter) *cobra.Command
- func NewInfoCmd(targetReader TargetReader, ioStreams IOStreams) *cobra.Command
- func NewKaCmd() *cobra.Command
- func NewKgCmd() *cobra.Command
- func NewKnCmd() *cobra.Command
- func NewKsCmd() *cobra.Command
- func NewKubectlCmd() *cobra.Command
- func NewKubectxCmd() *cobra.Command
- func NewLogsCmd(targetReader TargetReader) *cobra.Command
- func NewLsCmd(targetReader TargetReader, configReader ConfigReader, ioStreams IOStreams) *cobra.Command
- func NewOpenstackCmd(targetReader TargetReader) *cobra.Command
- func NewOrphanCmd(targetReader TargetReader) *cobra.Command
- func NewRegisterCmd() *cobra.Command
- func NewSSHCmd(targetReader TargetReader, ioStreams IOStreams) *cobra.Command
- func NewShellCmd(reader TargetReader, ioStreams IOStreams) *cobra.Command
- func NewShowCmd(targetReader TargetReader) *cobra.Command
- func NewTargetCmd(targetReader TargetReader, targetWriter TargetWriter, ...) *cobra.Command
- func NewTerraformCmd(targetReader TargetReader) *cobra.Command
- func NewUnregisterCmd() *cobra.Command
- func NewUpdateCheckCmd() *cobra.Command
- func NewVersionCmd() *cobra.Command
- func NewZshCompletionCmd() *cobra.Command
- func PrintGardenClusters(reader ConfigReader, writer io.Writer, outFormat string) error
- func PrintoutObject(objectToPrint interface{}, writer io.Writer, outputFormat string) error
- func ReadTarget(pathTarget string, target *Target)
- func TidyKubeconfigWithHomeDir(pathToKubeconfig string) string
- func ValidateClientConfig(config clientcmdapi.Config) error
- func VersionGreaterThanLokiRelease(version string) bool
- type AccessRestriction
- type AccessRestrictionsOption
- type AliyunInstanceAttribute
- type AliyunInstanceTypeSpec
- type AwsInstanceAttribute
- type AzureInstanceAttribute
- type ConfigReader
- type GCPInstanceAttribute
- type GardenClusterMeta
- type GardenClusters
- type GardenConfig
- type GardenConfigReader
- type GardenctlHistoryWriter
- type GardenctlKubeconfigReader
- type GardenctlKubeconfigWriter
- type GardenctlTargetReader
- type GardenctlTargetWriter
- type HistoryWriter
- type IOStreams
- type Issues
- type IssuesMeta
- type KubeconfigReader
- type KubeconfigWriter
- type LastOperationMeta
- type OpenstackInstanceAttribute
- type ProjectMeta
- type Projects
- type SeedMeta
- type Seeds
- type StatusMeta
- type Target
- func (t *Target) GardenerClient() (gardencoreclientset.Interface, error)
- func (t *Target) K8SClient() (kubernetes.Interface, error)
- func (t *Target) K8SClientToKind(kind TargetKind) (kubernetes.Interface, error)
- func (t *Target) Kind() (TargetKind, error)
- func (t *Target) SetStack(stack []TargetMeta)
- func (t *Target) Stack() []TargetMeta
- type TargetInterface
- type TargetKind
- type TargetMeta
- type TargetReader
- type TargetWriter
Constants ¶
const (
// AdminClusterRoleBindingName is the name for the administrator ClusterRoleBinding
AdminClusterRoleBindingName = "gardener.cloud:system:administrators"
)
const ProjectName = "project.gardener.cloud/name"
ProjectName is they key of a label on namespaces whose value holds the project name.
Variables ¶
var ( // Client is Clientset to use for specified cluster Client *kubernetes.Clientset // KUBECONFIG contains path to file KUBECONFIG string )
var RootCmd = &cobra.Command{
Use: "gardenctl",
Short: "g",
}
RootCmd represents the base command when called without any subcommands
Functions ¶
func BuildLogCommandArgs ¶ added in v0.24.0
func BuildLogCommandArgs(kubeconfig string, namespace, podName, container string, tail int64, sinceSeconds time.Duration) []string
BuildLogCommandArgs build kubectl command to get logs
func BuildLokiCommandArgs ¶ added in v0.24.0
func BuildLokiCommandArgs(kubeconfig string, namespace, podName, container string, tail int64, sinceSeconds time.Duration) []string
BuildLokiCommandArgs build kubect command to get logs from loki https://github.com/gardener/gardener/blob/master/docs/usage/logging.md Loki multi-tenant is enabled so it's required to pass 'X-Scope-OrgID' header
func CheckIPPortReachable ¶ added in v0.24.0
CheckIPPortReachable check whether IP with port is reachable within certain period of time
func CheckShootIsTargeted ¶ added in v0.18.0
func CheckShootIsTargeted(target TargetInterface) bool
CheckShootIsTargeted check if current target has shoot targeted
func CheckToolInstalled ¶ added in v0.22.0
CheckToolInstalled checks whether cliName is installed on local machine
func CreateFileIfNotExists ¶
CreateFileIfNotExists creates an empty file if it does not exist
func ExecCmdReturnOutput ¶
ExecCmdReturnOutput execute cmd and return output
func ExecCmdSaveOutputFile ¶ added in v0.24.0
func ExecCmdSaveOutputFile(input []byte, cmd string, fileName string, environment ...string) (err error)
ExecCmdSaveOutputFile save command output to file
func Execute ¶
func Execute()
Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.
func FetchShootFromTarget ¶
func FetchShootFromTarget(target TargetInterface) (*gardencorev1beta1.Shoot, error)
FetchShootFromTarget fetches shoot object from given target
func FileExists ¶
FileExists check if the directory exists
func GardenctlDebugLog ¶ added in v0.21.0
func GardenctlDebugLog(logMsg string)
GardenctlDebugLog only outputs debug msg when gardencl -d or gardenctl --debug is specified
func GardenctlInfoLog ¶ added in v0.21.0
func GardenctlInfoLog(logMsg string)
GardenctlInfoLog outputs information msg at all time
func GetFromTargetInfo ¶ added in v0.24.0
func GetFromTargetInfo(targetReader TargetReader, key string) string
GetFromTargetInfo validation value from global map targetInfo garden/project/shoot/seed/shootTechnicalID/....
func GetGardenClusterKubeConfigFromConfig ¶
func GetGardenClusterKubeConfigFromConfig(pathGardenConfig, pathTarget string)
GetGardenClusterKubeConfigFromConfig return kubeconfig of garden cluster if exists
func GetGardenConfig ¶
func GetGardenConfig(pathGardenConfig string, gardenConfig *GardenConfig)
GetGardenConfig sets GardenConfig struct
func GetOrphanInfraResources ¶ added in v0.22.0
GetOrphanInfraResources list orphan infra resources on targeted cluster
func GetProjectObject ¶ added in v0.24.0
func GetProjectObject(targetReader TargetReader, name string) (*v1beta1.Project, error)
GetProjectObject with name option retrun project object
func GetSeedObject ¶ added in v0.24.0
func GetSeedObject(targetReader TargetReader, name string) (*v1beta1.Seed, error)
GetSeedObject with name option retrun seed object
func GetShootObject ¶ added in v0.24.0
func GetShootObject(targetReader TargetReader, name string) (*v1beta1.Shoot, error)
GetShootObject return shoot object and error
func GetTargetName ¶ added in v0.24.0
func GetTargetName(targetReader TargetReader, Kind string) (string, error)
GetTargetName lookup Target Kind ("kind value") return Target Name "name value" from target file ~/.garden/sessions/plantingSession/target
func GetTargetedProjectObject ¶ added in v0.24.0
func GetTargetedProjectObject(targetReader TargetReader) (*v1beta1.Project, error)
GetTargetedProjectObject target Project/Seed to Shoot returns targeted project object
func GetTargetedSeedObject ¶ added in v0.24.0
func GetTargetedSeedObject(targetReader TargetReader) (*v1beta1.Seed, error)
GetTargetedSeedObject target Project/Seed to Shoot retrun targeted seed object
func GetTargetedShootObject ¶ added in v0.24.0
func GetTargetedShootObject(targetReader TargetReader) (*v1beta1.Shoot, error)
GetTargetedShootObject target Project/Seed to Shoot retrun targeted shoot object
func IsControlPlaneTargeted ¶ added in v0.24.1
func IsControlPlaneTargeted(targetReader TargetReader) bool
IsControlPlaneTargeted returns whether current targeting a control plane for a shoot
func IsTargeted ¶ added in v0.24.0
func IsTargeted(targetReader TargetReader, args ...string) bool
IsTargeted check if target Kind is exist in target file ~/.garden/sessions/plantingSession/target
func NewAliyunCmd ¶
func NewAliyunCmd(targetReader TargetReader) *cobra.Command
NewAliyunCmd returns a new aliyun command.
func NewAwsCmd ¶
func NewAwsCmd(targetReader TargetReader) *cobra.Command
NewAwsCmd returns a new aws command.
func NewAzCmd ¶
func NewAzCmd(targetReader TargetReader) *cobra.Command
NewAzCmd returns a new az command.
func NewBashCompletionCmd ¶
NewBashCompletionCmd returns a new bash completion command.
func NewCompletionCmd ¶
NewCompletionCmd returns a new completion command.
func NewConfigFromBytes ¶
func NewConfigFromBytes(kubeconfig string) *restclient.Config
NewConfigFromBytes returns a client from the given kubeconfig path
func NewDiagCmd ¶ added in v0.24.0
func NewDiagCmd(reader TargetReader, ioStreams IOStreams) *cobra.Command
NewDiagCmd returns diagnostic information for a shoot.
func NewDownloadCmd ¶
func NewDownloadCmd(targetReader TargetReader) *cobra.Command
NewDownloadCmd returns a new download command.
func NewDropCmd ¶
func NewDropCmd(targetReader TargetReader, targetWriter TargetWriter, ioStreams IOStreams) *cobra.Command
NewDropCmd returns a new drop command.
func NewGcloudCmd ¶
func NewGcloudCmd(targetReader TargetReader) *cobra.Command
NewGcloudCmd return a new gcloud command.
func NewGetCmd ¶
func NewGetCmd(targetReader TargetReader, configReader ConfigReader, kubeconfigReader KubeconfigReader, kubeconfigWriter KubeconfigWriter, ioStreams IOStreams) *cobra.Command
NewGetCmd returns a new get command.
func NewHistoryCmd ¶ added in v0.24.3
func NewHistoryCmd(targetWriter TargetWriter, historyWriter HistoryWriter) *cobra.Command
NewHistoryCmd use for list/search targting history
func NewInfoCmd ¶
func NewInfoCmd(targetReader TargetReader, ioStreams IOStreams) *cobra.Command
NewInfoCmd returns a new info command.
func NewKubectlCmd ¶
NewKubectlCmd returns a new kubectl command.
func NewKubectxCmd ¶ added in v0.18.0
NewKubectxCmd returns a new kubectx command.
func NewLogsCmd ¶
func NewLogsCmd(targetReader TargetReader) *cobra.Command
NewLogsCmd returns a new logs command.
func NewLsCmd ¶
func NewLsCmd(targetReader TargetReader, configReader ConfigReader, ioStreams IOStreams) *cobra.Command
NewLsCmd returns a new ls command.
func NewOpenstackCmd ¶
func NewOpenstackCmd(targetReader TargetReader) *cobra.Command
NewOpenstackCmd returns a new openstack cmd.
func NewOrphanCmd ¶ added in v0.24.0
func NewOrphanCmd(targetReader TargetReader) *cobra.Command
NewOrphanCmd returns a new orphan command
func NewRegisterCmd ¶
NewRegisterCmd returns a new register command.
func NewSSHCmd ¶
func NewSSHCmd(targetReader TargetReader, ioStreams IOStreams) *cobra.Command
NewSSHCmd returns a new ssh command.
func NewShellCmd ¶
func NewShellCmd(reader TargetReader, ioStreams IOStreams) *cobra.Command
NewShellCmd returns a new shell command.
func NewShowCmd ¶
func NewShowCmd(targetReader TargetReader) *cobra.Command
NewShowCmd returns a new show command.
func NewTargetCmd ¶
func NewTargetCmd(targetReader TargetReader, targetWriter TargetWriter, configReader ConfigReader, ioStreams IOStreams, kubeconfigReader KubeconfigReader, historyWriter HistoryWriter) *cobra.Command
NewTargetCmd returns a new target command.
func NewTerraformCmd ¶ added in v0.19.0
func NewTerraformCmd(targetReader TargetReader) *cobra.Command
NewTerraformCmd returns a new terraform command.
func NewUnregisterCmd ¶
NewUnregisterCmd returns a new unregister command.
func NewUpdateCheckCmd ¶ added in v0.17.0
NewUpdateCheckCmd checks whether a newer version of gardenctl is available
func NewVersionCmd ¶
NewVersionCmd returns a new version command.
func NewZshCompletionCmd ¶
NewZshCompletionCmd returns a new zsh completion command.
func PrintGardenClusters ¶
func PrintGardenClusters(reader ConfigReader, writer io.Writer, outFormat string) error
PrintGardenClusters prints all Garden cluster in the Garden config
func PrintoutObject ¶ added in v0.24.0
PrintoutObject print object in yaml or json format. Pass os.Stdout if desired
func ReadTarget ¶
ReadTarget file into Target DEPRECATED: Use `TargetReader` instead.
func TidyKubeconfigWithHomeDir ¶ added in v0.18.0
TidyKubeconfigWithHomeDir check if kubeconfig path contains ~, replace ~ with user home dir
func ValidateClientConfig ¶
func ValidateClientConfig(config clientcmdapi.Config) error
ValidateClientConfig validates that the auth info of a given kubeconfig doesn't have unsupported fields.
func VersionGreaterThanLokiRelease ¶ added in v0.24.0
VersionGreaterThanLokiRelease checks if provided version supports Loki
Types ¶
type AccessRestriction ¶ added in v0.21.0
type AccessRestriction struct { Key string `yaml:"key,omitempty" json:"key,omitempty"` NotifyIf bool `yaml:"notifyIf,omitempty" json:"notifyIf,omitempty"` Msg string `yaml:"msg,omitempty" json:"msg,omitempty"` Options []AccessRestrictionsOption `yaml:"options,omitempty" json:"options,omitempty"` }
AccessRestriction contains key / notifyIf / msg / options
type AccessRestrictionsOption ¶ added in v0.21.0
type AccessRestrictionsOption struct { Key string `yaml:"key,omitempty" json:"key,omitempty"` NotifyIf bool `yaml:"notifyIf,omitempty" json:"notifyIf,omitempty"` Msg string `yaml:"msg,omitempty" json:"msg,omitempty"` }
AccessRestrictionsOption contains key / notifyIf / msg
type AliyunInstanceAttribute ¶
type AliyunInstanceAttribute struct { InstanceID string RegionID string ZoneID string VpcID string ImageID string VSwitchID string ShootName string BastionSecurityGroupName string BastionInstanceName string BastionInstanceID string BastionSecurityGroupID string InstanceType string InstanceChargeType string InternetChargeType string InternetMaxBandwidthIn string InternetMaxBandwidthOut string IoOptimized string PrivateIP string BastionIP string BastionSSHUser string MyPublicIP string FlagProviderID string }
AliyunInstanceAttribute stores all the critical information for creating a instance on Alicloud.
type AliyunInstanceTypeSpec ¶
type AliyunInstanceTypeSpec struct { CPUCoreCount int EniQuantity int MemorySize float64 GPUAmount int EniPrivateIPAddressQuantity int LocalStorageCategory string GPUSpec string InstanceTypeID string InstanceFamilyLevel string InstanceTypeFamily string }
AliyunInstanceTypeSpec stores all the critical information for choosing a instance type on Alicloud.
type AwsInstanceAttribute ¶
type AwsInstanceAttribute struct { ShootName string InstanceID string SecurityGroupName string SecurityGroupID string ImageID string VpcID string KeyName string SubnetID string BastionSecurityGroupID string BastionInstanceName string BastionIP string BastionPrivIP string BastionInstanceID string BastionSecurityGroupName string UserData []byte SSHPublicKey []byte MyPublicIP string FlagProviderID string }
AwsInstanceAttribute stores all the critical information for creating an instance on AWS.
type AzureInstanceAttribute ¶
type AzureInstanceAttribute struct { NamePublicIP string ShootName string NicName string PublicIP string RescourceGroupName string SecurityGroupName string SkuType string MyPublicIP string }
AzureInstanceAttribute stores all the critical information for creating an instance on Azure.
type ConfigReader ¶
type ConfigReader interface {
ReadConfig(configPath string) *GardenConfig
}
ConfigReader reads the configuration.
type GCPInstanceAttribute ¶
type GCPInstanceAttribute struct { ShootName string BastionHostName string BastionIP string FirewallRuleName string VpcName string Subnetwork string Zone string UserData []byte SSHPublicKey []byte MyPublicIP string }
GCPInstanceAttribute stores all the critical information for creating an instance on GCP.
type GardenClusterMeta ¶
type GardenClusterMeta struct { Name string `yaml:"name,omitempty" json:"name,omitempty"` KubeConfig string `yaml:"kubeConfig,omitempty" json:"kubeConfig,omitempty"` DashboardURL string `yaml:"dashboardUrl,omitempty" json:"dashboardUrl,omitempty"` AccessRestrictions []AccessRestriction `yaml:"accessRestrictions,omitempty" json:"accessRestrictions,omitempty"` }
GardenClusterMeta contains name and path to kubeconfig of gardencluster
type GardenClusters ¶
type GardenClusters struct {
GardenClusters []GardenClusterMeta `yaml:"gardenClusters,omitempty" json:"gardenClusters,omitempty"`
}
GardenClusters contains all gardenclusters
type GardenConfig ¶
type GardenConfig struct { Email string `yaml:"email,omitempty" json:"email,omitempty"` GithubURL string `yaml:"githubURL,omitempty" json:"githubURL,omitempty"` GardenClusters []GardenClusterMeta `yaml:"gardenClusters,omitempty" json:"gardenClusters,omitempty"` }
GardenConfig contains config for gardenctl
type GardenConfigReader ¶
type GardenConfigReader struct{}
GardenConfigReader implements ConfigReader.
func (*GardenConfigReader) ReadConfig ¶
func (r *GardenConfigReader) ReadConfig(gardenConfigPath string) *GardenConfig
ReadConfig reads the configuration.
type GardenctlHistoryWriter ¶ added in v0.24.3
type GardenctlHistoryWriter struct{}
GardenctlHistoryWriter implements HistoryWriter.
func (*GardenctlHistoryWriter) WriteStringln ¶ added in v0.24.3
func (w *GardenctlHistoryWriter) WriteStringln(historyPath string, i interface{}) error
WriteStringln writes history to given path
type GardenctlKubeconfigReader ¶
type GardenctlKubeconfigReader struct{}
GardenctlKubeconfigReader implements KubeconfigReader.
func (*GardenctlKubeconfigReader) ReadKubeconfig ¶
func (r *GardenctlKubeconfigReader) ReadKubeconfig(kubeconfigPath string) ([]byte, error)
ReadKubeconfig returns the kubeconfig from given path.
type GardenctlKubeconfigWriter ¶
type GardenctlKubeconfigWriter struct{}
GardenctlKubeconfigWriter implements KubeconfigWriter.
type GardenctlTargetReader ¶
type GardenctlTargetReader struct{}
GardenctlTargetReader implements TargetReader.
func (*GardenctlTargetReader) ReadTarget ¶
func (r *GardenctlTargetReader) ReadTarget(targetPath string) TargetInterface
ReadTarget returns the current target.
type GardenctlTargetWriter ¶
type GardenctlTargetWriter struct{}
GardenctlTargetWriter implements TargetWriter.
func (*GardenctlTargetWriter) WriteTarget ¶
func (w *GardenctlTargetWriter) WriteTarget(targetPath string, target TargetInterface) (err error)
WriteTarget writes <target> to <targetPath>.
type HistoryWriter ¶ added in v0.24.3
HistoryWriter writes history to given path.
type IOStreams ¶
IOStreams provides the standard names for iostreams. This is useful for embedding and for unit testing.
type Issues ¶
type Issues struct {
Issues []IssuesMeta `yaml:"issues,omitempty" json:"issues,omitempty"`
}
Issues contains all projects with issues
type IssuesMeta ¶
type IssuesMeta struct { Project string `yaml:"project,omitempty" json:"project,omitempty"` Seed string `yaml:"seed,omitempty" json:"seed,omitempty"` Shoot string `yaml:"shoot,omitempty" json:"shoot,omitempty"` Health string `yaml:"health,omitempty" json:"health,omitempty"` Status StatusMeta `yaml:"status,omitempty" json:"status,omitempty"` }
IssuesMeta contains project related informations
type KubeconfigReader ¶
KubeconfigReader reads kubeconfig from given path.
type KubeconfigWriter ¶
KubeconfigWriter writes kubeconfig to given path.
type LastOperationMeta ¶
type LastOperationMeta struct { Description string `yaml:"description,omitempty" json:"description,omitempty"` LastUpdateTime string `yaml:"lastUpdateTime,omitempty" json:"lastUpdateTime,omitempty"` Progress int `yaml:"progress,omitempty" json:"progress,omitempty"` State string `yaml:"state,omitempty" json:"state,omitempty"` Type string `yaml:"type,omitempty" json:"type,omitempty"` }
LastOperationMeta contains information about last operation
type OpenstackInstanceAttribute ¶ added in v0.24.0
type OpenstackInstanceAttribute struct { InstanceID string FIP string // contains filtered or unexported fields }
OpenstackInstanceAttribute stores all the critical information for creating an instance on Openstack.
type ProjectMeta ¶
type ProjectMeta struct { Project string `yaml:"project,omitempty" json:"project,omitempty"` Shoots []string `yaml:"shoots,omitempty" json:"shoots,omitempty"` }
ProjectMeta contains project and shoots of project
type Projects ¶
type Projects struct {
Projects []ProjectMeta `yaml:"projects,omitempty" json:"projects,omitempty"`
}
Projects contains list of all projects
type SeedMeta ¶
type SeedMeta struct { Seed string `yaml:"seed,omitempty" json:"seed,omitempty"` Shoots []string `yaml:"shoots,omitempty" json:"shoots,omitempty"` }
SeedMeta contains shoots per seed
type Seeds ¶
type Seeds struct {
Seeds []SeedMeta `yaml:"seeds,omitempty" json:"seeds,omitempty"`
}
Seeds contains list of all seeds
type StatusMeta ¶
type StatusMeta struct { LastErrors []string `yaml:"lastErrors,omitempty" json:"lastErrors,omitempty"` LastOperation LastOperationMeta `yaml:"lastOperation,omitempty" json:"lastOperation,omitempty"` }
StatusMeta contains status for a project
type Target ¶
type Target struct {
Target []TargetMeta `yaml:"target,omitempty" json:"target,omitempty"`
}
Target contains the current target.
func (*Target) GardenerClient ¶
func (t *Target) GardenerClient() (gardencoreclientset.Interface, error)
GardenerClient returns a gardener client
func (*Target) K8SClient ¶
func (t *Target) K8SClient() (kubernetes.Interface, error)
K8SClient returns a kubernetes client configured against the current target.
func (*Target) K8SClientToKind ¶
func (t *Target) K8SClientToKind(kind TargetKind) (kubernetes.Interface, error)
K8SClientToKind returns a kubernetes client configured against the given target <kind>.
func (*Target) Kind ¶
func (t *Target) Kind() (TargetKind, error)
Kind returns the current target kind.
func (*Target) SetStack ¶
func (t *Target) SetStack(stack []TargetMeta)
SetStack sets the current target stack to a new one.
type TargetInterface ¶
type TargetInterface interface { Stack() []TargetMeta SetStack([]TargetMeta) Kind() (TargetKind, error) K8SClient() (kubernetes.Interface, error) K8SClientToKind(TargetKind) (kubernetes.Interface, error) GardenerClient() (gardencoreclientset.Interface, error) }
TargetInterface defines target operations.
type TargetKind ¶
type TargetKind string
TargetKind is a valid value for target kind.
const ( // TargetKindGarden points to garden cluster. TargetKindGarden TargetKind = "garden" // TargetKindProject points to project. TargetKindProject TargetKind = "project" // TargetKindSeed points to seed cluster. TargetKindSeed TargetKind = "seed" // TargetKindShoot points to shoot cluster. TargetKindShoot TargetKind = "shoot" // TargetKindNamespace points to namespace. TargetKindNamespace TargetKind = "namespace" )
These are valid target kinds.
type TargetMeta ¶
type TargetMeta struct { Kind TargetKind `yaml:"kind,omitempty" json:"kind,omitempty"` Name string `yaml:"name,omitempty" json:"name,omitempty"` }
TargetMeta contains kind and name of target.
type TargetReader ¶
type TargetReader interface {
ReadTarget(targetPath string) TargetInterface
}
TargetReader reads the current target.
type TargetWriter ¶
type TargetWriter interface {
WriteTarget(targetPath string, target TargetInterface) error
}
TargetWriter writes the current target.
Source Files ¶
- aliyun.go
- aws.go
- az.go
- completion.go
- config_reader.go
- diag.go
- download.go
- drop.go
- gcloud.go
- get.go
- history_writer.go
- info.go
- io_streams.go
- kubeconfig_reader.go
- kubeconfig_writer.go
- kubectl.go
- kubectx.go
- logs.go
- ls.go
- miscellaneous.go
- openstack.go
- operate.go
- orphan.go
- register.go
- root.go
- shell.go
- show.go
- ssh.go
- ssh_alicloud.go
- ssh_aws.go
- ssh_azure.go
- ssh_gcp.go
- ssh_openstack.go
- target.go
- target_history.go
- target_reader.go
- target_writer.go
- terraform.go
- types.go
- unregister.go
- update-check.go
- utils.go
- var.go
- version.go