kuma

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Overview

Package kuma - Common operations for the adapter

Index

Constants

View Source
const (
	// SMIManifest is the manifest.yaml file for smi conformance tool
	SMIManifest = "https://raw.githubusercontent.com/layer5io/learn-layer5/master/smi-conformance/manifest.yml"
)

Variables

View Source
var (

	// ErrOpInvalidCode represents the errors which are generated
	// when an invalid operation is invoked
	ErrOpInvalidCode = "1002"

	// ErrInstallKumaCode represents the errors which are generated
	// during kuma service mesh install process
	ErrInstallKumaCode = "1003"

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

	// ErrFetchManifestCode represents the errors which are generated
	// during the process of fetching manifest
	ErrFetchManifestCode = "1005"

	// ErrClientConfigCode represents the errors which are generated
	// during the process of setting client config
	ErrClientConfigCode = "1006"

	// ErrClientSetCode represents the errors which are generated
	// during the process of setting clientset
	ErrClientSetCode = "1007"

	// ErrStreamEventCode represents the errors which are generated
	// during the process of streaming events
	ErrStreamEventCode = "1008"

	// ErrSampleAppCode represents the errors which are generated
	// during the process of installing sample app
	ErrSampleAppCode = "1009"

	// ErrGetKumactlCode represents the errors which are generated
	// during the process of using kumactl for installation
	ErrGetKumactlCode = "1010"

	// ErrDownloadBinaryCode represents the errors which are generated
	// during the process of downloading binary
	ErrDownloadBinaryCode = "1011"

	// ErrInstallBinaryCode represents the errors which are generated
	// during the process of installing binary
	ErrInstallBinaryCode = "1012"

	// ErrUntarCode represents the errors which are generated
	// during the process of untaring a compressed file
	ErrUntarCode = "1013"

	// ErrUntarDefaultCode represents the errors which are generated
	// during the process of untaring a compressed file
	ErrUntarDefaultCode = "1014"

	// ErrMoveBinaryCode represents the errors which are generated
	// during the process of moving binaries
	ErrMoveBinaryCode = "1015"

	// ErrCustomOperationCode represents the errors which are generated
	// during the process of handeling a custom process
	ErrCustomOperationCode = "1016"

	// ErrNilClientCode represents the error code which is
	// generated when Kubernetes client is nil
	ErrNilClientCode = "1017"

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

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

	// ErrKumaCoreComponentFailCode represents the error code which is
	// generated when an kuma core operations fails
	ErrKumaCoreComponentFailCode = "1022"

	// ErrProcessOAMCode represents the error code which is
	// generated when an OAM operations fails
	ErrProcessOAMCode = "1023"

	// ErrParseKumaCoreComponentCode represents the error code which is
	// generated when kuma core component manifest parsing fails
	ErrParseKumaCoreComponentCode = "1024"

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

	// ErrParseOAMConfigCode represents the error code which is
	// generated during the OAM configuration parsing
	ErrParseOAMConfigCode = "1026"

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

	// ErrOpInvalid represents the errors which are generated
	// when an operation is invalid
	ErrOpInvalid = errors.New(ErrOpInvalidCode, errors.Alert, []string{"Invalid operation"}, []string{"Kuma 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"})

	// ErrUntarDefault represents the errors which are generated
	// during the process of untaring a compressed file
	ErrUntarDefault = errors.New(ErrUntarDefaultCode, errors.Alert, []string{"Error untaring opeartion default"}, []string{"Error occurred in the process of untaring a compressed file"}, []string{"The compressed file might be corrupted"}, []string{"Clear the cache and retry the operation"})

	// 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"})

	// 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 adapter to Meshery Server"})

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

Functions

func ErrApplyHelmChart added in v0.5.8

func ErrApplyHelmChart(err error) error

ErrApplyHelmChart is the error for applying helm chart

func ErrClientConfig added in v0.2.0

func ErrClientConfig(err error) error

ErrClientConfig is the error for setting client config

func ErrClientSet added in v0.2.0

func ErrClientSet(err error) error

ErrClientSet is the error for setting clientset

func ErrCustomOperation added in v0.4.0

func ErrCustomOperation(err error) error

ErrCustomOperation is the error occurred during the process of applying custom operation

func ErrDownloadBinary added in v0.3.8

func ErrDownloadBinary(err error) error

ErrDownloadBinary is the error for downloading binary

func ErrFetchManifest added in v0.3.8

func ErrFetchManifest(err error, des string) error

ErrFetchManifest is the error occurred during the process fetching manifest

func ErrGetKumactl added in v0.3.8

func ErrGetKumactl(err error) error

ErrGetKumactl is the error for getting `kumactl`

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.3.8

func ErrInstallBinary(err error) error

ErrInstallBinary is the error for installing binary

func ErrInstallKuma added in v0.3.8

func ErrInstallKuma(err error) error

ErrInstallKuma is the error for install mesh

func ErrInvalidOAMComponentType added in v0.5.8

func ErrInvalidOAMComponentType(compName string) error

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

func ErrKumaCoreComponentFail added in v0.5.8

func ErrKumaCoreComponentFail(err error) error

ErrKumaCoreComponentFail is the error when core kuma component processing fails

func ErrLoadNamespace added in v0.5.12

func ErrLoadNamespace(err error, s string) error

ErrLoadNamespace is the occurend while applying namespace

func ErrMeshConfig

func ErrMeshConfig(err error) error

ErrMeshConfig is the error for mesh config

func ErrMoveBinary added in v0.3.8

func ErrMoveBinary(err error) error

ErrMoveBinary is the error for moving binary

func ErrParseKumaCoreComponent added in v0.5.8

func ErrParseKumaCoreComponent(err error) error

ErrParseKumaCoreComponent is the error when kuma core component manifest parsing fails

func ErrProcessOAM added in v0.5.8

func ErrProcessOAM(err error) error

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

func ErrSampleApp added in v0.3.8

func ErrSampleApp(err error, status string) error

ErrSampleApp is the error for applying/deleting Sample App

func ErrStreamEvent added in v0.2.0

func ErrStreamEvent(err error) error

ErrStreamEvent is the error for streaming event

func ErrUntar added in v0.3.8

func ErrUntar(err error) error

ErrUntar is the error for streaming event

func New

func New(config config.Handler, log logger.Handler, kubeConfig config.Handler, e *events.EventStreamer) adapter.Handler

New initializes kuma handler.

Types

type CompHandler added in v0.5.8

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

CompHandler is the type for functions which can handle OAM components

type Kuma added in v0.3.8

type Kuma struct {
	adapter.Adapter // Type Embedded
}

Kuma represents the kuma adapter and embeds adapter.Adapter

func (*Kuma) ApplyOperation added in v0.3.8

func (kuma *Kuma) ApplyOperation(ctx context.Context, opReq adapter.OperationRequest) error

ApplyOperation applies the operation on kuma

func (*Kuma) CreateKubeconfigs added in v0.5.22

func (kuma *Kuma) CreateKubeconfigs(kubeconfigs []string) error

CreateKubeconfigs creates and writes passed kubeconfig onto the filesystem

func (*Kuma) HandleApplicationConfiguration added in v0.5.8

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

HandleApplicationConfiguration handles the processing of OAM application configuration

func (*Kuma) HandleComponents added in v0.5.8

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

HandleComponents handles the processing of OAM components

func (*Kuma) ProcessOAM added in v0.5.8

func (kuma *Kuma) 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