appmesh

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2023 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package appmesh stores common operations

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrCustomOperationCode should really have an error code defined by now.
	ErrCustomOperationCode = "appmesh_test_code"
	// ErrInstallAppMeshCode provisioning failure
	ErrInstallAppMeshCode = "appmesh_test_code"
	// ErrMeshConfigCode   service mesh configuration failure
	ErrMeshConfigCode = "appmesh_test_code"
	// ErrClientConfigCode adapter configuration failure
	ErrClientConfigCode = "appmesh_test_code"
	// ErrStreamEventCode  failure
	ErrStreamEventCode = "appmesh_test_code"
	// ErrSampleAppCode    failure
	ErrSampleAppCode = "appmesh_test_code"
	// ErrLoadNamespaceToMeshCode represents the error
	// which is generated when the namespace could not be labelled and updated
	ErrLoadNamespaceToMeshCode = "appmesh_test_code"
	// ErrOpInvalidCode failure
	ErrOpInvalidCode = "appmesh_test_code"
	// ErrNilClientCode represents the error code which is
	// generated when kubernetes client is nil
	ErrNilClientCode = "replace"
	// ErrApplyHelmChartCode represents the error generated
	// during the process of applying helm chart
	ErrApplyHelmChartCode = "replace"

	// ErrParseAppMeshCoreComponentCode represents the error code
	// when app-mesh core components can't be parsed
	ErrParseAppMeshCoreComponentCode = "replace"

	// ErrAppMeshCoreComponentFailCode represents error code when
	// there is an error parsing components
	ErrAppMeshCoreComponentFailCode = "replace"

	// ErrInvalidOAMComponentTypeCode represents error code when
	// invalid OAM components are registerd
	ErrInvalidOAMComponentTypeCode = "replace"

	// ErrProcessOAMCode represents error code while parsing OAM
	// components
	ErrProcessOAMCode = "replace"

	// ErrAddonFromTemplateCode represents the errors which are generated
	// during addon deployment process
	ErrAddonFromTemplateCode = "replace"

	//ErrAddonFromHelmCode represents the error while installing addons through helm charts
	ErrAddonFromHelmCode = "replace"

	// ErrParseOAMComponentCode represents the error which is
	// generated during the OAM component parsing
	ErrParseOAMComponentCode = "replace"

	// ErrParseOAMConfigCode represents the error which is
	// generated during the OAM configuration parsing
	ErrParseOAMConfigCode = "replace"
	// ErrOpInvalid is an error when an invalid operation is requested
	ErrOpInvalid = errors.New(ErrOpInvalidCode, errors.Alert, []string{"Invalid operation"}, []string{}, []string{}, []string{})

	// ErrNilClient represents the error generated when kubernetes client is nil
	ErrNilClient = errors.New(ErrNilClientCode, errors.Alert, []string{"kubernetes client not initialized"}, []string{"Kubernetes client is nil"}, []string{"kubernetes client not initialized"}, []string{"Reconnect the adaptor to Meshery server"})

	// ErrParseOAMComponent represents the error which is
	// generated during the OAM component parsing
	ErrParseOAMComponent = errors.New(ErrParseOAMComponentCode, errors.Alert, []string{"error parsing the component"}, []string{"Error occured while prasing application component in the OAM request made"}, []string{"Invalid OAM component passed in OAM request"}, []string{"Check if your request has vaild OAM components"})

	// ErrParseOAMConfig represents the error which is
	// generated during the OAM configuration parsing
	ErrParseOAMConfig = errors.New(ErrParseOAMConfigCode, errors.Alert, []string{"error parsing the configuration"}, []string{"Error occured while prasing component config in the OAM request made"}, []string{"Invalid OAM config passed in OAM request"}, []string{"Check if your request has vaild OAM config"})
)

Functions

func ErrAddonFromHelm added in v0.2.4

func ErrAddonFromHelm(err error) error

ErrAddonFromHelm is the error for installing addons through helm chart

