config

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2024 License: EPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LatestAPIVersion = apiVersionGroup + "/" + latestVersion

	CurrentConfigVersion = configV1
)

Variables

This section is empty.

Functions

func AddDetachedAgent

func AddDetachedAgent(agent rsc.Agent) error

func AddNamespace

func AddNamespace(name, created string) error

AddNamespace adds a new namespace to the config

func AttachAgent

func AttachAgent(namespace, name, uuid string) error

func DeleteDetachedAgent

func DeleteDetachedAgent(name string) error

func DeleteNamespace

func DeleteNamespace(name string) error

DeleteNamespace removes a namespace including all the resources within it

func DetachAgent

func DetachAgent(namespace, name string) error

func Flush

func Flush() error

Flush will write namespace files to disk

func GetDefaultNamespaceName

func GetDefaultNamespaceName() string

func GetDetachedAgent

func GetDetachedAgent(name string) (rsc.Agent, error)

func GetDetachedAgents

func GetDetachedAgents() []rsc.Agent

func GetNamespace

func GetNamespace(namespace string) (*rsc.Namespace, error)

GetNamespace returns the namespace

func GetNamespaces

func GetNamespaces() (namespaces []string)

GetNamespaces returns all namespaces in config

func Init

func Init(configFolderArg string)

Init initializes config, namespace and unmarshalls the files

func RenameDetachedAgent

func RenameDetachedAgent(oldName, newName string) error

func RenameNamespace

func RenameNamespace(name, newName string) error

RenameNamespace renames a namespace

func SetDefaultNamespace

func SetDefaultNamespace(name string) (err error)

func UpdateDetachedAgent

func UpdateDetachedAgent(agent rsc.Agent) error

func ValidateHeader

func ValidateHeader(header *Header) error

Types

type Header struct {
	APIVersion string         `yaml:"apiVersion" json:"apiVersion"`
	Kind       Kind           `yaml:"kind" json:"kind"`
	Metadata   HeaderMetadata `yaml:"metadata" json:"metadata"`
	Spec       interface{}    `yaml:"spec" json:"spec"`
}

Header contains k8s yaml header

type HeaderMetadata

type HeaderMetadata struct {
	Name      string    `yaml:"name" json:"name"`
	Namespace string    `yaml:"namespace" json:"namespace"`
	Tags      *[]string `yaml:"tags,omitempty" json:"tags,omitempty"`
}

HeaderMetadata contains k8s metadata

type Kind

type Kind string
const (
	AgentConfigKind  Kind = "AgentConfig"
	CatalogItemKind  Kind = "CatalogItem"
	EdgeResourceKind Kind = "EdgeResource"

	RegistryKind               Kind = "Registry"
	VolumeKind                 Kind = "Volume"
	LocalAgentKind             Kind = "LocalAgent"
	RemoteAgentKind            Kind = "Agent"
	KubernetesControlPlaneKind Kind = "KubernetesControlPlane"
	RemoteControlPlaneKind     Kind = "ControlPlane"
	LocalControlPlaneKind      Kind = "LocalControlPlane"
	KubernetesControllerKind   Kind = "KubernetesController"
	RemoteControllerKind       Kind = "Controller"
	LocalControllerKind        Kind = "LocalController"
	MicroserviceKind           Kind = Kind(apps.MicroserviceKind)
	ApplicationKind            Kind = Kind(apps.ApplicationKind)
	ApplicationTemplateKind    Kind = Kind(apps.ApplicationTemplateKind)
	RouteKind                  Kind = Kind(apps.RouteKind)
)

Jump to

Keyboard shortcuts

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