Documentation ¶
Overview ¶
Package controllers implements functions for manipulating CAPI generated cluster secrets into Argo definitions.
Index ¶
- Constants
- Variables
- func BuildClusterName(s string, namespace string) string
- func BuildNamespacedName(s string, namespace string) types.NamespacedName
- func GetArgoCommonLabels() map[string]string
- func ValidateCapiNaming(n types.NamespacedName) bool
- func ValidateCapiSecret(s *corev1.Secret) error
- func ValidateObjectOwner(s corev1.Secret) error
- type ArgoCluster
- type ArgoConfig
- type ArgoTLS
- type Capi2Argo
- type CapiCluster
- type Cluster
- type ClusterInfo
- type KubeConfig
- type User
- type UserInfo
Constants ¶
const CapiClusterSecretType corev1.SecretType = "cluster.x-k8s.io/secret"
CapiClusterSecretType represents the CAPI managed secret type.
Variables ¶
var ( // ArgoNamespace represents the Namespace that hold ArgoCluster secrets. ArgoNamespace string // TestKubeConfig represents TestKubeConfig *rest.Config )
var ( // EnableGarbageCollection enables experimental GC feature EnableGarbageCollection bool // EnableNamespacedNames represents a mode where the cluster name is always // prepended by the cluster namespace in all generated secrets EnableNamespacedNames bool )
Functions ¶
func BuildClusterName ¶ added in v0.1.6
BuildClusterName returns cluster name after transformations applied (with/without namespace suffix, etc).
func BuildNamespacedName ¶
func BuildNamespacedName(s string, namespace string) types.NamespacedName
BuildNamespacedName returns k8s native object identifier.
func GetArgoCommonLabels ¶ added in v0.1.12
GetArgoCommonLabels holds a map of labels that reconciled objects must have.
func ValidateCapiNaming ¶
func ValidateCapiNaming(n types.NamespacedName) bool
ValidateCapiNaming validates CAPI kubeconfig naming convention.
func ValidateCapiSecret ¶
ValidateCapiSecret validates that we got proper defined types for a given secret.
func ValidateObjectOwner ¶ added in v0.1.7
ValidateObjectOwner checks whether reconciled object is managed by CACO or not.
Types ¶
type ArgoCluster ¶
type ArgoCluster struct { NamespacedName types.NamespacedName ClusterName string ClusterServer string ClusterLabels map[string]string TakeAlongLabels map[string]string ClusterConfig ArgoConfig }
ArgoCluster holds all information needed for CAPI --> Argo Cluster conversion
func NewArgoCluster ¶
func NewArgoCluster(c *CapiCluster, s *corev1.Secret, cluster *clusterv1.Cluster) (*ArgoCluster, error)
NewArgoCluster return a new ArgoCluster
func (*ArgoCluster) ConvertToSecret ¶
func (a *ArgoCluster) ConvertToSecret() (*corev1.Secret, error)
ConvertToSecret converts an ArgoCluster into k8s native secret object.
type ArgoConfig ¶
type ArgoConfig struct { TLSClientConfig *ArgoTLS `json:"tlsClientConfig,omitempty"` BearerToken *string `json:"bearerToken,omitempty"` }
ArgoConfig represents Argo Cluster.JSON.config
type ArgoTLS ¶
type ArgoTLS struct { CaData *string `json:"caData,omitempty"` CertData *string `json:"certData,omitempty"` KeyData *string `json:"keyData,omitempty"` }
ArgoTLS represents Argo Cluster.JSON.config.tlsClientConfig
type Capi2Argo ¶
Capi2Argo reconciles a Secret object
type CapiCluster ¶
type CapiCluster struct { Name string `yaml:"name"` Namespace string `yaml:"namespace"` KubeConfig KubeConfig `yaml:"kubeConfig"` }
CapiCluster is an one-on-one representation of KubeConfig fields.
func NewCapiCluster ¶
func NewCapiCluster(name, namespace string) *CapiCluster
NewCapiCluster returns an empty CapiCluster type.
type Cluster ¶
type Cluster struct { Name string `yaml:"name"` Cluster ClusterInfo `yaml:"cluster"` }
Cluster represents kubeconfig.[]Clusters.Cluster fields.
type ClusterInfo ¶
type ClusterInfo struct { CaData string `yaml:"certificate-authority-data"` Server string `yaml:"server"` }
ClusterInfo represents kubeconfig.[]Clusters.Cluster.Clusterinfo fields.
type KubeConfig ¶ added in v0.1.12
type KubeConfig struct { APIVersion string `yaml:"apiVersion"` Kind string `yaml:"kind"` Clusters []Cluster `yaml:"clusters"` Users []User `yaml:"users"` }
KubeConfig is an one-on-one representation of KubeConfig fields.