func ErrAddonFromTemplate

func ErrAddonFromTemplate(err error) error

ErrAddonFromTemplate is the error for streaming event

func ErrAppMeshCoreComponentFail

func ErrAppMeshCoreComponentFail(err error) error

ErrAppMeshCoreComponentFail is the error when core appmesh component processing fails

func ErrApplyHelmChart

func ErrApplyHelmChart(err error) error

ErrApplyHelmChart is the occurend while applying helm chart

func ErrClientConfig

func ErrClientConfig(err error) error

ErrClientConfig is the error for setting client config

func ErrCustomOperation

func ErrCustomOperation(err error) error

ErrCustomOperation is the error for custom operations

func ErrInstallAppMesh

func ErrInstallAppMesh(err error) error

ErrInstallAppMesh is the error for install mesh

func ErrInvalidOAMComponentType

func ErrInvalidOAMComponentType(compName string) error

ErrInvalidOAMComponentType is the error when the OAM component name is not valid

func ErrLoadNamespaceToMesh added in v0.2.2

func ErrLoadNamespaceToMesh(err error) error

ErrLoadNamespaceToMesh identifies the inability to label the appropropriate namespace

func ErrMeshConfig

func ErrMeshConfig(err error) error

ErrMeshConfig is the error for mesh config

func ErrParseAppMeshCoreComponent

func ErrParseAppMeshCoreComponent(err error) error

ErrParseAppMeshCoreComponent is the error when app-mesh core component manifest parsing fails

func ErrProcessOAM

func ErrProcessOAM(err error) error

ErrProcessOAM is a generic error which is thrown when an OAM operations fails

func ErrSampleApp

func ErrSampleApp(err error, status string) error

ErrSampleApp is the error for operations on the sample apps

func ErrStreamEvent

func ErrStreamEvent(err error) error

ErrStreamEvent is the error for streaming event

func New

New initializes AppMesh handler.

Types

type AppMesh

type AppMesh struct {
	adapter.Adapter
}

AppMesh is the app-mesh adapter. It embeds adapter.Adapter

func (*AppMesh) ApplyOperation

func (appMesh *AppMesh) ApplyOperation(ctx context.Context, opReq adapter.OperationRequest) error

ApplyOperation applies the requested operation on app-mesh

func (*AppMesh) CreateKubeconfigs added in v0.5.2

func (appMesh *AppMesh) CreateKubeconfigs(kubeconfigs []string) error

CreateKubeconfigs creates and writes passed kubeconfig onto the filesystem

func (*AppMesh) HandleApplicationConfiguration

func (appMesh *AppMesh) HandleApplicationConfiguration(config v1alpha1.Configuration, isDel bool, kubeconfigs []string) (string, error)

HandleApplicationConfiguration handles the processing of OAM application configuration

func (*AppMesh) HandleComponents

func (appMesh *AppMesh) HandleComponents(comps []v1alpha1.Component, isDel bool, kubeconfigs []string) (string, error)

HandleComponents handles the processing of OAM components

func (*AppMesh) LoadNamespaceToMesh

func (appMesh *AppMesh) LoadNamespaceToMesh(namespace string, remove bool, kubeconfigs []string) error

LoadNamespaceToMesh enables sidecar injection on by labelling requested namespace

func (*AppMesh) ProcessOAM added in v0.2.5

func (appMesh *AppMesh) ProcessOAM(ctx context.Context, oamReq adapter.OAMRequest) (string, error)

ProcessOAM handles the grpc invocation for handling OAM objects

type CompHandler

type CompHandler func(*AppMesh, v1alpha1.Component, bool, []string) (string, error)

CompHandler type functions handle OAM components

Directories

Path Synopsis
Package oam contains the definitions for OAM objects as well as the parsers and register functions associated with it
Package oam contains the definitions for OAM objects as well as the parsers and register functions associated with it

Jump to

Keyboard shortcuts

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