package models // KubeConfigValue is a struct used to create a kubectl configuration YAML file. type KubeConfigValue struct { APIVersion string `yaml:"apiVersion" json:"apiVersion"` Kind string `yaml:"kind" json:"kind"` Clusters []KubeconfigNamedCluster `yaml:"clusters" json:"clusters"` Users []KubeconfigUser `yaml:"users" json:"users"` Contexts []KubeconfigNamedContext `yaml:"contexts" json:"contexts"` CurrentContext string `yaml:"current-context" json:"current-context"` Preferences struct{} `yaml:"preferences" json:"preferences"` } // KubeconfigUser is a struct used to create a kubectl configuration YAML file type KubeconfigUser struct { Name string `yaml:"name" json:"name"` User KubeconfigUserKeyPair `yaml:"user" json:"user"` } // KubeconfigUserKeyPair is a struct used to create a kubectl configuration YAML file type KubeconfigUserKeyPair struct { Token string `yaml:"token" json:"token"` } // KubeconfigAuthProvider is a struct used to create a kubectl authentication provider type KubeconfigAuthProvider struct { Name string `yaml:"name" json:"name"` Config map[string]string `yaml:"config" json:"config"` } // KubeconfigNamedCluster is a struct used to create a kubectl configuration YAML file type KubeconfigNamedCluster struct { Name string `yaml:"name" json:"name"` Cluster KubeconfigCluster `yaml:"cluster" json:"cluster"` } // KubeconfigCluster is a struct used to create a kubectl configuration YAML file type KubeconfigCluster struct { Server string `yaml:"server" json:"server"` CertificateAuthorityData string `yaml:"certificate-authority-data" json:"certificate-authority-data"` CertificateAuthority string `yaml:"certificate-authority" json:"certificate-authority"` } // KubeconfigNamedContext is a struct used to create a kubectl configuration YAML file type KubeconfigNamedContext struct { Name string `yaml:"name" json:"name"` Context KubeconfigContext `yaml:"context" json:"context"` } // KubeconfigContext is a struct used to create a kubectl configuration YAML file type KubeconfigContext struct { Cluster string `yaml:"cluster" json:"cluster"` Namespace string `yaml:"namespace,omitempty" json:"namespace,omitempty"` User string `yaml:"user" json:"user"` } // kubeconfigEvent is the NATS payload used to transfer the kubeconfig from the source peer to the target peer. type KubeconfigEvent struct { DestPeerID string `json:"dest_peer_id"` ExecutionsID string `json:"executions_id"` Kubeconfig string `json:"kubeconfig"` SourcePeerID string `json:"source_peer_id"` // OriginID is the peer that initiated the provisioning request. // The PB_CONSIDERS response is routed back to this peer. OriginID string `json:"origin_id"` // SourceExecutionsID is the execution namespace on the source cluster. // Used by the target to provision PVCs with the correct claim name. SourceExecutionsID string `json:"source_executions_id,omitempty"` // Images is the list of container images to pre-pull on the compute peer // before the workflow starts. Images []string `json:"images,omitempty"` }