osm

package
v0.6.6 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package osm - Error codes for the adapter

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrInstallOSMCode represents the errors which are generated
	// during open service mesh install process
	ErrInstallOSMCode = "1000"

	// ErrTarXZFCode represents the errors which are generated
	// during decompressing and extracting tar.gz file
	ErrTarXZFCode = "1001"

	// ErrMeshConfigCode represents the errors which are generated
	// when an invalid mesh config is found
	ErrMeshConfigCode = "1002"

	// ErrRunOsmCtlCmdCode represents the errors which are generated
	// during fetch manifest process
	ErrRunOsmCtlCmdCode = "1003"

	// ErrDownloadBinaryCode represents the errors which are generated
	// during binary download process
	ErrDownloadBinaryCode = "1004"

	// ErrInstallBinaryCode represents the errors which are generated
	// during binary installation process
	ErrInstallBinaryCode = "1005"

	// ErrSampleAppCode represents the errors which are generated
	// duing sample app installation
	ErrSampleAppCode = "1006"

	// ErrCustomOperationCode represents the errors which are generated
	// when an invalid addon operation is requested
	ErrCustomOperationCode = "1007"

	// ErrCreatingNSCode represents the errors which are generated
	// during the process of creating a namespace
	ErrCreatingNSCode = "1008"

	// ErrRunExecutableCode represents the errors which are generated
	// during the running a executable
	ErrRunExecutableCode = "1009"

	// ErrSidecarInjectionCode represents the errors which are generated
	// during the process of enabling/disabling sidecar injection
	ErrSidecarInjectionCode = "1010"

	// ErrOpInvalidCode represents the error which is generated when
	// there is an invalid operation
	ErrOpInvalidCode = "1011"

	// ErrApplyHelmChartCode represents the error which are generated
	// during the process of applying helm chart
	ErrApplyHelmChartCode = "1012"

	// ErrNilClientCode represents the error code which is
	// generated when kubernetes client is nil
	ErrNilClientCode = "1013"

	// ErrInvalidOAMComponentTypeCode represents the error code which is
	// generated when an invalid oam component is requested
	ErrInvalidOAMComponentTypeCode = "1014"

	// ErrOSMCoreComponentFailCode represents the error code which is
	// generated when an osm core operations fails
	ErrOSMCoreComponentFailCode = "1015"
	// ErrProcessOAMCode represents the error code which is
	// generated when an OAM operations fails
	ErrProcessOAMCode = "1016"
	// ErrParseOSMCoreComponentCode represents the error code which is
	// generated when osm core component manifest parsing fails
	ErrParseOSMCoreComponentCode = "1017"
	// ErrParseOAMComponentCode represents the error code which is
	// generated during the OAM component parsing
	ErrParseOAMComponentCode = "1018"
	// ErrParseOAMConfigCode represents the error code which is
	// generated during the OAM configuration parsing
	ErrParseOAMConfigCode = "1019"

	// ErrOpInvalid represents the errors which are generated
	// when an invalid operation is requested
	ErrOpInvalid = errors.New(ErrOpInvalidCode, errors.Alert, []string{"Invalid operation"}, []string{"Istio adapter received an invalid operation from the meshey server"}, []string{"The operation is not supported by the adapter", "Invalid operation name"}, []string{"Check if the operation name is valid and supported by the adapter"})

	// ErrNilClient represents the error which is
	// 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 occurred while parsing application component in the OAM request made by Meshery server"}, []string{"Could not unmarshall configuration component received via ProcessOAM gRPC call into a valid Component struct"}, []string{"Check if Meshery Server is creating valid component for ProcessOAM gRPC call. This error should never happen and can be reported as a bug in Meshery Server. Also check if Meshery Server and adapters are referring to same component struct provided in MeshKit."})

	// 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 occurred while parsing configuration in the request made by Meshery Server"}, []string{"Could not unmarshall OAM config received via ProcessOAM gRPC call into a valid Config struct"}, []string{"Check if Meshery Server is creating valid config for ProcessOAM gRPC call. This error should never happen and can be reported as a bug in Meshery Server. Also, confirm that Meshery Server and Adapters are referring to same config struct provided in MeshKit"})

	// ErrGetLatestReleaseCode represents the error which is
	// generated when the latest stable version could not
	// be fetched during runtime component registeration
	ErrGetLatestReleaseCode = "1020"

	//ErrLoadNamespaceCode occur during the process of applying namespace
	ErrLoadNamespaceCode = "1021"
)

