platforminventory

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package platforminventory defines component identity, ownership and placement. It does not provision resources or authorize namespace access.

Index

Constants

View Source
const (
	PlatformNamespace      = "mcp-platform"
	ObservabilityNamespace = "mcp-observability"
	LogCollectorNamespace  = mcpdefaults.LogCollectorNamespace
	OperatorNamespace      = "github.com/mcp-runtime/mcp-runtime"
	// SharedConfigName is the same ConfigMap name in every published namespace.
	// The namespace is the location; the name marks the copy as shared.
	SharedConfigName = "mcp-shared-config"
	// SharedDataPriorityClass outranks SharedServicesPriorityClass during eviction.
	// Both are cluster-scoped and used by more than one namespace.
	SharedDataPriorityClass     = "mcp-shared-data"
	SharedServicesPriorityClass = "mcp-shared-services"
)
View Source
const LegacyCredentialSecret = "mcp-sentinel-secrets" // #nosec G101 -- Kubernetes object name

Variables

This section is empty.

Functions

func CredentialOwner

func CredentialOwner(key string) (string, bool)

CredentialOwner returns the authoritative Secret for a key. For shared API auth keys platform-api is the owner; the remaining API/UI copies are derived.

func CredentialPlacement

func CredentialPlacement(key string) (namespace, name string, ok bool)

CredentialPlacement returns the namespace and Secret that own a key.

func OwnerNamespaces

func OwnerNamespaces() map[Owner]string

OwnerNamespaces returns a copy of the install placement.

func ServiceHost

func ServiceHost(key string, port int) (string, error)

ServiceHost is the in-cluster DNS name for a component Service port.

Types

type Capability

type Capability string
const (
	Control    Capability = "control"
	Telemetry  Capability = "telemetry"
	Routing    Capability = "routing"
	Persistent Capability = "persistent"
	NodeLogs   Capability = "node-logs"
	Optional   Capability = "optional"
	External   Capability = "external"
)

type Component

type Component struct {
	Owner        Owner        `json:"-"`
	Capabilities []Capability `json:"-"`
	Dependencies []Dependency `json:"-"`
	Sentinel     bool         `json:"-"`
	Key          string
	Display      string
	Namespace    string
	Kind         string
	Resource     string
	Label        string
	Aliases      []string
	PortTarget   *PortTarget
}

Component identifies a stable platform component independently of placement.

func Catalog

func Catalog() []Component

Catalog returns an independent copy, including nested metadata.

func Find

func Find(name string) (Component, bool)

Find accepts the historical case-insensitive CLI aliases.

func Lookup

func Lookup(key string) (Component, bool)

Lookup accepts stable identifiers only. Release manifests cannot select aliases.

func SentinelComponents

func SentinelComponents(includeOperator bool) []Component

SentinelComponents preserves the existing management surface. Image-only, optional authentication and database components are deliberately not added to restart-all or to the public status response by inventory consolidation.

type CredentialSet

type CredentialSet struct {
	Name      string
	Consumers []string
	Keys      []string
}

CredentialSet defines the exact keys delivered to its consumers. Shared keys have one authoritative set; setup synchronizes only explicitly listed copies. This metadata describes consumption, not authorization to read Secrets.

func CredentialSets

func CredentialSets() []CredentialSet

CredentialSets returns copies safe for callers to modify.

func (CredentialSet) Namespace

func (set CredentialSet) Namespace() string

Namespace returns the install namespace for a credential set from its first consumer. A set with no consumer stays with the platform owner.

type Dependency

type Dependency struct {
	Component string
	Optional  bool
}

Dependency describes a service relationship, not rollout order. Optional dependencies must not block the control plane during telemetry outages.

type Owner

type Owner string
const (
	Operator      Owner = "operator"
	Platform      Owner = "platform"
	Observability Owner = "observability"
	LogCollector  Owner = "log-collector"
	Certificates  Owner = "certificates"
	Registry      Owner = "registry"
	Ingress       Owner = "ingress"
)

type PortTarget

type PortTarget struct {
	ResourceKind string
	ResourceName string
	LocalPort    int
	RemotePort   int
}

PortTarget defines a port forwarding target.

Jump to

Keyboard shortcuts

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