config

package
v0.7.5 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServerKey                 = "server-config"
	PipelineNameKey           = "meshsync-pipeline"
	ResourcesKey              = "resources"
	GlobalResourceKey         = "global"
	LocalResourceKey          = "local"
	ListenersKey              = "listeners"
	LogStreamsKey             = "log-streams"
	PatternResourceIDLabelKey = "resource.pattern.meshery.io/id"

	BrokerURL     = "broker-url"
	RequestStream = "request-stream"
	LogStream     = "log-stream"
	ExecShell     = "exec-shell"
	InformerStore = "informer-store"
)
View Source
const (
	ErrInitConfigCode = "1000"
)

Variables

View Source
var (
	Server = map[string]string{
		"name":      "meshery-meshsync",
		"port":      "11000",
		"version":   "latest",
		"startedat": time.Now().String(),
	}

	DefaultPublishingSubject = "meshery.meshsync.core"

	Pipelines = map[string]PipelineConfigs{
		GlobalResourceKey: []PipelineConfig{

			{
				Name:      "namespaces.v1.",
				PublishTo: DefaultPublishingSubject,
			},
			{
				Name:      "configmaps.v1.",
				PublishTo: "meshery.meshsync.core",
			},
			{
				Name:      "nodes.v1.",
				PublishTo: "meshery.meshsync.core",
			},
			{
				Name:      "secrets.v1.",
				PublishTo: "meshery.meshsync.core",
			},
			{
				Name:      "persistentvolumes.v1.",
				PublishTo: "meshery.meshsync.core",
			},
			{
				Name:      "persistentvolumeclaims.v1.",
				PublishTo: "meshery.meshsync.core",
			},
		},
		LocalResourceKey: []PipelineConfig{

			{
				Name:      "replicasets.v1.apps",
				PublishTo: DefaultPublishingSubject,
			},
			{
				Name:      "pods.v1.",
				PublishTo: DefaultPublishingSubject,
			},
			{
				Name:      "services.v1.",
				PublishTo: DefaultPublishingSubject,
			},
			{
				Name:      "deployments.v1.apps",
				PublishTo: DefaultPublishingSubject,
			},
			{
				Name:      "statefulsets.v1.apps",
				PublishTo: DefaultPublishingSubject,
			},
			{
				Name:      "daemonsets.v1.apps",
				PublishTo: DefaultPublishingSubject,
			},

			{
				Name:      "ingresses.v1.networking.k8s.io",
				PublishTo: DefaultPublishingSubject,
			},

			{
				Name:      "endpoints.v1.",
				PublishTo: DefaultPublishingSubject,
			},

			{
				Name:      "endpointslices.v1.discovery.k8s.io",
				PublishTo: DefaultPublishingSubject,
			},

			{
				Name:      "cronjobs.v1.batch",
				PublishTo: DefaultPublishingSubject,
			},

			{
				Name:      "replicationcontrollers.v1.",
				PublishTo: DefaultPublishingSubject,
			},

			{
				Name:      "storageclasses.v1.storage.k8s.io",
				PublishTo: DefaultPublishingSubject,
			},

			{
				Name:      "clusterroles.v1.rbac.authorization.k8s.io",
				PublishTo: DefaultPublishingSubject,
			},

			{
				Name:      "volumeattachments.v1.storage.k8s.io",
				PublishTo: DefaultPublishingSubject,
			},

			{
				Name:      "apiservices.v1.apiregistration.k8s.io",
				PublishTo: DefaultPublishingSubject,
			},
		},
	}

	Listeners = map[string]ListenerConfig{
		LogStream: {
			Name:           LogStream,
			ConnectionName: "meshsync-logstream",
			PublishTo:      "meshery.meshsync.logs",
		},
		ExecShell: {
			Name:           ExecShell,
			ConnectionName: "meshsync-exec",
			PublishTo:      "meshery.meshsync.exec",
		},
		RequestStream: {
			Name:           RequestStream,
			ConnectionName: "meshsync-request-stream",
			SubscribeTo:    "meshery.meshsync.request",
		},
	}

	DefaultEvents = []string{"ADD", "UPDATE", "DELETE"}
)

Functions

func ErrInitConfig

func ErrInitConfig(err error) error

func New

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

New creates a new config instance

func PatchCRVersion added in v0.7.3

func PatchCRVersion(config *rest.Config) error

Types

type ListenerConfig added in v0.1.18

type ListenerConfig struct {
	Name           string   `json:"name" yaml:"name"`
	ConnectionName string   `json:"connection-name" yaml:"connection-name"`
	PublishTo      string   `json:"publish-to" yaml:"publish-to"`
	SubscribeTo    string   `json:"subscribe-to" yaml:"subscribe-to"`
	Events         []string `json:"events" yaml:"events"`
}

type ListenerConfigs added in v0.1.18

type ListenerConfigs []ListenerConfig

type MeshsyncConfig added in v0.6.23

type MeshsyncConfig struct {
	BlackList []string                   `json:"blacklist" yaml:"blacklist"`
	Pipelines map[string]PipelineConfigs `json:"pipeline-configs,omitempty" yaml:"pipeline-configs,omitempty"`
	Listeners map[string]ListenerConfig  `json:"listener-config,omitempty" yaml:"listener-config,omitempty"`
	WhiteList []ResourceConfig           `json:"resource-configs" yaml:"resource-configs"`
}

Meshsync configuration controls the resources meshsync produces and consumes

func GetMeshsyncCRDConfigs added in v0.6.23

func GetMeshsyncCRDConfigs(dyClient dynamic.Interface) (*MeshsyncConfig, error)

func PopulateConfigs added in v0.6.23

func PopulateConfigs(configMap corev1.ConfigMap) (*MeshsyncConfig, error)

PopulateConfigs compares the default configs and the whitelist and blacklist

type PipelineConfig added in v0.1.7

type PipelineConfig struct {
	Name      string   `json:"name" yaml:"name"`
	PublishTo string   `json:"publish-to" yaml:"publish-to"`
	Events    []string `json:"events" yaml:"events"`
}

type PipelineConfigs added in v0.1.7

type PipelineConfigs []PipelineConfig

func (PipelineConfigs) Add added in v0.7.1

func (PipelineConfigs) Delete added in v0.7.1

type ResourceConfig added in v0.6.23

type ResourceConfig struct {
	Resource string
	Events   []string
}

Watched Resource configuration

Jump to

Keyboard shortcuts

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