Documentation ¶
Index ¶
- Constants
- Variables
- type KubeSecretReader
- type Kubernetes
- func (k *Kubernetes) CA() ([]byte, error)
- func (k *Kubernetes) Endpoint() (string, error)
- func (k *Kubernetes) GetSecret(secret string) (string, error)
- func (k *Kubernetes) Name() (string, error)
- func (k *Kubernetes) Namespace() (string, error)
- func (k *Kubernetes) SaToken() (string, error)
- func (k *Kubernetes) UpdateRoles(rbs []RoleBinding) error
- type RoleBinding
- type SecretReader
Constants ¶
View Source
const ( NamespaceFilePath = "/var/run/secrets/kubernetes.io/serviceaccount/namespace" CaFilePath = "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt" SaFilePath = "/var/run/secrets/infra-engine-anonymous/token" )
Variables ¶
Functions ¶
This section is empty.
Types ¶
type KubeSecretReader ¶
type KubeSecretReader struct {
Namespace string
}
func (*KubeSecretReader) Get ¶
func (ksr *KubeSecretReader) Get(secretName string, client *kubernetes.Clientset) (string, error)
Get returns a K8s secret object with the specified name from a Kubernetes configuration if it exists
type Kubernetes ¶
type Kubernetes struct { Config *rest.Config SecretReader SecretReader // contains filtered or unexported fields }
func NewKubernetes ¶
func NewKubernetes() (*Kubernetes, error)
func (*Kubernetes) CA ¶
func (k *Kubernetes) CA() ([]byte, error)
func (*Kubernetes) Endpoint ¶
func (k *Kubernetes) Endpoint() (string, error)
func (*Kubernetes) GetSecret ¶
func (k *Kubernetes) GetSecret(secret string) (string, error)
GetSecret returns a K8s secret object with the specified name from the current namespace if it exists
func (*Kubernetes) Name ¶
func (k *Kubernetes) Name() (string, error)
func (*Kubernetes) Namespace ¶
func (k *Kubernetes) Namespace() (string, error)
func (*Kubernetes) SaToken ¶
func (k *Kubernetes) SaToken() (string, error)
func (*Kubernetes) UpdateRoles ¶
func (k *Kubernetes) UpdateRoles(rbs []RoleBinding) error
type RoleBinding ¶
type SecretReader ¶
type SecretReader interface {
Get(secretName string, client *kubernetes.Clientset) (string, error)
}
func NewSecretReader ¶
func NewSecretReader(namespace string) SecretReader
Click to show internal directories.
Click to hide internal directories.