config

package
v0.6.13 Latest Latest
Warning

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

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

Documentation

Overview

Package config define the configuration and operation of the adapter

Index

Constants

View Source
const (
	Development = "development"
	Production  = "production"

	AnnotateNamespace = "annotate-namespace"
	ServicePatchFile  = "service-patch-file"
	HelmChartURL      = "helm-chart-url"

	// Addons that the adapter supports
	JaegerAddon       = "jaeger-addon"
	VizAddon          = "viz-addon"
	MultiClusterAddon = "multicluster-addon"
	SMIAddon          = "smi-addon"
	// OAM Metadata constants
	OAMAdapterNameMetadataKey       = "adapter.meshery.io/name"
	OAMComponentCategoryMetadataKey = "ui.meshery.io/category"
)
View Source
const (
	ErrEmptyConfigCode           = "1000"
	ErrGetLatestReleasesCode     = "1001"
	ErrGetLatestReleaseNamesCode = "1002"
	ErrGetFileNamesCode          = "1107"
)

Variables

View Source
var (
	// LinkerdOperation is the default name for the install
	// and uninstall commands on the Linkerd
	LinkerdOperation = strings.ToLower(smp.ServiceMesh_LINKERD.Enum().String())

	Config = configprovider.Options{
		FilePath: configRootPath,
		FileName: "linkerd",
		FileType: "yaml",
	}

	ServerConfig = map[string]string{
		"name":     smp.ServiceMesh_LINKERD.Enum().String(),
		"port":     "10001",
		"type":     "adapter",
		"traceurl": status.None,
	}

	MeshSpec = map[string]string{
		"name":    smp.ServiceMesh_LINKERD.Enum().String(),
		"status":  status.NotInstalled,
		"version": status.None,
	}

	ProviderConfig = map[string]string{
		configprovider.FilePath: configRootPath,
		configprovider.FileType: "yaml",
		configprovider.FileName: "linkerd",
	}

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

	Operations = getOperations(common.Operations)
)
View Source
var (
	ErrEmptyConfig = errors.New(ErrEmptyConfigCode, errors.Alert, []string{"Config is empty"}, []string{}, []string{}, []string{})
)
View Source
var (
	ServiceName = "service_name"
)

Functions

func ErrGetFileNames added in v0.5.15

func ErrGetFileNames(err error) error

ErrGetFileNames is the error for fetching linkerd releases

func ErrGetLatestReleaseNames

func ErrGetLatestReleaseNames(err error) error

ErrGetLatestReleaseNames is the error for fetching linkerd releases

func ErrGetLatestReleases

func ErrGetLatestReleases(err error) error

ErrGetLatestReleases is the error for fetching linkerd releases

func GetFileNames added in v0.5.15

func GetFileNames(owner string, repo string, path string) (map[string]string, error)

GetFileNames takes the url of a github repo and the path to a directory. Then returns all the filenames->URL from that directory

func GetLatestReleaseNames added in v0.5.21

func GetLatestReleaseNames(limit int) ([]adapter.Version, error)

getLatestReleaseNames returns the names of the latest releases limited by the "limit" parameter. The first version in the list is always is the latest "stable" version.

func New

func New(provider string) (h config.Handler, err 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

Jump to

Keyboard shortcuts

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