Documentation ¶
Index ¶
- Constants
- func NewProviderClient(cloud clientconfig.Cloud, regionName string, caCert []byte, logger logr.Logger) (*gophercloud.ProviderClient, *clientconfig.ClientOpts, string, error)
- type Factory
- type MockScopeFactory
- func (f *MockScopeFactory) ExtractToken() (*tokens.Token, error)
- func (f *MockScopeFactory) NewClientScopeFromObject(_ context.Context, _ client.Client, _ []byte, _ logr.Logger, ...) (Scope, error)
- func (f *MockScopeFactory) NewComputeClient() (clients.ComputeClient, error)
- func (f *MockScopeFactory) NewImageClient() (clients.ImageClient, error)
- func (f *MockScopeFactory) NewLbClient() (clients.LbClient, error)
- func (f *MockScopeFactory) NewNetworkClient() (clients.NetworkClient, error)
- func (f *MockScopeFactory) NewVolumeClient() (clients.VolumeClient, error)
- func (f *MockScopeFactory) ProjectID() string
- func (f *MockScopeFactory) SetClientScopeCreateError(err error)
- type Scope
- type WithLogger
Constants ¶
View Source
const ( CloudsSecretKey = "clouds.yaml" CASecretKey = "cacert" )
Variables ¶
This section is empty.
Functions ¶
func NewProviderClient ¶ added in v0.8.0
func NewProviderClient(cloud clientconfig.Cloud, regionName string, caCert []byte, logger logr.Logger) (*gophercloud.ProviderClient, *clientconfig.ClientOpts, string, error)
Types ¶
type Factory ¶ added in v0.8.0
type Factory interface { // NewClientScopeFromObject creates a new scope from the first object which returns an OpenStackIdentityRef NewClientScopeFromObject(ctx context.Context, ctrlClient client.Client, defaultCACert []byte, logger logr.Logger, objects ...infrav1.IdentityRefProvider) (Scope, error) }
Factory instantiates a new Scope using credentials from an IdentityRefProvider.
func NewFactory ¶ added in v0.9.0
NewFactory creates the default scope factory. It generates service clients which make OpenStack API calls against a running cloud.
type MockScopeFactory ¶ added in v0.8.0
type MockScopeFactory struct { ComputeClient *mock.MockComputeClient NetworkClient *mock.MockNetworkClient VolumeClient *mock.MockVolumeClient ImageClient *mock.MockImageClient LbClient *mock.MockLbClient // contains filtered or unexported fields }
MockScopeFactory implements both the ScopeFactory and ClientScope interfaces. It can be used in place of the default ProviderScopeFactory when we want to use mocked service clients which do not attempt to connect to a running OpenStack cloud.
func NewMockScopeFactory ¶ added in v0.8.0
func NewMockScopeFactory(mockCtrl *gomock.Controller, projectID string) *MockScopeFactory
func (*MockScopeFactory) ExtractToken ¶ added in v0.9.0
func (f *MockScopeFactory) ExtractToken() (*tokens.Token, error)
func (*MockScopeFactory) NewClientScopeFromObject ¶ added in v0.11.0
func (*MockScopeFactory) NewComputeClient ¶ added in v0.8.0
func (f *MockScopeFactory) NewComputeClient() (clients.ComputeClient, error)
func (*MockScopeFactory) NewImageClient ¶ added in v0.8.0
func (f *MockScopeFactory) NewImageClient() (clients.ImageClient, error)
func (*MockScopeFactory) NewLbClient ¶ added in v0.8.0
func (f *MockScopeFactory) NewLbClient() (clients.LbClient, error)
func (*MockScopeFactory) NewNetworkClient ¶ added in v0.8.0
func (f *MockScopeFactory) NewNetworkClient() (clients.NetworkClient, error)
func (*MockScopeFactory) NewVolumeClient ¶ added in v0.8.0
func (f *MockScopeFactory) NewVolumeClient() (clients.VolumeClient, error)
func (*MockScopeFactory) ProjectID ¶ added in v0.8.0
func (f *MockScopeFactory) ProjectID() string
func (*MockScopeFactory) SetClientScopeCreateError ¶ added in v0.8.0
func (f *MockScopeFactory) SetClientScopeCreateError(err error)
type Scope ¶
type Scope interface { NewComputeClient() (clients.ComputeClient, error) NewVolumeClient() (clients.VolumeClient, error) NewImageClient() (clients.ImageClient, error) NewNetworkClient() (clients.NetworkClient, error) NewLbClient() (clients.LbClient, error) ProjectID() string ExtractToken() (*tokens.Token, error) }
Scope contains arguments common to most operations.
func NewCachedProviderScope ¶ added in v0.9.0
func NewCachedProviderScope(cache *cache.LRUExpireCache, cloud clientconfig.Cloud, regionName string, caCert []byte, logger logr.Logger) (Scope, error)
func NewProviderScope ¶ added in v0.8.0
type WithLogger ¶ added in v0.10.0
type WithLogger struct { Scope // contains filtered or unexported fields }
WithLogger extends Scope with a logger.
func NewWithLogger ¶ added in v0.10.0
func NewWithLogger(scope Scope, logger logr.Logger) *WithLogger
func (*WithLogger) Logger ¶ added in v0.10.0
func (s *WithLogger) Logger() logr.Logger
Click to show internal directories.
Click to hide internal directories.