config

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LabelNamespace   = "label-namespace"
	ServicePatchFile = "service-patch-file"
	// Addons that the adapter supports
	PrometheusAddon = "appmesh-prometheus-addon"
	GrafanaAddon    = "appmesh-grafana-addon"
	HelmChartURL    = "helm-chart-url"
	// OAM Metadata constants
	OAMAdapterNameMetadataKey       = "adapter.meshery.io/name"
	OAMComponentCategoryMetadataKey = "ui.meshery.io/category"
)
View Source
const (
	ErrEmptyConfigCode           = "app-mesh"
	ErrInstallBinaryCode         = "app-mesh"
	ErrGetLatestReleasesCode     = "app-mesh"
	ErrGetLatestReleaseNamesCode = "app-mesh"
	ErrStatusCheckCode           = "app-mesh"
)

Variables

View Source
var (
	AppMeshOperation = strings.ToLower(smp.ServiceMesh_APP_MESH.Enum().String())

	ServerVersion = status.None
	ServerGitSHA  = status.None

	Config = configprovider.Options{
		ServerConfig:   ServerConfig,
		MeshSpec:       MeshSpec,
		ProviderConfig: ProviderConfig,
		Operations:     Operations,
	}

	// ServerConfig is the configuration for the gRPC server
	ServerConfig = map[string]string{
		"name":     smp.ServiceMesh_APP_MESH.Enum().String(),
		"type":     "adapter",
		"port":     "10005",
		"traceurl": status.None,
	}

	// MeshSpec is the spec for the service mesh associated with this adapter
	MeshSpec = map[string]string{
		"name":    smp.ServiceMesh_APP_MESH.Enum().String(),
		"status":  status.NotInstalled,
		"version": status.None,
	}

	// ProviderConfig is the config for the configuration provider
	ProviderConfig = map[string]string{
		configprovider.FilePath: configRootPath,
		configprovider.FileType: "yaml",
		configprovider.FileName: "app-mesh",
	}

	// KubeConfig - Controlling the kubeconfig lifecycle with viper
	KubeConfig = map[string]string{
		configprovider.FilePath: configRootPath,
		configprovider.FileType: "yaml",
		configprovider.FileName: "kubeconfig",
	}

	// Operations represents the set of valid operations that are available
	// to the adapter
	Operations = getOperations(common.Operations)
)
View Source
var (
	// ErrEmptyConfig error is the error when config is invalid
	ErrEmptyConfig = errors.New(ErrEmptyConfigCode, errors.Alert, []string{"Config is empty"}, []string{}, []string{}, []string{})
)
View Source
var (
	ServiceName = "service_name"
)

Functions

func ErrGetLatestReleaseNames

func ErrGetLatestReleaseNames(err error) error

ErrGetLatestReleaseNames is the error for fetching nsm-mesh releases

func ErrGetLatestReleases

func ErrGetLatestReleases(err error) error

ErrGetLatestReleases is the error for fetching nsm-mesh releases

func ErrInstallBinary

func ErrInstallBinary(err error) error

ErrInstallBinary captures failure to update filesystem permissions

func ErrStatusCheck

func ErrStatusCheck(status string) error

func New

func New(provider string) (config.Handler, error)

New creates a new config instance

func NewKubeconfigBuilder

func NewKubeconfigBuilder(provider string) (config.Handler, error)

func RootPath

func RootPath() string

RootPath returns the config root path for the adapter

Types

type Asset

type Asset struct {
	Name        string `json:"name,omitempty"`
	State       string `json:"state,omitempty"`
	DownloadURL string `json:"browser_download_url,omitempty"`
}

Asset describes the github release asset object

type Release

type Release struct {
	ID      int             `json:"id,omitempty"`
	TagName string          `json:"tag_name,omitempty"`
	Name    adapter.Version `json:"name,omitempty"`
	Draft   bool            `json:"draft,omitempty"`
	Assets  []*Asset        `json:"assets,omitempty"`
}

Release is used to save the release informations

func GetLatestReleases

func GetLatestReleases(releases uint) ([]*Release, error)

GetLatestReleases fetches the latest releases from the aws/aws-app-mesh-controller-for-k8s repository

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL