clients

package
v2.1.80 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2020 License: Apache-2.0 Imports: 39 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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)

	// CreateInternalVaultClient returns the Vault client for a Vault instance managed by Jenkins X.
	CreateInternalVaultClient(name string, namespace string) (vault.Client, error)

	// CreateExternalVaultClient returns a Vault client connecting to the Vault instance described in the specified Vault configuration.
	// The client authenticates with the JWT token of the specified service account in the given namespace.
	CreateExternalVaultClient(vaultConfig vault.Vault, kubeClient kubernetes.Interface) (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. It also returns the currently set namespace as per KUBECONFIG.
	// If no namespace is selected, 'default' is returned.
	// If an error occurs an error is returned together with a nil client and an empty string as current namespace.
	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
	ResetSecretsLocation()

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

Factory is the interface defined for jx interactions via the CLI

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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