workloadmeta

package
v1.0.0-rc.9 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2026 License: EPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RuntimeEngineDocker  = "docker"
	RuntimeEnginePodman  = "podman"
	RuntimeEngineEdgelet = "edgelet"
)
View Source
const (
	RoleWorkload   = "workload"
	RoleRouter     = "router"
	RoleNats       = "nats"
	RoleController = "controller"
	RoleEdgelet    = "edgelet"
)
View Source
const (
	ScopeManaged = "managed"
	ScopeLocal   = "local"
)
View Source
const (
	LabelAppName      = "app.kubernetes.io/name"
	LabelAppInstance  = "app.kubernetes.io/instance"
	LabelAppPartOf    = "app.kubernetes.io/part-of"
	LabelAppManagedBy = "app.kubernetes.io/managed-by"

	LabelMicroserviceUID = "edgelet.iofog.org/microservice-uid"
	LabelNodeUID         = "edgelet.iofog.org/node-uid"
	LabelScope           = "edgelet.iofog.org/scope"
	LabelRuntimeEngine   = "edgelet.iofog.org/runtime-engine"
	LabelRole            = "edgelet.iofog.org/role"

	LabelSystem      = "edgelet.iofog.org/system"
	LabelHostNetwork = "edgelet.iofog.org/host-network"
	LabelSandboxID   = "edgelet.iofog.org/sandbox-id"
	LabelHealthcheck = "edgelet.iofog.org/healthcheck"
)
View Source
const (
	EnvMicroserviceUID  = "EDGELET_MICROSERVICE_UID"
	EnvMicroserviceName = "EDGELET_MICROSERVICE_NAME"
	EnvApplicationName  = "EDGELET_APPLICATION_NAME"
	EnvNodeUID          = "EDGELET_NODE_UID"
	EnvScope            = "EDGELET_SCOPE"
	EnvRuntimeEngine    = "EDGELET_RUNTIME_ENGINE"
	EnvRole             = "EDGELET_ROLE"
	EnvTimeZone         = "TZ"
)
View Source
const (
	LocalDeployApplicationName = "edgelet"
)
View Source
const (
	ManagedByValue = "edgelet"
)

Variables

ProtectedLabelKeys cannot be overridden by user-supplied labels.

View Source
var RemovedLegacyEnvVars = []string{
	"SELFNAME",
}

RemovedLegacyEnvVars lists predefined env keys retired in favor of EnvSpec v1.

View Source
var RemovedLegacyLabelKeys = []string{
	"iofog-ms",
	"iofog-name",
	"iofog-app",
	"iofog-uuid",
	"iofog.uuid",
	"iofog-router",
	"iofog-nats",
	"iofog-system",
	"iofog-hostnet",
	"iofog-sandbox-id",
	"iofog-healthcheck",
}

RemovedLegacyLabelKeys lists identity/metadata label keys retired in favor of LabelSpec v1. Retained for documentation, tests, and repository audits (not used at runtime).

View Source
var ReservedEnvKeys = map[string]struct{}{
	EnvMicroserviceUID:  {},
	EnvMicroserviceName: {},
	EnvApplicationName:  {},
	EnvNodeUID:          {},
	EnvScope:            {},
	EnvRuntimeEngine:    {},
	EnvRole:             {},
}

ReservedEnvKeys are agent-controlled and cannot be overridden by user env.

Functions

func BuildEnv

func BuildEnv(in BuildInput) []string

func BuildLabels

func BuildLabels(in BuildInput) map[string]string

func IsControllerRole

func IsControllerRole(labels map[string]string) bool

func IsEdgeletRole

func IsEdgeletRole(labels map[string]string) bool

func IsLocalApplication

func IsLocalApplication(application string) bool

func IsLocalScope

func IsLocalScope(scope string) bool

func IsManagedByIofog

func IsManagedByIofog(labels map[string]string) bool

func IsSystemWorkload

func IsSystemWorkload(labels map[string]string) bool

func MergeUserLabels

func MergeUserLabels(user map[string]string, canonical map[string]string) map[string]string

func MicroserviceUIDFromLabels

func MicroserviceUIDFromLabels(labels map[string]string) string

func ResolveScope

func ResolveScope(application string, hostNetwork bool) string

func RoleFromLabels

func RoleFromLabels(labels map[string]string) string

func RoleFromMicroservice

func RoleFromMicroservice(isRouter, isNats bool) string

func ScopeFromMicroservice

func ScopeFromMicroservice(application string, hostNetwork bool) string

Types

type BuildInput

type BuildInput struct {
	MicroserviceUUID string
	MicroserviceName string
	ApplicationName  string
	NodeUUID         string
	RuntimeEngine    string

	IsRouter     bool
	IsNats       bool
	IsController bool
	HostNetwork  bool
	IsSystem     bool

	SandboxID string
	TimeZone  string

	UserEnv    map[string]string
	UserLabels map[string]string
}

Jump to

Keyboard shortcuts

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