Documentation ¶
Index ¶
- Constants
- func CreateNamespace(name string, namespace *corev1.Namespace) (*corev1.Namespace, error)
- func CreateSecret(secret *corev1.Secret) error
- func DeleteSecret(secret *corev1.Secret) error
- func DeleteZarfNamespace()
- func DetectDistro() (string, error)
- func GenerateRegistryPullCreds(namespace string, name string) *corev1.Secret
- func GenerateTLSSecret(namespace string, name string, certPath string, keyPath string) *corev1.Secret
- func GetAllServiceAccounts() (*corev1.ServiceAccountList, error)
- func GetAvailablePort() (int, error)
- func GetContext() (string, error)
- func GetNamespaces() (*corev1.NamespaceList, error)
- func GetNodes() (*corev1.NodeList, error)
- func GetSecret(namespace string, name string) (*corev1.Secret, error)
- func GetService(namespace string, serviceName string) (*corev1.Service, error)
- func GetServiceAccount(namespace string, name string) (*corev1.ServiceAccount, error)
- func GetServiceAccounts(namespace string) (*corev1.ServiceAccountList, error)
- func GetServicesByLabel(namespace string, label string, value string) (*corev1.ServiceList, error)
- func GetServicesByLabelExists(namespace string, label string) (*corev1.ServiceList, error)
- func LoadZarfState() types.ZarfState
- func ProcessYamlFilesInPath(path string, componentImages []string) []string
- func ReplaceSecret(secret *corev1.Secret) error
- func ReplaceTLSSecret(namespace string, name string)
- func SaveServiceAccount(svcAccount *corev1.ServiceAccount) (*corev1.ServiceAccount, error)
- func SaveZarfState(state types.ZarfState) error
- func SplitYAML(yamlData []byte) ([]*unstructured.Unstructured, error)
- func WaitForPodsAndContainers(target types.ZarfContainerTarget, waitForAllPods bool) []string
- type DockerConfig
- type DockerConfigEntry
- type DockerConfigEntryWithAuth
- type ImageSwap
- type Tunnel
Constants ¶
const ( DistroIsUnknown = "unknown" DistroIsK3s = "k3s" DistroIsK3d = "k3d" DistroIsKind = "kind" DistroIsMicroK8s = "microk8s" DistroIsEKSAnywhere = "eksanywhere" DistroIsDockerDesktop = "dockerdesktop" )
const ( ZarfNamespace = "zarf" ZarfStateSecretName = "zarf-state" ZarfStateDataKey = "state" )
const ( PodResource = "pod" SvcResource = "svc" ZarfRegistry = "REGISTRY" ZarfLogging = "LOGGING" ZarfGit = "GIT" )
const ( PortRegistry = iota + 45001 PortLogging PortGit )
Variables ¶
This section is empty.
Functions ¶
func CreateNamespace ¶ added in v0.15.0
func CreateSecret ¶ added in v0.15.0
func DeleteSecret ¶ added in v0.15.0
func DeleteZarfNamespace ¶ added in v0.15.0
func DeleteZarfNamespace()
func DetectDistro ¶ added in v0.15.0
func GenerateRegistryPullCreds ¶ added in v0.15.0
func GenerateTLSSecret ¶ added in v0.15.0
func GetAllServiceAccounts ¶ added in v0.15.0
func GetAllServiceAccounts() (*corev1.ServiceAccountList, error)
func GetAvailablePort ¶ added in v0.15.0
GetAvailablePort retrieves an available port on the host machine. This delegates the port selection to the golang net library by starting a server and then checking the port that the server is using.
func GetContext ¶ added in v0.15.0
func GetNamespaces ¶ added in v0.15.0
func GetNamespaces() (*corev1.NamespaceList, error)
func GetService ¶ added in v0.15.0
GetService returns a Kubernetes service resource in the provided namespace with the given name.
func GetServiceAccount ¶ added in v0.15.0
func GetServiceAccount(namespace string, name string) (*corev1.ServiceAccount, error)
func GetServiceAccounts ¶ added in v0.15.0
func GetServiceAccounts(namespace string) (*corev1.ServiceAccountList, error)
func GetServicesByLabel ¶ added in v0.15.0
GetServicesByLabel returns a list of matched services given a label and value. To search all namespaces, pass "" in the namespace arg
func GetServicesByLabelExists ¶ added in v0.15.0
func GetServicesByLabelExists(namespace string, label string) (*corev1.ServiceList, error)
GetServicesByLabelExists returns a list of matched services given a label. To search all namespaces, pass "" in the namespace arg
func LoadZarfState ¶ added in v0.15.0
LoadZarfState returns the current zarf/zarf-state secret data or an empty ZarfState
func ProcessYamlFilesInPath ¶ added in v0.15.0
ProcessYamlFilesInPath iterates over all yaml files in a given path and performs Zarf templating + image swapping
func ReplaceSecret ¶ added in v0.15.0
func ReplaceTLSSecret ¶
func SaveServiceAccount ¶ added in v0.15.0
func SaveServiceAccount(svcAccount *corev1.ServiceAccount) (*corev1.ServiceAccount, error)
func SaveZarfState ¶ added in v0.15.0
SaveZarfState takes a given state and makepersists it to the zarf/zarf-state secret
func SplitYAML ¶ added in v0.15.0
func SplitYAML(yamlData []byte) ([]*unstructured.Unstructured, error)
SplitYAML splits a YAML file into unstructured objects. Returns list of all unstructured objects found in the yaml. If an error occurs, returns objects that have been parsed so far too. Source: https://github.com/argoproj/gitops-engine/blob/v0.5.2/pkg/utils/kube/kube.go#L286
func WaitForPodsAndContainers ¶
func WaitForPodsAndContainers(target types.ZarfContainerTarget, waitForAllPods bool) []string
WaitForPodsAndContainers holds execution up to 30 seconds waiting for health pods and containers (if specified)
Types ¶
type DockerConfig ¶ added in v0.15.0
type DockerConfig struct {
Auths DockerConfigEntry `json:"auths"`
}
type DockerConfigEntry ¶ added in v0.15.0
type DockerConfigEntry map[string]DockerConfigEntryWithAuth
type DockerConfigEntryWithAuth ¶ added in v0.15.0
type DockerConfigEntryWithAuth struct {
Auth string `json:"auth"`
}
type ImageSwap ¶ added in v0.15.0
type ImageSwap struct {
// contains filtered or unexported fields
}
ImageSwap Pre-compute all the replacements for the embedded registry
type Tunnel ¶ added in v0.15.0
type Tunnel struct {
// contains filtered or unexported fields
}
Tunnel is the main struct that configures and manages port forwading tunnels to Kubernetes resources.
func NewTunnel ¶ added in v0.15.0
func NewTunnel(namespace string, resourceType string, resourceName string, local int, remote int) *Tunnel
NewTunnel will create a new Tunnel struct Note that if you use 0 for the local port, an open port on the host system will be selected automatically, and the Tunnel struct will be updated with the selected port.
func NewZarfTunnel ¶ added in v0.15.0
func NewZarfTunnel() *Tunnel
func (*Tunnel) Close ¶ added in v0.15.0
func (tunnel *Tunnel) Close()
Close disconnects a tunnel connection by closing the StopChan, thereby stopping the goroutine.