Documentation
¶
Index ¶
- func AddCommitAndPushChanges(ctx context.Context, repo *git.Repository, workTree *git.Worktree, ...) plumbing.Hash
- func CreateAndCheckoutToBranch(repo *git.Repository, branch string, workTree *git.Worktree)
- func CreateIntermediateDirsForFile(ctx context.Context, filePath string)
- func CreateK3DCluster(ctx context.Context, name string)
- func CreateKubernetesClient(ctx context.Context, kubeconfigPath string) client.Client
- func CreateNamespace(ctx context.Context, namespaceName string, kubeClient client.Client)
- func ExecuteCommand(command string) (string, error)
- func ExecuteCommandOrDie(command string) string
- func GenerateSealedSecret(ctx context.Context, secretFilePath string)
- func GetCapiClusterNamespace() string
- func GetClusterDir() string
- func GetClusterResource(ctx context.Context, kubeClient client.Client, ...) error
- func GetDefaultBranchName(ctx context.Context, repo *git.Repository) string
- func GetDirPathForDownloadedStorageBucketContents(bucketName string) string
- func GetEnv(name string) string
- func GetGitAuthMethod(ctx context.Context) (authMethod transport.AuthMethod)
- func GetParentDirPath(filePath string) string
- func GitCloneRepo(ctx context.Context, url, dirPath string, authMethod transport.AuthMethod) *git.Repository
- func HelmInstall(ctx context.Context, args *HelmInstallArgs)
- func InitTempDir()
- func InstallAndSetupArgoCD(ctx context.Context, clusterDir string, kubeClient client.Client)
- func InstallSealedSecrets(ctx context.Context)
- func SaveKubeconfig(ctx context.Context, kubeClient client.Client)
- func SyncArgoCDApp(ctx context.Context, name string, ...)
- func WaitForMainClusterToBeProvisioned(ctx context.Context, kubeClient client.Client)
- func WaitForMainClusterToBeReady(ctx context.Context, kubeClient client.Client)
- func WaitUntilPRMerged(ctx context.Context, repo *git.Repository, defaultBranchName string, ...)
- type HelmInstallArgs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddCommitAndPushChanges ¶
func CreateAndCheckoutToBranch ¶
func CreateAndCheckoutToBranch(repo *git.Repository, branch string, workTree *git.Worktree)
func CreateIntermediateDirsForFile ¶
Creates intermediate directories which don't exist for the given file path.
func CreateK3DCluster ¶
Creates a K3D cluster with the given name (only if it doesn't already exist).
func CreateKubernetesClient ¶
Uses the kubeconfig file present at the given path, to create and return a Kubernetes Go client.
func CreateNamespace ¶
Creates the given namespace (if it doesn't already exist).
func ExecuteCommand ¶
Executes the given command. Doesn't panic and returns error (if occurred).
func ExecuteCommandOrDie ¶
Executes the given command. Panics if the command execution fails.
func GenerateSealedSecret ¶
Takes the path to a Kubernetes Secret file. It replaces the contents of that file by generating the corresponding Sealed Secret.
func GetCapiClusterNamespace ¶
func GetCapiClusterNamespace() string
Returns the namespace (capi-cluster / capi-cluster-<customer-id>) where the 'cloud-credentials' Kubernetes Secret will exist. This Kubernetes Secret will be used by Cluster API to communicate with the underlying cloud provider.
func GetClusterDir ¶
func GetClusterDir() string
func GetClusterResource ¶
func GetClusterResource(ctx context.Context, kubeClient client.Client, cluster *clusterAPIV1Beta1.Cluster) error
Queries the Cluster resource using the given kube-client.
func GetDefaultBranchName ¶
func GetDirPathForDownloadedStorageBucketContents ¶
Returns the path to the local temp directory, where contents of the given blob storage bucket will be / is downloaded.
func GetEnv ¶
Returns value of the given environment variable. Panics if the environment variable isn't found.
func GetGitAuthMethod ¶
func GetGitAuthMethod(ctx context.Context) (authMethod transport.AuthMethod)
func GetParentDirPath ¶
Returns path to the parent dir of the given file.
func GitCloneRepo ¶
func GitCloneRepo(ctx context.Context, url, dirPath string, authMethod transport.AuthMethod) *git.Repository
Clones the given git repository into the given directory (only if the repo doesn't already exist in there). If the repo already exists, then it just does git pull.
func HelmInstall ¶
func HelmInstall(ctx context.Context, args *HelmInstallArgs)
Installs the given Helm chart (if not already deployed).
func InitTempDir ¶
func InitTempDir()
Creates a temp dir inside /tmp, where KubeAid Bootstrap Script will clone repos. Then sets the value of constants.TempDir as the temp dir path. If the temp dir already exists, then that gets reused.
func InstallAndSetupArgoCD ¶
Installs ArgoCD Helm chart and creates the root ArgoCD App. Then creates and returns an ArgoCD Application client.
func InstallSealedSecrets ¶
Installs Sealed Secrets in the underlying Kubernetes cluster.
func SaveKubeconfig ¶
Saves kubeconfig of the provisioned cluster locally.
func SyncArgoCDApp ¶
func SyncArgoCDApp(ctx context.Context, name string, resources []*argoCDV1Aplha1.SyncOperationResource)
Syncs the ArgoCD App (if not synced already). If the resources array is empty, then the whole ArgoCD App is synced. Otherwise, only the specified resources.
func WaitForMainClusterToBeProvisioned ¶
Waits for the main cluster to be provisioned.
func WaitForMainClusterToBeReady ¶
Waits for the main cluster to be ready to run our application workloads.