gitShim

package
v0.107.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Copyright (C) 2021-2023, Kubefirst

This program is licensed under MIT. See the LICENSE file for more details.

This program is licensed under MIT. See the LICENSE file for more details.

This program is licensed under MIT. See the LICENSE file for more details.

This program is licensed under MIT. See the LICENSE file for more details.

This program is licensed under MIT. See the LICENSE file for more details.

Index

Constants

View Source
const (
	KubefirstGitHubOrganization      = "kubefirst"
	KubefirstGitopsCatalogRepository = "gitops-catalog"
)

Variables

This section is empty.

Functions

func CreateContainerRegistrySecret

func CreateContainerRegistrySecret(obj *ContainerRegistryAuth) (string, error)

CreateContainerRegistrySecret

func InitializeGitProvider

func InitializeGitProvider(p *GitInitParameters) error

InitializeGitProvider

func NewGitHub

func NewGitHub() *github.Client

NewGitHub instantiates an unauthenticated GitHub client

func PrepareGitEnvironment

func PrepareGitEnvironment(cluster *pkgtypes.Cluster, gitopsDir string) error

func PrepareGitOpsCatalog

func PrepareGitOpsCatalog(gitopsCatalogDir string) error

func PrepareMgmtCluster

func PrepareMgmtCluster(cluster pkgtypes.Cluster) error

func PullWithAuth

func PullWithAuth(repo *git.Repository, remote string, branch string, auth transport.AuthMethod) error

PullWithAuth

Types

type ContainerRegistryAuth

type ContainerRegistryAuth struct {
	GitProvider           string
	GitUser               string
	GitToken              string
	GitlabGroupFlag       string
	GithubOwner           string
	ContainerRegistryHost string

	Clientset kubernetes.Interface
}

type GitHubClient

type GitHubClient struct {
	Client *github.Client
}

GitHubClient acts as a receiver for interacting with GitHub's API

func (*GitHubClient) GetGitopsCatalogRepo

func (gh *GitHubClient) GetGitopsCatalogRepo() (*github.Repository, error)

GetGitopsCatalogRepo returns an object detailing the Kubefirst gitops catalog GitHub repository

func (*GitHubClient) ReadGitopsCatalogAppDirectory

func (gh *GitHubClient) ReadGitopsCatalogAppDirectory(contents []*github.RepositoryContent, applicationName string) ([][]byte, error)

ReadGitopsCatalogAppDirectory reads the file content in a gitops catalog app directory

func (*GitHubClient) ReadGitopsCatalogIndex

func (gh *GitHubClient) ReadGitopsCatalogIndex(contents []*github.RepositoryContent) ([]byte, error)

ReadGitopsCatalogIndex reads the gitops catalog repository index

func (*GitHubClient) ReadGitopsCatalogRepoContents

func (gh *GitHubClient) ReadGitopsCatalogRepoContents() ([]*github.RepositoryContent, error)

ReadGitopsCatalogRepoContents reads the file and directory contents of the Kubefirst gitops catalog GitHub repository

func (*GitHubClient) ReadGitopsCatalogRepoDirectory

func (gh *GitHubClient) ReadGitopsCatalogRepoDirectory(path string) ([]*github.RepositoryContent, error)

ReadGitopsCatalogRepoDirectory reads the files in a gitops catalog repo directory

type GitInitParameters

type GitInitParameters struct {
	GitProvider  string
	GitToken     string
	GitOwner     string
	GitProtocol  string
	Repositories []string
	Teams        []string
	GithubOrg    string
	GitlabGroup  string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL