Documentation ¶
Index ¶
- Constants
- Variables
- func ArtifactFactoryForSettings(ctx context.Context, settings *v1.Settings, ...) (factory.ResourceClientFactory, error)
- func ConfigFactoryForSettings(params ConfigFactoryParams, resourceCrd crd.Crd) (factory.ResourceClientFactory, error)
- func ConsulClientForSettings(ctx context.Context, settings *v1.Settings) (*consulapi.Client, error)
- func KubeServiceClientForSettings(ctx context.Context, settings *v1.Settings, ...) (skkube.ServiceClient, error)
- func NewMultiSecretResourceClientFactory(params MultiSecretFactoryParams) (factory.ResourceClientFactory, error)
- func NewSecretResourceClientFactory(ctx context.Context, params SecretFactoryParams) (factory.ResourceClientFactory, error)
- func NewVaultSecretClientFactory(clientInit VaultClientInitFunc, pathPrefix, rootKey string) factory.ResourceClientFactory
- func SecretFactoryForSettings(ctx context.Context, params SecretFactoryParams) (factory.ResourceClientFactory, error)
- func VaultClientForSettings(ctx context.Context, vaultSettings *v1.Settings_VaultSecrets, ...) (*api.Client, error)
- type ConfigFactoryParams
- type MultiSecretFactoryParams
- type MultiSecretResourceClient
- func (m *MultiSecretResourceClient) ApplyStatus(statusClient resources.StatusClient, inputResource resources.InputResource, ...) (resources.Resource, error)
- func (m *MultiSecretResourceClient) Delete(namespace string, name string, opts clients.DeleteOpts) error
- func (m *MultiSecretResourceClient) Kind() string
- func (m *MultiSecretResourceClient) List(namespace string, opts clients.ListOpts) (resources.ResourceList, error)
- func (m *MultiSecretResourceClient) NewResource() resources.Resource
- func (m *MultiSecretResourceClient) Read(namespace string, name string, opts clients.ReadOpts) (resources.Resource, error)
- func (m *MultiSecretResourceClient) Register() errordeprecated
- func (m *MultiSecretResourceClient) Watch(namespace string, opts clients.WatchOpts) (<-chan resources.ResourceList, <-chan error, error)
- func (m *MultiSecretResourceClient) Write(resource resources.Resource, opts clients.WriteOpts) (resources.Resource, error)
- type MultiSecretResourceClientFactory
- type SecretFactoryParams
- type SourceList
- type VaultClientInitFunc
Constants ¶
const ( DefaultK8sQPS = 50 // 10x the k8s-recommended default; gloo gets busy writing status updates DefaultK8sBurst = 100 // 10x the k8s-recommended default; gloo gets busy writing status updates DefaultRootKey = "gloo" // used for vault and consul key-value storage )
const DefaultPathPrefix = "secret"
The DefaultPathPrefix may be overridden to allow for non-standard vault mount paths
const SecretSourceAPIVaultClientInitIndex = -1
SecretSourceAPIVaultClientInitIndex is a dedicated index for use of the SecretSource API
Variables ¶
var ( // ErrNilSourceSlice indicates a nil slice of sources was passed to the factory, // and we can therefore not initialize any sub-clients ErrNilSourceSlice = errors.New("nil slice of secret sources") // ErrEmptySourceSlice indicates the factory held an empty slice of sources while // trying to create a new client, and we can therefore not initialize any sub-clients ErrEmptySourceSlice = errors.New("empty slice of secret sources") )
var DefaultConsulQueryOptions = &consulapi.QueryOptions{RequireConsistent: true, AllowStale: false}
DefaultConsulQueryOptions provides default query options for consul
var ( // ErrNotImplemented indicates a call was made to an interface method which has not been implemented ErrNotImplemented = errors.New("interface method not implemented") )
Functions ¶
func ArtifactFactoryForSettings ¶
func ArtifactFactoryForSettings(ctx context.Context, settings *v1.Settings, sharedCache memory.InMemoryResourceCache, cfg **rest.Config, clientset *kubernetes.Interface, kubeCoreCache *cache.KubeCoreCache, consulClient *consulapi.Client, pluralName string) (factory.ResourceClientFactory, error)
ArtifactFactoryForSettings constructs a new ResourceClientFactory for Artifacts using Kubernetes, Directory, or Consul. settings.ArtifactSource or sharedCache must be non-nil
func ConfigFactoryForSettings ¶
func ConfigFactoryForSettings(params ConfigFactoryParams, resourceCrd crd.Crd) (factory.ResourceClientFactory, error)
ConfigFactoryForSettings constructs a new ResourceClientFactory for Config using Kubernetes, Directory, or Consul. params.memory.sharedCache, resourceCrd+params.kube.restCfg OR params.consul.consulClient must be non-nil
func ConsulClientForSettings ¶
ConsulClientForSettings constructs a Consul API client for the configuration provided in the settings parameter.
func KubeServiceClientForSettings ¶
func KubeServiceClientForSettings(ctx context.Context, settings *v1.Settings, sharedCache memory.InMemoryResourceCache, cfg **rest.Config, clientset *kubernetes.Interface, kubeCoreCache *cache.KubeCoreCache) (skkube.ServiceClient, error)
KubeServiceClientForSettings initializes a ServiceClient for the given settings. If we are using Config in Kubernetes, we use a Kubernetes ServiceClient, otherwise we use an in-memory client.
func NewMultiSecretResourceClientFactory ¶ added in v1.14.7
func NewMultiSecretResourceClientFactory(params MultiSecretFactoryParams) (factory.ResourceClientFactory, error)
NewMultiSecretResourceClientFactory returns a resource client factory for a client supporting multiple sources
func NewSecretResourceClientFactory ¶ added in v1.14.7
func NewSecretResourceClientFactory(ctx context.Context, params SecretFactoryParams) (factory.ResourceClientFactory, error)
func NewVaultSecretClientFactory ¶
func NewVaultSecretClientFactory(clientInit VaultClientInitFunc, pathPrefix, rootKey string) factory.ResourceClientFactory
NewVaultSecretClientFactory consumes a vault client along with a set of basic configurations for retrieving info with the client
func SecretFactoryForSettings ¶
func SecretFactoryForSettings(ctx context.Context, params SecretFactoryParams) (factory.ResourceClientFactory, error)
SecretFactoryForSettings creates a resource client factory for provided config. Implemented as secrets.MultiResourceClient iff secretOptions API is configured.
func VaultClientForSettings ¶
func VaultClientForSettings(ctx context.Context, vaultSettings *v1.Settings_VaultSecrets, vaultAuth vault.ClientAuth) (*api.Client, error)
VaultClientForSettings returns a vault client based on the provided settings.
Types ¶
type ConfigFactoryParams ¶
type ConfigFactoryParams struct {
// contains filtered or unexported fields
}
func NewConfigFactoryParams ¶
func NewConfigFactoryParams(settings *v1.Settings, sharedCache memory.InMemoryResourceCache, cache kube.SharedCache, cfg **rest.Config, consulClient *consulapi.Client) ConfigFactoryParams
NewConfigFactoryParams constructs a ConfigFactoryParams to pass into ConfigFactoryForSettings
type MultiSecretFactoryParams ¶ added in v1.14.7
type MultiSecretFactoryParams struct { SecretSources SourceList Cfg **rest.Config Clientset *kubernetes.Interface KubeCoreCache *cache.KubeCoreCache VaultClientInitMap map[int]VaultClientInitFunc }
type MultiSecretResourceClient ¶ added in v1.14.7
type MultiSecretResourceClient struct { // guard against concurrent slice access *sync.RWMutex // contains filtered or unexported fields }
MultiSecretResourceClient represents a client that is minimally implemented to facilitate Gloo operations. Specifically, only List and Watch are properly implemented.
Direct access to clientList is deliberately omitted to prevent changing clients with an open Watch leading to inconsistent and undefined behavior
func (*MultiSecretResourceClient) ApplyStatus ¶ added in v1.14.7
func (m *MultiSecretResourceClient) ApplyStatus(statusClient resources.StatusClient, inputResource resources.InputResource, opts clients.ApplyStatusOpts) (resources.Resource, error)
func (*MultiSecretResourceClient) Delete ¶ added in v1.14.7
func (m *MultiSecretResourceClient) Delete(namespace string, name string, opts clients.DeleteOpts) error
func (*MultiSecretResourceClient) Kind ¶ added in v1.14.7
func (m *MultiSecretResourceClient) Kind() string
func (*MultiSecretResourceClient) List ¶ added in v1.14.7
func (m *MultiSecretResourceClient) List(namespace string, opts clients.ListOpts) (resources.ResourceList, error)
func (*MultiSecretResourceClient) NewResource ¶ added in v1.14.7
func (m *MultiSecretResourceClient) NewResource() resources.Resource
func (*MultiSecretResourceClient) Register
deprecated
added in
v1.14.7
func (m *MultiSecretResourceClient) Register() error
Deprecated: implemented only by the kubernetes resource client. Will be removed from the interface.
func (*MultiSecretResourceClient) Watch ¶ added in v1.14.7
func (m *MultiSecretResourceClient) Watch(namespace string, opts clients.WatchOpts) (<-chan resources.ResourceList, <-chan error, error)
type MultiSecretResourceClientFactory ¶ added in v1.14.7
type MultiSecretResourceClientFactory struct {
// contains filtered or unexported fields
}
func (*MultiSecretResourceClientFactory) NewResourceClient ¶ added in v1.14.7
func (m *MultiSecretResourceClientFactory) NewResourceClient(ctx context.Context, params factory.NewResourceClientParams) (clients.ResourceClient, error)
NewResourceClient implements ResourceClientFactory by creating a new client with each sub-client initialized
type SecretFactoryParams ¶ added in v1.14.7
type SecretFactoryParams struct { Settings *v1.Settings Cfg **rest.Config Clientset *kubernetes.Interface KubeCoreCache *cache.KubeCoreCache VaultClientInitMap map[int]VaultClientInitFunc // map client init funcs to their index in the sources slice PluralName string }
type SourceList ¶ added in v1.14.7
type SourceList []*v1.Settings_SecretOptions_Source
func (SourceList) Len ¶ added in v1.14.7
func (s SourceList) Len() int
func (SourceList) Swap ¶ added in v1.14.7
func (s SourceList) Swap(i int, j int)
type VaultClientInitFunc ¶ added in v1.14.7
func NoopVaultClientInitFunc ¶ added in v1.14.7
func NoopVaultClientInitFunc(c *api.Client) VaultClientInitFunc
NoopVaultClientInitFunc returns the provided client without any modification