resource

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2022 License: MIT Imports: 31 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAllErrorsFromChain

func GetAllErrorsFromChain(err error) []error

func GetKeyProvider added in v0.5.0

func GetKeyProvider(registry registry.Registry) (*keys.KeyProvider, error)

GetKeyProvider returns the key provider from the global configuration.

func GetPublicKey added in v0.5.0

func GetPublicKey(registry registry.Registry, dogu string) (*keys.PublicKey, error)

GetPublicKey returns the public key from the dogu configuration.

func NewCommandExecutor

func NewCommandExecutor(client kubernetes.Interface, coreV1RestClient rest.Interface) *exposedCommandExecutor

NewCommandExecutor creates a new instance of NewCommandExecutor

func NewDoguSecretsWriter added in v0.5.0

func NewDoguSecretsWriter(client client.Client, registry registry.Registry) *doguSecretWriter

NewDoguSecretsWriter creates a new instance of doguSecretWriter to save key value pairs from secrets to the dogu config

func NewDoguStatusReporter

func NewDoguStatusReporter(client client.Client) *doguStatusReporter

NewDoguStatusReporter create a new instance of a dogu error reporter.

Types

type ErrorResourceState

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

ErrorResourceState is returned when a specific resource (pod/dogu) is not ready yet.

func (*ErrorResourceState) Error

func (e *ErrorResourceState) Error() string

Report returns the error in string representation

func (*ErrorResourceState) Report

func (e *ErrorResourceState) Report() string

Report constructs a simple human readable message

func (*ErrorResourceState) Requeue

func (e *ErrorResourceState) Requeue() bool

Requeue determines if the current dogu operation should be requeue when this error was responsible for its failure

type ReportableError

type ReportableError interface {
	// Report constructs a human readable message for the dogu resource status.
	Report() string
}

ReportableError is used to identify all errors that are designed to report something into the dogu resource status.

type ResourceGenerator

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

ResourceGenerator generate k8s resources for a given dogu. All resources will be referenced with the dogu resource as controller

func NewResourceGenerator

func NewResourceGenerator(scheme *runtime.Scheme, limitPatcher limitPatcher) *ResourceGenerator

NewResourceGenerator creates a new generator for k8s resources

func (*ResourceGenerator) GetDoguDeployment

func (r *ResourceGenerator) GetDoguDeployment(doguResource *k8sv1.Dogu, dogu *core.Dogu, customDeployment *appsv1.Deployment) (*appsv1.Deployment, error)

GetDoguDeployment creates a new instance of a deployment with a given dogu.json and dogu custom resource

func (*ResourceGenerator) GetDoguExposedServices

func (r *ResourceGenerator) GetDoguExposedServices(doguResource *k8sv1.Dogu, dogu *core.Dogu) ([]corev1.Service, error)

GetDoguExposedServices creates a new instance of a LoadBalancer service for each exposed port.

func (*ResourceGenerator) GetDoguPVC

func (r *ResourceGenerator) GetDoguPVC(doguResource *k8sv1.Dogu) (*corev1.PersistentVolumeClaim, error)

GetDoguPVC creates a persistent volume claim with a 5Gi storage for the given dogu

func (*ResourceGenerator) GetDoguSecret

func (r *ResourceGenerator) GetDoguSecret(doguResource *k8sv1.Dogu, stringData map[string]string) (*corev1.Secret, error)

GetDoguSecret generates a secret with a given data map for the dogu

func (*ResourceGenerator) GetDoguService

func (r *ResourceGenerator) GetDoguService(doguResource *k8sv1.Dogu, imageConfig *imagev1.ConfigFile) (*corev1.Service, error)

GetDoguService creates a new instance of a service with the given dogu custom resource and container image. The container image is used to extract the exposed ports

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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