istio

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: Apache-2.0 Imports: 46 Imported by: 0

Documentation

Overview

Package istio - Common operations for the adapter

Package istio - Error codes for the adapter

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrInstallUsingIstioctlCode represents the errors which are generated
	// during istio service mesh install process
	ErrInstallUsingIstioctlCode = "1003"

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

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

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

	// ErrRunIstioCtlCmdCode represents the errors which are generated
	// during fetch manifest process
	ErrRunIstioCtlCmdCode = "1007"

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

	// ErrEnvoyFilterCode represents the errors which are generated
	// duing envoy filter patching
	ErrEnvoyFilterCode = "1009"

	// ErrApplyPolicyCode represents the errors which are generated
	// duing policy apply operation
	ErrApplyPolicyCode = "1010"

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

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

	//ErrInvalidInstallationProfileCode implies error while invalid profile option is passed in pattern file
	ErrInvalidInstallationProfileCode = "1013"

	// ErrCreatingIstioClientCode represents the errors which are generated
	// during creating istio client process
	ErrCreatingIstioClientCode = "1014"

	// ErrIstioVetSyncCode represents the errors which are generated
	// during istio-vet sync process
	ErrIstioVetSyncCode = "1015"

	// ErrIstioVetCode represents the errors which are generated
	// during istio-vet process
	ErrIstioVetCode = "1016"

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

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

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

	// ErrParseIstioCoreComponentCode represents the error code which is
	// generated when istio core component manifest parsing fails
	ErrParseIstioCoreComponentCode = "1020"

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

	// ErrOpInvalidCode represents the error code which is
	// generated when an invalid operation is requested
	ErrOpInvalidCode = "1022"

	// ErrIstioCoreComponentFailCode represents the error code which is
	// generated when an istio core operations fails
	ErrIstioCoreComponentFailCode = "1023"

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

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

	// ErrGettingIstioReleaseCode implies failure while failing istio release
	// bundle
	ErrGettingIstioReleaseCode = "1026"

	// ErrUnsupportedPlatformCode implies unavailbility of Istio on the
	// requested platform
	ErrUnsupportedPlatformCode = "1027"

	// ErrIstioctlNotFoundCode implies istioctl couldn't be found anywhere
	// on the fs
	ErrIstioctlNotFoundCode = "1028"

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

	// ErrUnpackingTarCode implies error while unpacking istio release
	// bundle tar
	ErrUnpackingTarCode = "1030"

	// ErrMakingBinExecutableCode implies error while makng istioctl executable
	ErrMakingBinExecutableCode = "1031"

	// ErrLoadNamespaceCode implies error while finding namespace
	ErrLoadNamespaceCode = "1032"
	// ErrLoadNamespaceCode implies error while finding namespace
	ErrFetchIstioVersionsCode = "1033"

	ErrFetchIstioVersions = errors.New(ErrFetchIstioVersionsCode, errors.Alert, []string{"could not get any istio versions"}, []string{"versions for istio could not be fetched"}, []string{"could not reach github.com/istio/istio/releases", "no versions could be fetched from istio release page"}, []string{"make sure adapter is reachable to github"})
	// 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"})

	// 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 adaptor to Meshery server"})

	// ErrUnsupportedPlatform represents runtime platform is
	// unsupported
	ErrUnsupportedPlatform = errors.New(ErrUnsupportedPlatformCode, errors.Alert, []string{"requested platform is not supported by Istio"}, []string{"Istio only supports Windows, Linux and Darwin"}, []string{}, []string{""})

	// ErrIstioctlNotFound implies istioctl was not found locally
	ErrIstioctlNotFound = errors.New(ErrIstioctlNotFoundCode, errors.Alert, []string{"Unable to find Istioctl"}, []string{}, []string{}, []string{})
)

Functions

func ErrAddonFromTemplate added in v0.4.11

func ErrAddonFromTemplate(err error) error

ErrAddonFromTemplate is the error for streaming event

func ErrApplyHelmChart added in v0.5.15

func ErrApplyHelmChart(err error) error

ErrApplyHelmChart is the error for applying helm chart

func ErrApplyPolicy added in v0.4.14

func ErrApplyPolicy(err error) error

ErrApplyPolicy is the error for streaming event

func ErrCreatingIstioClient added in v0.4.11

func ErrCreatingIstioClient(err error) error

ErrCreatingIstioClient is the error for streaming event

func ErrCustomOperation added in v0.4.10

func ErrCustomOperation(err error) error

ErrCustomOperation is the error for streaming event

func ErrDownloadingTar added in v0.5.15

func ErrDownloadingTar(err error) error

ErrDownloadingTar is the error when tar download fails

func ErrEnvoyFilter added in v0.4.14

