Documentation ¶
Index ¶
- Constants
- Variables
- func ConfigWithPrincipal(user *auth.UserPrincipal, config *rest.Config, userPrefixes UserPrefixes) *rest.Config
- func CreateScheme() (*apiruntime.Scheme, error)
- func InClusterConfigClusterName() string
- func RestConfig() (*rest.Config, string, error)
- type ClientGetter
- type ClusterConfig
- type ConfigGetter
- type DefaultClientGetter
- type ImpersonatingConfigGetter
- type KubeHTTP
- type Resource
- type UserPrefixes
- type WegoConfig
Constants ¶
const FluxNamespace = "flux-system"
const WeGOCRDName = "apps.wego.weave.works"
const (
WegoConfigMapName = "weave-gitops-config"
)
Variables ¶
var ErrNamespaceNotFound = errors.New("namespace not found")
var ( // ErrWegoConfigNotFound indicates weave gitops config could not be found ErrWegoConfigNotFound = errors.New("Wego Config not found") )
var InClusterConfig func() (*rest.Config, error) = rest.InClusterConfig
InClusterConfig defines a function for checking if this code is executing in kubernetes. This can be overriden if needed.
Functions ¶
func ConfigWithPrincipal ¶ added in v0.15.0
func ConfigWithPrincipal(user *auth.UserPrincipal, config *rest.Config, userPrefixes UserPrefixes) *rest.Config
ConfigWithPrincipal returns a new config with the principal set as the impersonated user or bearer token.
func CreateScheme ¶ added in v0.2.0
func CreateScheme() (*apiruntime.Scheme, error)
func InClusterConfigClusterName ¶ added in v0.7.0
func InClusterConfigClusterName() string
Types ¶
type ClientGetter ¶ added in v0.7.0
ClientGetter implementations should create a Kubernetes client from a context.
func NewDefaultClientGetter ¶ added in v0.7.0
func NewDefaultClientGetter(configGetter ConfigGetter, clusterName string, schemeBuilder ...func(*runtime.Scheme) error) ClientGetter
NewDefaultClientGetter creates a new DefaultClientGetter
type ClusterConfig ¶ added in v0.7.0
ClusterConfig is used to hold the default *rest.Config and the cluster name.
type ConfigGetter ¶ added in v0.7.0
ConfigGetter implementations should extract the details from a context and create a *rest.Config for use in clients.
type DefaultClientGetter ¶ added in v0.7.0
type DefaultClientGetter struct {
// contains filtered or unexported fields
}
DefaultClientGetter implements the ClientGetter interface and uses a ConfigGetter to get a *rest.Config and create a Kubernetes client.
type ImpersonatingConfigGetter ¶ added in v0.7.0
type ImpersonatingConfigGetter struct {
// contains filtered or unexported fields
}
ImpersonatingConfigGetter is an implementation of the ConfigGetter interface that returns configs based on a base one. It inspects the context for a principal and if it finds one, it configures the *rest.Config to impersonate that principal. Otherwise it returns a copy of the base config.
func NewImpersonatingConfigGetter ¶ added in v0.7.0
func NewImpersonatingConfigGetter(cfg *rest.Config, insecure bool, userPrefixes UserPrefixes) *ImpersonatingConfigGetter
NewImpersonatingConfigGetter creates and returns a ConfigGetter with a known config.
type KubeHTTP ¶ added in v0.2.0
This is a wrapper around the client.Client to provide extra information specifically designed to query the K8s API directly instead of relying on `kubectl` to be present in the PATH.
func NewKubeHTTPClient ¶ added in v0.2.0
func NewKubeHTTPClientWithConfig ¶ added in v0.4.1
type UserPrefixes ¶ added in v0.22.0
UserPrefixes contains the prefixes for the user and groups that will be used when impersonating a user.