client

package
v1.108.9 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 55 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// These lists are inspired by Helm: https://github.com/helm/helm/blob/v3.11.3/pkg/releaseutil/kind_sorter.go
	// Unknown kinds are created last.
	KindCreationOrder = []string{
		"Namespace",
		"NetworkPolicy",
		"ResourceQuota",
		"LimitRange",
		"PodSecurityPolicy",
		"PodDisruptionBudget",
		"ServiceAccount",
		"Secret",
		"SecretList",
		"ConfigMap",
		"StorageClass",
		"PersistentVolume",
		"PersistentVolumeClaim",
		"CustomResourceDefinition",
		"ClusterRole",
		"ClusterRoleList",
		"ClusterRoleBinding",
		"ClusterRoleBindingList",
		"Role",
		"RoleList",
		"RoleBinding",
		"RoleBindingList",
		"Service",
		"DaemonSet",
		"Pod",
		"ReplicationController",
		"ReplicaSet",
		"Deployment",
		"HorizontalPodAutoscaler",
		"StatefulSet",
		"Job",
		"CronJob",
		"IngressClass",
		"Ingress",
		"APIService",
	}
	// Unknown kinds are deleted first.
	KindDeletionOrder = []string{
		"APIService",
		"Ingress",
		"IngressClass",
		"Service",
		"CronJob",
		"Job",
		"StatefulSet",
		"HorizontalPodAutoscaler",
		"Deployment",
		"ReplicaSet",
		"ReplicationController",
		"Pod",
		"DaemonSet",
		"RoleBindingList",
		"RoleBinding",
		"RoleList",
		"Role",
		"ClusterRoleBindingList",
		"ClusterRoleBinding",
		"ClusterRoleList",
		"ClusterRole",
		"CustomResourceDefinition",
		"PersistentVolumeClaim",
		"PersistentVolume",
		"StorageClass",
		"ConfigMap",
		"SecretList",
		"Secret",
		"ServiceAccount",
		"PodDisruptionBudget",
		"PodSecurityPolicy",
		"LimitRange",
		"ResourceQuota",
		"NetworkPolicy",
		"Namespace",
	}
)

Functions

func IsCRD

func IsCRD(content []byte) bool

func IsNamespace

func IsNamespace(content []byte) bool

Types

type Client

type Client struct {
	TargetNamespace string

	HookStopChans []chan struct{}

	ExistingHookInformers map[string]bool // namespaces map to invoke the Informer once during deploy
	// contains filtered or unexported fields
}

func (*Client) ApplyAppInformers

func (c *Client) ApplyAppInformers(args operatortypes.AppInformersArgs)

func (*Client) ApplyHooksInformer added in v1.103.1

func (c *Client) ApplyHooksInformer(namespaces []string)

func (*Client) ApplyNamespacesInformer added in v1.103.1

func (c *Client) ApplyNamespacesInformer(namespaces []string, imagePullSecrets []string)

func (*Client) DeployApp

func (c *Client) DeployApp(deployArgs operatortypes.DeployAppArgs) (deployed bool, finalError error)

func (*Client) Init

func (c *Client) Init() error

func (*Client) Shutdown

func (c *Client) Shutdown()

func (*Client) UndeployApp added in v1.98.3

func (c *Client) UndeployApp(undeployArgs operatortypes.UndeployAppArgs) (finalError error)

type ClientInterface

type ClientInterface interface {
	Init() error
	Shutdown()
	DeployApp(deployArgs operatortypes.DeployAppArgs) (deployed bool, finalError error)
	UndeployApp(undeployArgs operatortypes.UndeployAppArgs) error
	ApplyAppInformers(args operatortypes.AppInformersArgs)
	ApplyNamespacesInformer(namespaces []string, imagePullSecrets []string)
	ApplyHooksInformer(namespaces []string)
}

type DeployResults

type DeployResults struct {
	IsError      bool   `json:"isError"`
	DryrunStdout []byte `json:"dryrunStdout"`
	DryrunStderr []byte `json:"dryrunStderr"`
	ApplyStdout  []byte `json:"applyStdout"`
	ApplyStderr  []byte `json:"applyStderr"`
	HelmStdout   []byte `json:"helmStdout"`
	HelmStderr   []byte `json:"helmStderr"`
}

type DesiredState

type DesiredState struct {
	Present []operatortypes.DeployAppArgs `json:"present"`
	Missing map[string][]string           `json:"missing"`
}

DesiredState is what we receive from the kotsadm api server

type DiffAndDeleteOptions added in v1.98.3

type DiffAndDeleteOptions struct {
	PreviousManifests    string
	CurrentManifests     string
	AdditionalNamespaces []string
	IsRestore            bool
	RestoreLabelSelector *metav1.LabelSelector
	Wait                 bool
}

type OverlySimpleGVKWithName

type OverlySimpleGVKWithName struct {
	APIVersion string               `yaml:"apiVersion"`
	Kind       string               `yaml:"kind"`
	Metadata   OverlySimpleMetadata `yaml:"metadata"`
}

func GetGVKWithNameAndNs

func GetGVKWithNameAndNs(content []byte, baseNS string) (string, OverlySimpleGVKWithName)

type OverlySimpleMetadata

type OverlySimpleMetadata struct {
	Name      string            `yaml:"name"`
	Namespace string            `yaml:"namespace"`
	Labels    map[string]string `yaml:"labels,omitempty"`
}

Directories

Path Synopsis
Package mock_client is a generated GoMock package.
Package mock_client is a generated GoMock package.

Jump to

Keyboard shortcuts

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