Documentation
¶
Index ¶
- func CommitAndPush(repoDir string, msg string, file string, otherFiles ...string) error
- func DeferCleanupOnSuccess(args ...any)
- func GetNonEmptyLines(output string) []string
- func GetProjectDir() (string, error)
- func GetTestNamespace() (string, error)
- func InitializeRepoWithFunction(repoURL, username, password, language string, optFns ...RepoOption) (string, error)
- func IsRegistryInsecure() bool
- func OperatorSdkRun(command string, args ...string) (string, error)
- func Registry() string
- func Run(cmd *exec.Cmd) (string, error)
- func RunFunc(command string, args ...string) (string, error)
- func RunFuncDeploy(functionDir string, optFns ...FuncDeployOption) (string, error)
- func RunFuncWithVersion(version string, command string, args ...string) (string, error)
- type FuncDeployOption
- type FuncDeployOptions
- type GiteaClient
- func (g *GiteaClient) CreateAccessToken(username, password, tokenName string) (string, error)
- func (g *GiteaClient) CreateRandomRepo(owner string, private bool) (name, url string, cleanup func(), err error)
- func (g *GiteaClient) CreateRandomUser() (username, password, email string, cleanup func(), err error)
- func (g *GiteaClient) CreateRepo(owner, name string, private bool) (url string, cleanup func(), err error)
- func (g *GiteaClient) CreateUser(username, password, email string) (cleanup func(), err error)
- func (g *GiteaClient) DeleteRepo(owner, name string) error
- func (g *GiteaClient) DeleteUser(username string) error
- type RepoOption
- type RepoOptions
- type RepositoryProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommitAndPush ¶ added in v0.2.0
CommitAndPush commits and pushes specified files with a custom message Requires at least one file to be specified
func DeferCleanupOnSuccess ¶ added in v0.2.0
func DeferCleanupOnSuccess(args ...any)
func GetNonEmptyLines ¶
GetNonEmptyLines converts given command output string into individual objects according to line breakers, and ignores the empty elements in it.
func GetProjectDir ¶
GetProjectDir will return the directory where the project is
func GetTestNamespace ¶ added in v0.2.0
func InitializeRepoWithFunction ¶ added in v0.2.0
func InitializeRepoWithFunction(repoURL, username, password, language string, optFns ...RepoOption) (string, error)
InitializeRepoWithFunction creates a function project and pushes it to the Gitea repo
func IsRegistryInsecure ¶ added in v0.2.0
func IsRegistryInsecure() bool
IsRegistryInsecure returns if the registry for the e2e tests is insecure (no TLS verify)
func OperatorSdkRun ¶ added in v0.2.0
func Registry ¶ added in v0.2.0
func Registry() string
Registry returns the registry used for the e2e tests
func RunFuncDeploy ¶ added in v0.2.0
func RunFuncDeploy(functionDir string, optFns ...FuncDeployOption) (string, error)
RunFuncDeploy runs func deploy with retry logic for transient network errors
Types ¶
type FuncDeployOption ¶ added in v0.2.0
type FuncDeployOption func(*FuncDeployOptions)
func WithBuilder ¶ added in v0.2.0
func WithBuilder(builder string) FuncDeployOption
func WithDeployCliVersion ¶ added in v0.2.0
func WithDeployCliVersion(version string) FuncDeployOption
func WithDeployer ¶ added in v0.2.0
func WithDeployer(deployer string) FuncDeployOption
func WithNamespace ¶ added in v0.2.0
func WithNamespace(namespace string) FuncDeployOption
type FuncDeployOptions ¶ added in v0.2.0
type GiteaClient ¶ added in v0.2.0
type GiteaClient struct {
// contains filtered or unexported fields
}
GiteaClient wraps the Gitea SDK client and provides helper methods
func NewGiteaClient ¶ added in v0.2.0
func NewGiteaClient() (*GiteaClient, error)
NewGiteaClient discovers Gitea endpoint from ConfigMap and creates client
func (*GiteaClient) CreateAccessToken ¶ added in v0.2.0
func (g *GiteaClient) CreateAccessToken(username, password, tokenName string) (string, error)
CreateAccessToken creates a personal access token for a user
func (*GiteaClient) CreateRandomRepo ¶ added in v0.2.0
func (g *GiteaClient) CreateRandomRepo(owner string, private bool) (name, url string, cleanup func(), err error)
CreateRandomRepo creates a repo with a random name
func (*GiteaClient) CreateRandomUser ¶ added in v0.2.0
func (g *GiteaClient) CreateRandomUser() (username, password, email string, cleanup func(), err error)
CreateRandomUser creates a user with random credentials
func (*GiteaClient) CreateRepo ¶ added in v0.2.0
func (g *GiteaClient) CreateRepo(owner, name string, private bool) (url string, cleanup func(), err error)
CreateRepo creates a new repository and returns its URL
func (*GiteaClient) CreateUser ¶ added in v0.2.0
func (g *GiteaClient) CreateUser(username, password, email string) (cleanup func(), err error)
CreateUser creates a new Gitea user
func (*GiteaClient) DeleteRepo ¶ added in v0.2.0
func (g *GiteaClient) DeleteRepo(owner, name string) error
DeleteRepo deletes a repository
func (*GiteaClient) DeleteUser ¶ added in v0.2.0
func (g *GiteaClient) DeleteUser(username string) error
DeleteUser deletes a Gitea user
type RepoOption ¶ added in v0.2.0
type RepoOption func(*RepoOptions)
func WithCliVersion ¶ added in v0.2.0
func WithCliVersion(cliVersion string) RepoOption
func WithSubDir ¶ added in v0.2.0
func WithSubDir(subDir string) RepoOption
type RepoOptions ¶ added in v0.2.0
type RepositoryProvider ¶ added in v0.2.0
type RepositoryProvider interface {
// User management
CreateUser(username, password, email string) (cleanup func(), err error)
DeleteUser(username string) error
CreateRandomUser() (username, password, email string, cleanup func(), err error)
// Repository management
CreateRepo(owner, name string, private bool) (url string, cleanup func(), err error)
DeleteRepo(owner, name string) error
CreateRandomRepo(owner string, private bool) (name, url string, cleanup func(), err error)
// Authentication
CreateAccessToken(username, password, tokenName string) (string, error)
}
RepositoryProvider defines the interface for interacting with Git repository hosting providers