Functions

func ErrApplyHelmChart added in v0.5.6

func ErrApplyHelmChart(err error) error

ErrApplyHelmChart is the error for applying helm chart

func ErrCreatingNS added in v0.5.0

func ErrCreatingNS(err error) error

ErrCreatingNS is the error while creating the namespace

func ErrCustomOperation added in v0.5.0

func ErrCustomOperation(err error) error

ErrCustomOperation is the error for streaming event

func ErrDownloadBinary added in v0.5.0

func ErrDownloadBinary(err error) error

ErrDownloadBinary is the error while downloading osm binary

func ErrGetLatestRelease added in v0.5.9

func ErrGetLatestRelease(err error) error

ErrGetLatestRelease is the error for get latest versions

func ErrInstallBinary added in v0.5.0

func ErrInstallBinary(err error) error

ErrInstallBinary is the error while downloading osm binary

func ErrInstallOSM added in v0.5.0

func ErrInstallOSM(err error) error

ErrInstallOSM is the error for install mesh

func ErrInvalidOAMComponentType added in v0.5.7

func ErrInvalidOAMComponentType(compName string) error

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

func ErrLoadNamespace added in v0.5.12

func ErrLoadNamespace(err error, s string) error

ErrLoadNamespace is the error while applying namespace

func ErrMeshConfig added in v0.5.0

func ErrMeshConfig(err error) error

ErrMeshConfig is the error for mesh config

func ErrOSMCoreComponentFail added in v0.5.7

func ErrOSMCoreComponentFail(err error) error

ErrOSMCoreComponentFail is the error when core osm component processing fails

func ErrParseOSMCoreComponent added in v0.5.7

func ErrParseOSMCoreComponent(err error) error

ErrParseOSMCoreComponent is the error when osm core component manifest parsing fails

func ErrProcessOAM added in v0.5.7

func ErrProcessOAM(err error) error

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

func ErrRunExecutable added in v0.5.0

func ErrRunExecutable(err error) error

ErrRunExecutable is the error while running an executable

func ErrRunOsmCtlCmd added in v0.5.0

func ErrRunOsmCtlCmd(err error, des string) error

ErrRunOsmCtlCmd is the error for mesh port forward

func ErrSampleApp added in v0.5.0

func ErrSampleApp(err error) error

ErrSampleApp is the error for streaming event

func ErrSidecarInjection added in v0.5.0

func ErrSidecarInjection(err error) error

ErrSidecarInjection is the error while enabling/disabling sidecar injection on a particular namespace

func ErrTarXZF added in v0.5.0

func ErrTarXZF(err error) error

ErrTarXZF is the error for unzipping the file

func New added in v0.5.0

New initializes a new handler instance

Types

type CompHandler added in v0.5.7

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

CompHandler is the type for functions which can handle OAM components

type Handler added in v0.5.0

type Handler struct {
	adapter.Adapter
}

Handler instance for this adapter

func (*Handler) ApplyOperation added in v0.5.0

func (h *Handler) ApplyOperation(ctx context.Context, request adapter.OperationRequest) error

ApplyOperation function contains the operation handlers

func (*Handler) CreateKubeconfigs added in v0.5.22

func (h *Handler) CreateKubeconfigs(kubeconfigs []string) error

CreateKubeconfigs creates and writes passed kubeconfig onto the filesystem

func (*Handler) HandleApplicationConfiguration added in v0.5.7

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

HandleApplicationConfiguration handles the processing of OAM application configuration

func (*Handler) HandleComponents added in v0.5.7

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

HandleComponents handles the processing of OAM components

func (*Handler) ProcessOAM added in v0.5.7

func (h *Handler) ProcessOAM(ctx context.Context, oamReq adapter.OAMRequest) (string, error)

ProcessOAM will handles the grpc invocation for handling OAM objects

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