func ErrEnvoyFilter(err error) error

ErrEnvoyFilter is the error for streaming event

func ErrGettingIstioRelease added in v0.5.15

func ErrGettingIstioRelease(err error) error

ErrGettingIstioRelease is the error when the yaml unmarshal fails

func ErrInstallUsingIstioctl added in v0.5.15

func ErrInstallUsingIstioctl(err error) error

ErrInstallUsingIstioctl is the error for install mesh

func ErrInvalidInstallationProfile added in v0.6.10

func ErrInvalidInstallationProfile(str string) error

ErrInvalidInstallationProfile implies error while invalid profile option is passed in pattern file

func ErrInvalidOAMComponentType added in v0.5.9

func ErrInvalidOAMComponentType(compName string) error

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

func ErrIstioCoreComponentFail added in v0.5.14

func ErrIstioCoreComponentFail(err error) error

ErrIstioCoreComponentFail is the error when core Istion component processing fails

func ErrIstioVet added in v0.4.12

func ErrIstioVet(err error) error

ErrIstioVet is the error for streaming event

func ErrIstioVetSync added in v0.4.11

func ErrIstioVetSync(err error) error

ErrIstioVetSync is the error for streaming event

func ErrLoadNamespace added in v0.5.20

func ErrLoadNamespace(err error, str string) error

ErrLoadNamespace implies error while finding namespace

func ErrMakingBinExecutable added in v0.5.15

func ErrMakingBinExecutable(err error) error

ErrMakingBinExecutable occurs when istioctl binary couldn't be made executable

func ErrMeshConfig added in v0.4.10

func ErrMeshConfig(err error) error

ErrMeshConfig is the error for mesh config

func ErrParseIstioCoreComponent added in v0.5.9

func ErrParseIstioCoreComponent(err error) error

ErrParseIstioCoreComponent is the error when istio core component manifest parsing fails

func ErrProcessOAM added in v0.5.14

func ErrProcessOAM(err error) error

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

func ErrRunIstioCtlCmd added in v0.4.17

func ErrRunIstioCtlCmd(err error, des string) error

ErrRunIstioCtlCmd is the error for mesh port forward

func ErrSampleApp added in v0.4.10

func ErrSampleApp(err error) error

ErrSampleApp is the error for streaming event

func ErrTarXZF added in v0.4.10

func ErrTarXZF(err error) error

ErrTarXZF is the error for unzipping the file

func ErrUnpackingTar added in v0.5.15

func ErrUnpackingTar(err error) error

ErrUnpackingTar is the error when tar unpack fails

func ErrUnzipFile added in v0.4.10

func ErrUnzipFile(err error) error

ErrUnzipFile is the error for unzipping the file

func New added in v0.4.10

New initializes istio handler.

Types

type CompHandler added in v0.5.9

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

CompHandler is the type for functions which can handle OAM components

type Istio added in v0.4.10

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

Istio represents the istio adapter and embeds adapter.Adapter

func (*Istio) ApplyOperation added in v0.4.10

func (istio *Istio) ApplyOperation(ctx context.Context, opReq adapter.OperationRequest) error

ApplyOperation applies the operation on istio

func (*Istio) CreateKubeconfigs added in v0.6.10

func (istio *Istio) CreateKubeconfigs(kubeconfigs []string) error

CreateKubeconfigs creates and writes passed kubeconfig onto the filesystem

func (*Istio) HandleApplicationConfiguration added in v0.4.19

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

HandleApplicationConfiguration handles the processing of OAM application configuration

func (*Istio) HandleComponents added in v0.4.19

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

HandleComponents handles the processing of OAM components

func (*Istio) LoadNamespaceToMesh added in v0.4.10

func (istio *Istio) LoadNamespaceToMesh(namespace string, remove bool, kubeconfigs []string) error

LoadNamespaceToMesh is used to mark namespaces for automatic sidecar injection (or not)

func (*Istio) LoadToMesh added in v0.4.10

func (istio *Istio) LoadToMesh(namespace string, service string, remove bool, kubeconfigs []string) error

LoadToMesh is used to mark deployment for automatic sidecar injection (or not)

func (*Istio) ProcessOAM added in v0.4.19

func (istio *Istio) ProcessOAM(ctx context.Context, oamReq adapter.OAMRequest) (string, error)

ProcessOAM will handles the grpc invocation for handling OAM objects

func (*Istio) RunVet added in v0.4.11

func (istio *Istio) RunVet(ch chan<- *meshes.EventsResponse, kubeconfigs []string)

RunVet runs istio-vet

func (*Istio) StreamWarn added in v0.4.11

func (istio *Istio) StreamWarn(e *meshes.EventsResponse, err error)

StreamWarn streams a warning message to the channel

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