Back to

Package clients

Latest Go to latest

The latest major version is v2.

Published: Jun 25, 2020 | License: Apache-2.0 | Module:


type Factory

type Factory interface {

	// WithBearerToken creates a factory from a k8s bearer token
	WithBearerToken(token string) Factory

	// ImpersonateUser creates a factory with an impersonated users
	ImpersonateUser(user string) Factory

	// CreateAuthConfigService creates a new authentication configuration service
	CreateAuthConfigService(fileName string, namespace string, serverKind string, serviceKind string) (auth.ConfigService, error)

	// CreateGitAuthConfigService creates a new git authentication configuration service
	CreateGitAuthConfigService(namespace string, serviceKind string) (auth.ConfigService, error)

	// CreateLocalGitAuthConfigService creates a new service which loads/saves Git auth config from/to a local file.
	CreateLocalGitAuthConfigService() (auth.ConfigService, error)

	// CreateJenkinsAuthConfigService creates a new Jenkins authentication configuration service
	CreateJenkinsAuthConfigService(namespace string, jenkinsService string) (auth.ConfigService, error)

	// CreateChartmuseumAuthConfigService creates a new Chartmuseum authentication configuration service
	CreateChartmuseumAuthConfigService(namespace string, serviceKind string) (auth.ConfigService, error)

	// CreateIssueTrackerAuthConfigService creates a new issuer tracker configuration service
	CreateIssueTrackerAuthConfigService(namespace string, serviceKind string) (auth.ConfigService, error)

	// CreateChatAuthConfigService creates a new chat configuration service
	CreateChatAuthConfigService(namespace string, serviceKind string) (auth.ConfigService, error)

	// CreateAddonAuthConfigService creates a new addon auth configuration service
	CreateAddonAuthConfigService(namespace string, serviceKind string) (auth.ConfigService, error)

	// CreateJenkinsClient creates a new Jenkins client
	CreateJenkinsClient(kubeClient kubernetes.Interface, ns string, handles util.IOFileHandles) (gojenkins.JenkinsClient, error)

	// CreateCustomJenkinsClient creates a new Jenkins client for the custom Jenkins App with the jenkinsServiceName
	CreateCustomJenkinsClient(kubeClient kubernetes.Interface, ns string, jenkinsServiceName string, handles util.IOFileHandles) (gojenkins.JenkinsClient, error)

	// CreateGitProvider creates a new Git provider
	CreateGitProvider(string, string, auth.ConfigService, string, string, bool, gits.Gitter, util.IOFileHandles) (gits.GitProvider, error)

	// CreateComplianceClient creates a new compliance client
	CreateComplianceClient() (*client.SonobuoyClient, error)

	// CreateSystemVaultClient creates the system vault client for managing the secrets
	CreateSystemVaultClient(namespace string) (vault.Client, error)

	// CreateVaultClient returns the vault client for given vault
	CreateVaultClient(name string, namespace string) (vault.Client, error)

	// CreateHelm creates a new helm client
	CreateHelm(verbose bool, helmBinary string, noTiller bool, helmTemplate bool) helm.Helmer

	// CreateKubeClient creates a new Kubernetes client
	CreateKubeClient() (kubernetes.Interface, string, error)

	// CreateKubeConfig creates the kubernetes configuration
	CreateKubeConfig() (*rest.Config, error)

	// CreateJXClient creates a new Kubernetes client for Jenkins X CRDs
	CreateJXClient() (versioned.Interface, string, error)

	// CreateApiExtensionsClient creates a new Kubernetes ApiExtensions client
	CreateApiExtensionsClient() (apiextensionsclientset.Interface, error)

	// CreateDynamicClient creates a new Kubernetes Dynamic client
	CreateDynamicClient() (dynamic.Interface, string, error)

	// CreateMetricsClient creates a new Kubernetes metrics client
	CreateMetricsClient() (metricsclient.Interface, error)

	// CreateTektonClient create a new Kubernetes client for Tekton resources
	CreateTektonClient() (tektonclient.Interface, string, error)

	// CreateProwJobClient creates a new Kubernetes client for ProwJob resources
	CreateProwJobClient() (prowjobclient.Interface, string, error)

	// CreateKnativeServeClient create a new Kubernetes client for Knative serve resources
	CreateKnativeServeClient() (kserve.Interface, string, error)

	// CreateVaultOperatorClient creates a new Kubernetes client for Vault operator resources
	CreateVaultOperatorClient() (vaultoperatorclient.Interface, error)

	// CreateCertManagerClient creates a new Kubernetes client for cert-manager resources
	CreateCertManagerClient() (certmngclient.Interface, error)

	// CreateTable creates a new table
	CreateTable(out io.Writer) table.Table

	// GetJenkinsURL returns the Jenkins URL
	GetJenkinsURL(kubeClient kubernetes.Interface, ns string) (string, error)

	// GetCustomJenkinsURL gets a custom jenkins App service URL
	GetCustomJenkinsURL(kubeClient kubernetes.Interface, ns string, jenkinsServiceName string) (string, error)

	// SetBatch configures the batch modes
	SetBatch(batch bool)

	// For tests only, assert that no actual network connections are being made.
	SetOffline(offline bool)

	// IsInCDPipeline indicates if the execution takes place within a CD pipeline
	IsInCDPipeline() bool

	// SecretsLocation inidcates the location of the secrets
	SecretsLocation() secrets.SecretsLocationKind

	// SetSecretsLocation configures the secrets location in memory. It will persist the secrets location in a
	// config map if the persist flag is active.
	SetSecretsLocation(location secrets.SecretsLocationKind, persist bool) error

	// ResetSecretsLocation resets the location of the secrets

	// CreateKustomizer creates a kustomize client
	CreateKustomizer() kustomize.Kustomizer

Factory is the interface defined for jx interactions via the cli go:generate pegomock generate Factory -o mocks/factory.go

func NewFactory

func NewFactory() Factory

NewFactory creates a factory with the default Kubernetes resources defined if optionalClientConfig is nil, then flags will be bound to a new clientcmd.ClientConfig. if optionalClientConfig is not nil, then this factory will make use of it.

func NewUsingFactory

func NewUsingFactory(jxf jxfactory.Factory) Factory

NewUsingFactory creates a factory with the given underlying factory. Used by downstream repos that reuse jx

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier