Documentation ¶
Index ¶
- Constants
- func ConvertToRuntimeObject(obj *unstructured.Unstructured) (*runtime.Object, error)
- type Client
- func (c *Client) CreateResource(resource string, namespace string, obj interface{}) (*unstructured.Unstructured, error)
- func (c *Client) DeleteResouce(resource string, namespace string, name string) error
- func (c *Client) GenerateResource(generator types.Generation, namespace string) error
- func (c *Client) GenerateTlsPemPair(props tls.TlsCertificateProps) (*tls.TlsPemPair, error)
- func (c *Client) GetCSRInterface() (csrtype.CertificateSigningRequestInterface, error)
- func (c *Client) GetEventsInterface() (event.EventInterface, error)
- func (c *Client) GetKubePolicyDeployment() (*apps.Deployment, error)
- func (c *Client) GetResource(resource string, namespace string, name string) (*unstructured.Unstructured, error)
- func (c *Client) GetTLSCertProps(configuration *rest.Config) (certProps tls.TlsCertificateProps, err error)
- func (c *Client) ListResource(resource string, namespace string) (*unstructured.UnstructuredList, error)
- func (c *Client) ReadRootCASecret() (result []byte)
- func (c *Client) ReadTlsPair(props tls.TlsCertificateProps) *tls.TlsPemPair
- func (c *Client) UpdateResource(resource string, namespace string, obj interface{}) (*unstructured.Unstructured, error)
- func (c *Client) UpdateStatusResource(resource string, namespace string, obj interface{}) (*unstructured.Unstructured, error)
- func (c *Client) WriteTlsPair(props tls.TlsCertificateProps, pemPair *tls.TlsPemPair) error
Constants ¶
const ( //CSRs certificatesigningrequests CSRs string = "certificatesigningrequests" // Secrets secrets Secrets string = "secrets" // ConfigMaps configmaps ConfigMaps string = "configmaps" // Namespaces namespaces Namespaces string = "namespaces" )
Variables ¶
This section is empty.
Functions ¶
func ConvertToRuntimeObject ¶
func ConvertToRuntimeObject(obj *unstructured.Unstructured) (*runtime.Object, error)
ConvertToRuntimeObject converts unstructed to runtime.Object runtime instance
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client enables interaction with k8 resource
func (*Client) CreateResource ¶
func (c *Client) CreateResource(resource string, namespace string, obj interface{}) (*unstructured.Unstructured, error)
CreateResource creates object for the specified resource/namespace
func (*Client) DeleteResouce ¶
DeleteResouce deletes the specified resource
func (*Client) GenerateResource ¶
func (c *Client) GenerateResource(generator types.Generation, namespace string) error
GenerateResource creates resource of the specified kind(supports 'clone' & 'data')
func (*Client) GenerateTlsPemPair ¶
func (c *Client) GenerateTlsPemPair(props tls.TlsCertificateProps) (*tls.TlsPemPair, error)
GenerateTlsPemPair Issues TLS certificate for webhook server using given PEM private key Returns signed and approved TLS certificate in PEM format
func (*Client) GetCSRInterface ¶
func (c *Client) GetCSRInterface() (csrtype.CertificateSigningRequestInterface, error)
GetCSRInterface provides type interface for CSR
func (*Client) GetEventsInterface ¶
func (c *Client) GetEventsInterface() (event.EventInterface, error)
GetEventsInterface provides typed interface for events TODO: can we use dynamic client to fetch the typed interface or generate a kube client value to access the interface
func (*Client) GetKubePolicyDeployment ¶
func (c *Client) GetKubePolicyDeployment() (*apps.Deployment, error)
GetKubePolicyDeployment returns kube policy depoyment value
func (*Client) GetResource ¶
func (c *Client) GetResource(resource string, namespace string, name string) (*unstructured.Unstructured, error)
GetResource returns the resource in unstructured/json format
func (*Client) GetTLSCertProps ¶
func (c *Client) GetTLSCertProps(configuration *rest.Config) (certProps tls.TlsCertificateProps, err error)
GetTLSCertProps provides the TLS Certificate Properties
func (*Client) ListResource ¶
func (c *Client) ListResource(resource string, namespace string) (*unstructured.UnstructuredList, error)
ListResource returns the list of resources in unstructured/json format Access items using []Items
func (*Client) ReadRootCASecret ¶
ReadRootCASecret returns the RootCA from the pre-defined secret
func (*Client) ReadTlsPair ¶
func (c *Client) ReadTlsPair(props tls.TlsCertificateProps) *tls.TlsPemPair
ReadTlsPair Reads the pair of TLS certificate and key from the specified secret.
func (*Client) UpdateResource ¶
func (c *Client) UpdateResource(resource string, namespace string, obj interface{}) (*unstructured.Unstructured, error)
UpdateResource updates object for the specified resource/namespace
func (*Client) UpdateStatusResource ¶
func (c *Client) UpdateStatusResource(resource string, namespace string, obj interface{}) (*unstructured.Unstructured, error)
UpdateStatusResource updates the resource "status" subresource
func (*Client) WriteTlsPair ¶
func (c *Client) WriteTlsPair(props tls.TlsCertificateProps, pemPair *tls.TlsPemPair) error
WriteTlsPair Writes the pair of TLS certificate and key to the specified secret. Updates existing secret or creates new one.