jx: github.com/jenkins-x/jx/pkg/cmd/clients Index | Files | Directories

package clients

import "github.com/jenkins-x/jx/pkg/cmd/clients"

Index

Package Files

factory.go interface.go

type Factory Uses

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, useGitCredentialsFile bool) (auth.ConfigService, error)

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

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

    // CreateIssueTrackerAuthConfigService creates a new issuer tracker configuration service
    CreateIssueTrackerAuthConfigService(namespace string, secrets *corev1.SecretList) (auth.ConfigService, error)

    // CreateChatAuthConfigService creates a new chat configuration service
    CreateChatAuthConfigService(namespace string, secrets *corev1.SecretList) (auth.ConfigService, error)

    // CreateAddonAuthConfigService creates a new addon auth configuration service
    CreateAddonAuthConfigService(namespace string, secrets *corev1.SecretList) (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.APIHelper, string, error)

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

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

    // CreateKnativeBuildClient create a new Kubernetes client for Knative Build resources
    CreateKnativeBuildClient() (buildclient.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

    // AuthMergePipelineSecrets merges the current config with the pipeline secrets provided in k8s secrets
    AuthMergePipelineSecrets(config *auth.AuthConfig, secrets *corev1.SecretList, kind string, isCDPipeline bool) error

    // 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()
}

Factory is the interface defined for jx interactions via the cli go:generate pegomock generate github.com/jenkins-x/jx/pkg/cmd/clients Factory -o mocks/factory.go

func NewFactory Uses

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.

Directories

PathSynopsis
fake
mocks

Package clients imports 37 packages (graph) and is imported by 10 packages. Updated 2019-11-14. Refresh now. Tools for package owners.