helm

package
v0.0.0-...-e4c3a4d Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitClient

type GitClient interface {
	GetRef(ctx context.Context, owner string, repo string, ref string) (*github.Reference, *github.Response, error)
	CreateRef(ctx context.Context, owner string, repo string, ref *github.Reference) (*github.Reference, *github.Response, error)
	CreateTree(ctx context.Context, owner string, repo string, baseTree string, entries []*github.TreeEntry) (*github.Tree, *github.Response, error)
	CreateCommit(ctx context.Context, owner string, repo string, commit *github.Commit) (*github.Commit, *github.Response, error)
	UpdateRef(ctx context.Context, owner string, repo string, ref *github.Reference, force bool) (*github.Reference, *github.Response, error)
	CreateBlob(ctx context.Context, owner string, repo string, blob *github.Blob) (*github.Blob, *github.Response, error)
}

type GitHubClient

GitHubClient provides the minimum necessary GitHub API client methods required by the RepositoryManager.

type PullRequestClient

type PullRequestClient interface {
	Create(ctx context.Context, owner string, repo string, pull *github.NewPullRequest) (*github.PullRequest, *github.Response, error)
}

type RepositoriesClient

type RepositoriesClient interface {
	// GetPermissionLevel retrieves the specific permission level a collaborator has for a given repository.
	// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#get-repository-permissions-for-a-user
	GetPermissionLevel(ctx context.Context, owner, repo, user string) (*github.RepositoryPermissionLevel, *github.Response, error)
	GetCommit(ctx context.Context, owner, repo, sha string) (*github.RepositoryCommit, *github.Response, error)
}

type RepositoryManager

type RepositoryManager interface {
	// Check is called immediately after instantiating the RepositoryManager to
	// verify that the supplied GitHub configuration is valid and that the
	// supplied GitHub client has permissions to perform branching, uploading
	// and creating PRs.
	Check(ctx context.Context) error
	// Publish creates a new GitHub branch, uploads all the chart files and then
	// creates a PR to merge those into the main branch for the repository.
	// The PR URl is returned on success.
	Publish(ctx context.Context, releaseName string, charts ...manifests.Chart) (prURL string, err error)
}

func NewGitHubRepositoryManager

func NewGitHubRepositoryManager(client *GitHubClient, owner, repo, branch string) RepositoryManager

NewGitHubRepositoryManager returns a gitHubRepositoryManager which implements RepositoryManager to upload Helm charts to a branch in a GitHub repository and create a PR.

type UsersClient

type UsersClient interface {
	// Get fetches a user. Passing the empty string will fetch the authenticated
	// user.
	//
	// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/users/#get-the-authenticated-user
	// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/users/#get-a-user
	Get(ctx context.Context, user string) (*github.User, *github.Response, error)
}

Jump to

Keyboard shortcuts

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