cilium

package
v0.0.0-...-4b6be33 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Overview

Package cilium - Error codes for the adapter

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrInstallCiliumCode represents the errors which are generated
	// during Cilium service mesh install process
	ErrInstallCiliumCode = "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"

	// ErrRunCiliumCmdCode represents the errors which are generated
	// during fetch manifest process
	ErrRunCiliumCmdCode = "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"

	// ErrCiliumCoreComponentFailCode represents the error code which is
	// generated when an Cilium core operations fails
	ErrCiliumCoreComponentFailCode = "1015"
	// ErrProcessOAMCode represents the error code which is
	// generated when an OAM operations fails
	ErrProcessOAMCode = "1016"
	// ErrParseCiliumCoreComponentCode represents the error code which is
	// generated when Cilium core component manifest parsing fails
	ErrParseCiliumCoreComponentCode = "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{"Cilium 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 Meshplay 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 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 occurred 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"})

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

	// ErrMakingBinExecutableCode implies error while makng cilium cli executable
	ErrMakingBinExecutableCode = "1025"

	//ErrLoadNamespaceCode occur during the process of applying namespace
	ErrLoadNamespaceCode = "1026"

	// ErrUnpackingTarCode implies error while unpacking cilium release
	// bundle tar
	ErrUnpackingTarCode = "1027"

	// ErrUnzipFileCode represents the errors which are generated
	// during unzip process
	ErrUnzipFileCode = "1028"

	// ErrDownloadingTarCode implies error while downloading cilium tar
	ErrDownloadingTarCode = "1029"

	// ErrGettingReleaseCode implies error while fetching latest release for cilium cli
	ErrGettingReleaseCode = "1030"

	ErrFetchCiliumVersionsCode = "1031"

	ErrFetchCiliumVersions = errors.New(ErrFetchCiliumVersionsCode, errors.Alert, []string{"could not get any cilium versions"}, []string{"versions for cilium could not be fetched"}, []string{"could not reach github.com/cilium/cilium/releases", "no versions could be fetched from cilium release page"}, []string{"make sure adapter is reachable"})
)

Functions

func ErrApplyHelmChart

func ErrApplyHelmChart(err error) error

ErrApplyHelmChart is the error for applying helm chart

func ErrCiliumCoreComponentFail

func ErrCiliumCoreComponentFail(err error) error

ErrCiliumCoreComponentFail is the error when core Cilium component processing fails

func ErrCreatingNS

func ErrCreatingNS(err error) error

ErrCreatingNS is the error while creating the namespace

func ErrCustomOperation

func ErrCustomOperation(err error) error

ErrCustomOperation is the error for streaming event

func ErrDownloadBinary

func ErrDownloadBinary(err error) error

ErrDownloadBinary is the error while downloading Cilium binary

func ErrDownloadingTar

func ErrDownloadingTar(err error) error

ErrDownloadingTar is the error when tar download fails

func ErrGetLatestRelease

func ErrGetLatestRelease(err error) error

ErrGetLatestRelease is the error for get latest versions

func ErrGettingRelease

func ErrGettingRelease(err error) error

ErrGettingRelease is the error when getting release tag fails

func ErrInstallBinary

func ErrInstallBinary(err error) error

ErrInstallBinary is the error while downloading Cilium binary

func ErrInstallCilium

func ErrInstallCilium(err error) error

ErrInstallCilium 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 ErrLoadNamespace

func ErrLoadNamespace(err error, s string) error

ErrLoadNamespace is the occurend while applying namespace

func ErrMakingBinExecutable

func ErrMakingBinExecutable(err error) error

ErrMakingBinExecutable occurs when cilium cli binary couldn't be made executable

func ErrMeshConfig

func ErrMeshConfig(err error) error

ErrMeshConfig is the error for mesh config

func ErrParseCiliumCoreComponent

func ErrParseCiliumCoreComponent(err error) error

ErrParseCiliumCoreComponent is the error when Cilium 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 ErrRunCiliumCmd

func ErrRunCiliumCmd(err error, des string) error

ErrRunCiliumCmd is the error for mesh port forward

func ErrRunExecutable

func ErrRunExecutable(err error) error

ErrRunExecutable is the error while running an executable

func ErrSampleApp

func ErrSampleApp(err error) error

ErrSampleApp is the error for streaming event

func ErrTarXZF

func ErrTarXZF(err error) error

ErrTarXZF is the error for unzipping the file

func ErrUnpackingTar

func ErrUnpackingTar(err error) error

ErrUnpackingTar is the error when tar unpack fails

func ErrUnzipFile

func ErrUnzipFile(err error) error

ErrUnzipFile is the error for unzipping the file

func New

New initializes a new handler instance

Types

type Cilium

type Cilium struct {
	adapter.Adapter
}

Cilium represents the Cilium adapter and embeds adapter.Adapter

func (*Cilium) ApplyOperation

func (h *Cilium) ApplyOperation(ctx context.Context, opReq adapter.OperationRequest) error

ApplyOperation function contains the operation handlers

func (*Cilium) CreateKubeconfigs

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

CreateKubeconfigs creates and writes passed kubeconfig onto the filesystem

func (*Cilium) HandleApplicationConfiguration

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

HandleApplicationConfiguration handles the processing of OAM application configuration

func (*Cilium) HandleComponents

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

HandleComponents handles the processing of OAM components

func (*Cilium) ProcessOAM

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

ProcessOAM will handles the grpc invocation for handling OAM objects

type CompHandler

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

CompHandler is the type for functions which can 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