client

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2019 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
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 NewFakeDiscoveryClient added in v0.4.0

func NewFakeDiscoveryClient(registeredResouces []schema.GroupVersionResource) *fakeDiscoveryClient

NewFakeDiscoveryClient returns a fakediscovery client

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client enables interaction with k8 resource

func NewClient

func NewClient(config *rest.Config) (*Client, error)

NewClient creates new instance of client

func NewMockClient added in v0.4.0

func NewMockClient(scheme *runtime.Scheme, objects ...runtime.Object) (*Client, error)

---testing utilities

func (*Client) CreateResource

func (c *Client) CreateResource(resource string, namespace string, obj interface{}, dryRun bool) (*unstructured.Unstructured, error)

CreateResource creates object for the specified resource/namespace

func (*Client) DeleteResouce

func (c *Client) DeleteResouce(resource string, namespace string, name string, dryRun bool) error

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

func (c *Client) ReadRootCASecret() (result []byte)

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) SetDiscovery added in v0.4.0

func (c *Client) SetDiscovery(discoveryClient IDiscovery)

func (*Client) UpdateResource

func (c *Client) UpdateResource(resource string, namespace string, obj interface{}, dryRun bool) (*unstructured.Unstructured, error)

UpdateResource updates object for the specified resource/namespace

func (*Client) UpdateStatusResource

func (c *Client) UpdateStatusResource(resource string, namespace string, obj interface{}, dryRun bool) (*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.

type IDiscovery added in v0.4.0

type IDiscovery interface {
	// contains filtered or unexported methods
}

type ServerPreferredResources added in v0.4.0

type ServerPreferredResources struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL