Documentation ¶
Index ¶
- func GetBadClient() *badClient
- type FakeCommandExecutor
- type FakeFactory
- func (f *FakeFactory) GetAWSClient() (bbAws.Client, error)
- func (f *FakeFactory) GetClientSet() (kubernetes.Interface, error)
- func (f *FakeFactory) GetCommandExecutor(_ *cobra.Command, _ *coreV1.Pod, _ string, command []string, _ io.Writer, ...) (remoteCommand.Executor, error)
- func (f *FakeFactory) GetCommandWrapper(name string, args ...string) (*bbUtilApiWrappers.Command, error)
- func (f *FakeFactory) GetConfigClient(command *cobra.Command) (*bbConfig.ConfigClient, error)
- func (f *FakeFactory) GetCredentialHelper() (credentialhelper.CredentialHelper, error)
- func (f *FakeFactory) GetFakeCommandExecutor() (*FakeCommandExecutor, error)
- func (f *FakeFactory) GetGitLabClient() (bbGitLab.Client, error)
- func (f *FakeFactory) GetHelmClient(_ *cobra.Command, _ string) (helm.Client, error)
- func (f *FakeFactory) GetIOStream() (*genericIOOptions.IOStreams, error)
- func (f *FakeFactory) GetIronBankClient() (ironbank.Client, error)
- func (f *FakeFactory) GetIstioClientSet(_ *rest.Config) (bbUtilApiWrappers.IstioClientset, error)
- func (f *FakeFactory) GetK8sClientset(_ *cobra.Command) (kubernetes.Interface, error)
- func (f *FakeFactory) GetK8sDynamicClient(_ *cobra.Command) (dynamic.Interface, error)
- func (f *FakeFactory) GetLoggingClient() (bbLog.Client, error)
- func (f *FakeFactory) GetLoggingClientWithLogger(_ *slog.Logger) (bbLog.Client, error)
- func (f *FakeFactory) GetOutputClient(cmd *cobra.Command) (bbOutput.Client, error)
- func (f *FakeFactory) GetPipe() (commonInterfaces.FileLike, commonInterfaces.FileLike, error)
- func (f *FakeFactory) GetRestConfig(_ *cobra.Command) (*rest.Config, error)
- func (f *FakeFactory) GetRuntimeClient(scheme *runtime.Scheme) (client.Client, error)
- func (f *FakeFactory) GetViper() (*viper.Viper, error)
- func (f *FakeFactory) ResetIOStream()
- func (f *FakeFactory) ResetPipe()
- func (f *FakeFactory) SetAWSConfig(awsConfig *aws.Config)
- func (f *FakeFactory) SetCallerIdentity(callerIdentity *bbAws.CallerIdentity)
- func (f *FakeFactory) SetClusterIPs(clusterIPs *[]bbAws.ClusterIP)
- func (f *FakeFactory) SetConfigClient(configClient *bbConfig.ConfigClient)
- func (f *FakeFactory) SetCredentialHelper(credentialHelper credentialhelper.CredentialHelper)
- func (f *FakeFactory) SetEC2Client(ec2Client *ec2.Client)
- func (f *FakeFactory) SetGVRToListKind(gvrToListKind map[schema.GroupVersionResource]string)
- func (f *FakeFactory) SetGitLabGetFileFunc(getFileFunc fakeGitLab.GetFileFunc)
- func (f *FakeFactory) SetGitLabGetProjectFunc(getProjectFunc fakeGitLab.GetProjectFunc)
- func (f *FakeFactory) SetGitLabGetReleaseArtifactFunc(getReleaseArtifactFunc fakeGitLab.GetReleaseArtifactFunc)
- func (f *FakeFactory) SetHelmGetListFunc(getListFunc helm.GetListFunc)
- func (f *FakeFactory) SetHelmGetReleaseFunc(getReleaseFunc helm.GetReleaseFunc)
- func (f *FakeFactory) SetHelmGetValuesFunc(getValuesFunc helm.GetValuesFunc)
- func (f *FakeFactory) SetHelmReleases(helmReleases []*release.Release)
- func (f *FakeFactory) SetIOStream(stream *genericIOOptions.IOStreams)
- func (f *FakeFactory) SetIronBankGetImageSHAFunc(getImageSHAFunc fakeIronBank.GetImageSHAFunc)
- func (f *FakeFactory) SetLoggingFunc(loggingFunc fakeLog.LoggingFunction)
- func (f *FakeFactory) SetObjects(objects []runtime.Object)
- func (f *FakeFactory) SetPipe(reader commonInterfaces.FileLike, writer commonInterfaces.FileLike) error
- func (f *FakeFactory) SetResources(resources []*metaV1.APIResourceList)
- func (f *FakeFactory) SetSTSClient(stsClient *sts.Client)
- func (f *FakeFactory) SetViper(v *viper.Viper) error
- func (f *FakeFactory) SetVirtualServices(virtualServices *apisV1Beta1.VirtualServiceList)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBadClient ¶
func GetBadClient() *badClient
Types ¶
type FakeCommandExecutor ¶
FakeCommandExecutor - fake command executor
func (*FakeCommandExecutor) Stream ¶
func (f *FakeCommandExecutor) Stream(options remoteCommand.StreamOptions) error
Stream - stream command result
func (*FakeCommandExecutor) StreamWithContext ¶
func (f *FakeCommandExecutor) StreamWithContext( _ context.Context, options remoteCommand.StreamOptions, ) error
StreamWithContext - stream command result with given context
type FakeFactory ¶
type FakeFactory struct { SetFail struct { GetCredentialHelper bool GetConfigClient int // the number of times to pass before returning an error every time, 0 is never fail GetHelmClient bool GetOutputClient bool GetK8sDynamicClient bool GetK8sDynamicClientPrepFuncs []*func(clientset *dynamicFake.FakeDynamicClient) GetK8sClientset bool GetK8sClientsetPrepFuncs []*func(clientset *fake.Clientset) GetCommandExecutor bool GetCommandWrapper bool SetCommandWrapperRunError bool GetPolicyClient bool GetCrds bool GetDescriptor bool DescriptorType string GetAWSClient bool GetIstioClient bool GetIOStreams int // the number of times to pass before returning an error every time, 0 is never fail GetLoggingClient bool GetPipe bool GetRuntimeClient bool GetViper int // the number of times to pass before returning an error every time, 0 is never fail GetViperCount int // the number of times the GetViper function has been called GetGitLabClient bool GetIronBankClient bool // configure the AWS fake client and fake istio client to fail on certain calls // configure the AWS fake client to fail on certain calls AWS fakeAws.SetFail Istio fakeApiWrappers.SetFail // contains filtered or unexported fields } // contains filtered or unexported fields }
FakeFactory - fake factory
func GetFakeFactory ¶
func GetFakeFactory() *FakeFactory
GetEmptyFakeFactory - get empty fake factory
func (*FakeFactory) GetAWSClient ¶
func (f *FakeFactory) GetAWSClient() (bbAws.Client, error)
GetAWSClient constructs a fake AWS client
func (*FakeFactory) GetClientSet ¶
func (f *FakeFactory) GetClientSet() (kubernetes.Interface, error)
GetClientSet - get clientset
func (*FakeFactory) GetCommandExecutor ¶
func (f *FakeFactory) GetCommandExecutor( _ *cobra.Command, _ *coreV1.Pod, _ string, command []string, _ io.Writer, _ io.Writer, ) (remoteCommand.Executor, error)
GetCommandExecutor - execute command in a Pod
func (*FakeFactory) GetCommandWrapper ¶
func (f *FakeFactory) GetCommandWrapper( name string, args ...string, ) (*bbUtilApiWrappers.Command, error)
GetCommandWrapper - get command wrapper
func (*FakeFactory) GetConfigClient ¶
func (f *FakeFactory) GetConfigClient(command *cobra.Command) (*bbConfig.ConfigClient, error)
GetConfigClient - get config client
func (*FakeFactory) GetCredentialHelper ¶
func (f *FakeFactory) GetCredentialHelper() (credentialhelper.CredentialHelper, error)
GetCredentialHelper - get credential helper
func (*FakeFactory) GetFakeCommandExecutor ¶
func (f *FakeFactory) GetFakeCommandExecutor() (*FakeCommandExecutor, error)
GetFakeCommandExecutor - get fake command executor
func (*FakeFactory) GetGitLabClient ¶
func (f *FakeFactory) GetGitLabClient() (bbGitLab.Client, error)
GetGitLabClient constructs a fake GitLab client
func (*FakeFactory) GetHelmClient ¶
GetHelmClient - get helm client
func (*FakeFactory) GetIOStream ¶
func (f *FakeFactory) GetIOStream() (*genericIOOptions.IOStreams, error)
GetIOStream initializes and returns a new IOStreams object used to interact with console input, output, and error output
func (*FakeFactory) GetIronBankClient ¶
func (f *FakeFactory) GetIronBankClient() (ironbank.Client, error)
func (*FakeFactory) GetIstioClientSet ¶
func (f *FakeFactory) GetIstioClientSet(_ *rest.Config) (bbUtilApiWrappers.IstioClientset, error)
GetIstioClientSet - get istio clientset
func (*FakeFactory) GetK8sClientset ¶
func (f *FakeFactory) GetK8sClientset(_ *cobra.Command) (kubernetes.Interface, error)
GetK8sClientset - get k8s clientset
func (*FakeFactory) GetK8sDynamicClient ¶
GetK8sDynamicClient - get k8s dynamic client
func (*FakeFactory) GetLoggingClient ¶
func (f *FakeFactory) GetLoggingClient() (bbLog.Client, error)
GetLoggingClient - get logging client
func (*FakeFactory) GetLoggingClientWithLogger ¶
GetLoggingClientWithLogger - get logging client providing logger
func (*FakeFactory) GetOutputClient ¶
GetOutputClient
func (*FakeFactory) GetPipe ¶
func (f *FakeFactory) GetPipe() (commonInterfaces.FileLike, commonInterfaces.FileLike, error)
GetPipe - get the pipe reader and writer
func (*FakeFactory) GetRestConfig ¶
GetRestConfig - get rest config
func (*FakeFactory) GetRuntimeClient ¶
GetRuntimeClient - get runtime client
func (*FakeFactory) GetViper ¶
func (f *FakeFactory) GetViper() (*viper.Viper, error)
GetViper - get viper
func (*FakeFactory) ResetIOStream ¶
func (f *FakeFactory) ResetIOStream()
ResetIOStream resets the IOStreams singleton
func (*FakeFactory) ResetPipe ¶
func (f *FakeFactory) ResetPipe()
ResetPipe resets the pipe reader and writer to nil
func (*FakeFactory) SetAWSConfig ¶
func (f *FakeFactory) SetAWSConfig(awsConfig *aws.Config)
SetAWSConfig - set aws config
func (*FakeFactory) SetCallerIdentity ¶
func (f *FakeFactory) SetCallerIdentity(callerIdentity *bbAws.CallerIdentity)
SetCallerIdentity - set caller identity
func (*FakeFactory) SetClusterIPs ¶
func (f *FakeFactory) SetClusterIPs(clusterIPs *[]bbAws.ClusterIP)
SetClusterIPs - set cluster IPs
func (*FakeFactory) SetConfigClient ¶
func (f *FakeFactory) SetConfigClient(configClient *bbConfig.ConfigClient)
SetConfigClient sets the configuration client returned by the fake factory. This may be useful for tests that set configuration values directly that bypass the viper instance.
func (*FakeFactory) SetCredentialHelper ¶
func (f *FakeFactory) SetCredentialHelper(credentialHelper credentialhelper.CredentialHelper)
func (*FakeFactory) SetEC2Client ¶
func (f *FakeFactory) SetEC2Client(ec2Client *ec2.Client)
SetEC2Client - set ec2 client
func (*FakeFactory) SetGVRToListKind ¶
func (f *FakeFactory) SetGVRToListKind(gvrToListKind map[schema.GroupVersionResource]string)
SetGVRToListKind - set gvr to list kind
func (*FakeFactory) SetGitLabGetFileFunc ¶
func (f *FakeFactory) SetGitLabGetFileFunc(getFileFunc fakeGitLab.GetFileFunc)
SetGitLabGetFileFunc sets the GetFile function on the fake GitLab client
func (*FakeFactory) SetGitLabGetProjectFunc ¶
func (f *FakeFactory) SetGitLabGetProjectFunc(getProjectFunc fakeGitLab.GetProjectFunc)
SetGitLabGetProjectFunc sets the GetProject function on the fake GitLab client
func (*FakeFactory) SetGitLabGetReleaseArtifactFunc ¶
func (f *FakeFactory) SetGitLabGetReleaseArtifactFunc(getReleaseArtifactFunc fakeGitLab.GetReleaseArtifactFunc)
SetGitLabGetReleaseArtifactFunc sets the getReleaseArtifact function on the fake GitLab client
func (*FakeFactory) SetHelmGetListFunc ¶
func (f *FakeFactory) SetHelmGetListFunc(getListFunc helm.GetListFunc)
SetHelmGetListFunc sets the GetList function on the fake helm client
func (*FakeFactory) SetHelmGetReleaseFunc ¶
func (f *FakeFactory) SetHelmGetReleaseFunc(getReleaseFunc helm.GetReleaseFunc)
SetHelmGetReleaseFunc sets the GetRelease function on the fake helm client
func (*FakeFactory) SetHelmGetValuesFunc ¶
func (f *FakeFactory) SetHelmGetValuesFunc(getValuesFunc helm.GetValuesFunc)
SetHelmGetValuesFunc sets the GetValues function on the fake helm client
func (*FakeFactory) SetHelmReleases ¶
func (f *FakeFactory) SetHelmReleases(helmReleases []*release.Release)
SetHelmReleases - set helm releases
func (*FakeFactory) SetIOStream ¶
func (f *FakeFactory) SetIOStream(stream *genericIOOptions.IOStreams)
func (*FakeFactory) SetIronBankGetImageSHAFunc ¶
func (f *FakeFactory) SetIronBankGetImageSHAFunc(getImageSHAFunc fakeIronBank.GetImageSHAFunc)
SetIronBankGetImageSHAFunc sets the GetImageSHA function on the fake ironbank client
func (*FakeFactory) SetLoggingFunc ¶
func (f *FakeFactory) SetLoggingFunc(loggingFunc fakeLog.LoggingFunction)
SetLoggingFunc - set logging function
func (*FakeFactory) SetObjects ¶
func (f *FakeFactory) SetObjects(objects []runtime.Object)
SetObjects - set objects
func (*FakeFactory) SetPipe ¶
func (f *FakeFactory) SetPipe(reader commonInterfaces.FileLike, writer commonInterfaces.FileLike) error
SetPipe - set the pipe reader and writer
func (*FakeFactory) SetResources ¶
func (f *FakeFactory) SetResources(resources []*metaV1.APIResourceList)
SetResources - set resources
func (*FakeFactory) SetSTSClient ¶
func (f *FakeFactory) SetSTSClient(stsClient *sts.Client)
SetSTSClient - set sts client
func (*FakeFactory) SetViper ¶
func (f *FakeFactory) SetViper(v *viper.Viper) error
SetViper sets the viper instance
func (*FakeFactory) SetVirtualServices ¶
func (f *FakeFactory) SetVirtualServices(virtualServices *apisV1Beta1.VirtualServiceList)
SetVirtualServices - set virtual services