Documentation ¶
Overview ¶
Package kuma - Common operations for the adapter
Index ¶
- Constants
- Variables
- func ErrApplyHelmChart(err error) error
- func ErrClientConfig(err error) error
- func ErrClientSet(err error) error
- func ErrCustomOperation(err error) error
- func ErrDownloadBinary(err error) error
- func ErrFetchManifest(err error, des string) error
- func ErrGetKumactl(err error) error
- func ErrGetLatestRelease(err error) error
- func ErrInstallBinary(err error) error
- func ErrInstallKuma(err error) error
- func ErrInvalidOAMComponentType(compName string) error
- func ErrKumaCoreComponentFail(err error) error
- func ErrLoadNamespace(err error, s string) error
- func ErrMeshConfig(err error) error
- func ErrMoveBinary(err error) error
- func ErrParseKumaCoreComponent(err error) error
- func ErrProcessOAM(err error) error
- func ErrSampleApp(err error, status string) error
- func ErrStreamEvent(err error) error
- func ErrUntar(err error) error
- func New(config config.Handler, log logger.Handler, kubeConfig config.Handler, ...) adapter.Handler
- type CompHandler
- type Kuma
- func (kuma *Kuma) ApplyOperation(ctx context.Context, opReq adapter.OperationRequest) error
- func (kuma *Kuma) CreateKubeconfigs(kubeconfigs []string) error
- func (kuma *Kuma) HandleApplicationConfiguration(config v1alpha1.Configuration, isDel bool, kubeconfigs []string) (string, error)
- func (kuma *Kuma) HandleComponents(comps []v1alpha1.Component, isDel bool, kubeconfigs []string) (string, error)
- func (kuma *Kuma) ProcessOAM(ctx context.Context, oamReq adapter.OAMRequest) (string, error)
Constants ¶
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 ¶
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
ErrApplyHelmChart is the error for applying helm chart
func ErrClientConfig ¶ added in v0.2.0
ErrClientConfig is the error for setting client config
func ErrClientSet ¶ added in v0.2.0
ErrClientSet is the error for setting clientset
func ErrCustomOperation ¶ added in v0.4.0
ErrCustomOperation is the error occurred during the process of applying custom operation
func ErrDownloadBinary ¶ added in v0.3.8
ErrDownloadBinary is the error for downloading binary
func ErrFetchManifest ¶ added in v0.3.8
ErrFetchManifest is the error occurred during the process fetching manifest
func ErrGetKumactl ¶ added in v0.3.8
ErrGetKumactl is the error for getting `kumactl`
func ErrGetLatestRelease ¶ added in v0.5.9
ErrGetLatestRelease is the error for get latest versions
func ErrInstallBinary ¶ added in v0.3.8
ErrInstallBinary is the error for installing binary
func ErrInstallKuma ¶ added in v0.3.8
ErrInstallKuma is the error for install mesh
func ErrInvalidOAMComponentType ¶ added in v0.5.8
ErrInvalidOAMComponentType is the error when the OAM component name is not valid
func ErrKumaCoreComponentFail ¶ added in v0.5.8
ErrKumaCoreComponentFail is the error when core kuma component processing fails
func ErrLoadNamespace ¶ added in v0.5.12
ErrLoadNamespace is the occurend while applying namespace
func ErrMoveBinary ¶ added in v0.3.8
ErrMoveBinary is the error for moving binary
func ErrParseKumaCoreComponent ¶ added in v0.5.8
ErrParseKumaCoreComponent is the error when kuma core component manifest parsing fails
func ErrProcessOAM ¶ added in v0.5.8
ErrProcessOAM is a generic error which is thrown when an OAM operations fails
func ErrSampleApp ¶ added in v0.3.8
ErrSampleApp is the error for applying/deleting Sample App
func ErrStreamEvent ¶ added in v0.2.0
ErrStreamEvent is the error for streaming event
Types ¶
type CompHandler ¶ added in v0.5.8
CompHandler is the type for functions which can handle OAM components
type Kuma ¶ added in v0.3.8
Kuma represents the kuma adapter and embeds adapter.Adapter
func (*Kuma) ApplyOperation ¶ added in v0.3.8
ApplyOperation applies the operation on kuma
func (*Kuma) CreateKubeconfigs ¶ added in v0.5.22
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
ProcessOAM will handles the grpc invocation for handling OAM objects