config

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: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Constants to use in log statements
	LabelNamespace = "label-namespace"

	ServicePatchFile = "service-patch-file"
	CPPatchFile      = "cp-patch-file"
	ControlPatchFile = "control-patch-file"
	FilterPatchFile  = "filter-patch-file"

	// Istio vet operation
	IstioVetOperation = "istio-vet"

	// Configure Envoy filter operation
	EnvoyFilterOperation = "envoy-filter-operation"

	// Addons that the adapter supports
	PrometheusAddon = "prometheus-addon"
	GrafanaAddon    = "grafana-addon"
	KialiAddon      = "kiali-addon"
	JaegerAddon     = "jaeger-addon"
	ZipkinAddon     = "zipkin-addon"

	// Policies
	DenyAllPolicyOperation     = "deny-all-policy-operation"
	StrictMTLSPolicyOperation  = "strict-mtls-policy-operation"
	MutualMTLSPolicyOperation  = "mutual-mtls-policy-operation"
	DisableMTLSPolicyOperation = "disable-mtls-policy-operation"

	// OAM Metadata constants
	OAMAdapterNameMetadataKey       = "adapter.meshery.io/name"
	OAMComponentCategoryMetadataKey = "ui.meshery.io/category"
)
View Source
const (
	ErrEmptyConfigCode           = "1000"
	ErrGetLatestReleasesCode     = "1001"
	ErrGetLatestReleaseNamesCode = "1002"
)

Variables

View Source
var (
	// IstioMeshOperation is the default name for the install
	// and uninstall commands on the istio mesh
	IstioOperation = strings.ToLower(smp.ServiceMesh_ISTIO.Enum().String())

	ServerVersion = status.None
	ServerGitSHA  = status.None

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

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

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

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

	// KubeConfig - Controlling the kubeconfig lifecycle with viper
	KubeConfig = map[string]string{
		configprovider.FilePath: configRootPath,
		configprovider.FileType: "yaml",
		configprovider.FileName: "kubeconfig",
	}
)
View Source
var (
	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 istio releases

func ErrGetLatestReleases

func ErrGetLatestReleases(err error) error

ErrGetLatestReleases is the error for fetching istio releases

func GetOperations added in v0.6.10

func GetOperations(dev adapter.Operations, version string) adapter.Operations

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