Documentation
¶
Index ¶
- Constants
- Variables
- func BuildNamespacedName(s string) types.NamespacedName
- func GetArgoLabels() map[string]string
- func ValidateCapiNaming(n types.NamespacedName) bool
- func ValidateCapiSecret(s *corev1.Secret) error
- func ValidateClusterTLSConfig(a *ArgoTLS) error
- type ArgoCluster
- type ArgoConfig
- type ArgoTLS
- type Capi2Argo
- type CapiCluster
- type Cluster
- type ClusterInfo
- 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 )
Functions ¶
func BuildNamespacedName ¶
func BuildNamespacedName(s string) types.NamespacedName
BuildNamespacedName returns k8s native object identifier.
func GetArgoLabels ¶
GetArgoLabels 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 ValidateClusterTLSConfig ¶
ValidateClusterTLSConfig validates that we got proper based64 k/v fields.
Types ¶
type ArgoCluster ¶
type ArgoCluster struct { NamespacedName types.NamespacedName ClusterName string ClusterServer string ClusterConfig ArgoConfig }
ArgoCluster holds all information needed for CAPI --> Argo Cluster conversion
func NewArgoCluster ¶
func NewArgoCluster(c *CapiCluster, s *corev1.Secret) *ArgoCluster
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"`
}
ArgoConfig represents Argo Cluster.JSON.config
type ArgoTLS ¶
type ArgoTLS struct { CaData string `json:"caData"` CertData string `json:"certData"` KeyData string `json:"keyData"` }
ArgoTLS represents Argo Cluster.JSON.config.tlsClientConfig
type Capi2Argo ¶
Capi2Argo reconciles a Secret object
type CapiCluster ¶
type CapiCluster struct { APIVersion string `yaml:"apiVersion"` Kind string `yaml:"kind"` Clusters []Cluster `yaml:"clusters"` Users []User `yaml:"users"` }
CapiCluster is an one-on-one representation of KubeConfig fields.
func NewCapiCluster ¶
func NewCapiCluster() *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.