projectbinding

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	APIVersion   = "tako.redentor.dev/v1alpha1"
	Kind         = "ProjectClusterBinding"
	RelativePath = ".tako/platform-cluster.json"
)

Variables

This section is empty.

Functions

func PathForConfig

func PathForConfig(configPath string) (string, error)

Types

type Binding

type Binding struct {
	APIVersion          string     `json:"apiVersion"`
	Kind                string     `json:"kind"`
	Project             string     `json:"project"`
	ClusterID           string     `json:"clusterId"`
	LocalNodeID         string     `json:"localNodeId,omitempty"`
	LocalNodeName       string     `json:"localNodeName,omitempty"`
	ControllerNodeID    string     `json:"controllerNodeId,omitempty"`
	ControllerNodeName  string     `json:"controllerNodeName,omitempty"`
	InventoryGeneration uint64     `json:"inventoryGeneration,omitempty"`
	InventoryUpdatedAt  *time.Time `json:"inventoryUpdatedAt,omitempty"`
	AttachedAt          time.Time  `json:"attachedAt"`
}

Binding is a create-once acknowledgement that a project workspace belongs to one platform cluster. It prevents a checkout on an enrolled worker from silently treating that worker as an unrelated control plane.

func Create

func Create(path string, binding Binding) (*Binding, error)

Create publishes a binding without replacing an existing document. A concurrent creator may win; callers receive the durable winner for comparison instead of silently overwriting it.

func New

func New(project string, platform Context, now time.Time) (*Binding, error)

func ReadOptional

func ReadOptional(path string) (*Binding, error)

func (*Binding) Matches

func (b *Binding) Matches(project string, platform Context) error

func (*Binding) Validate

func (b *Binding) Validate() error

type Context

type Context struct {
	ClusterID           string
	LocalNodeID         string
	LocalNodeName       string
	ControllerNodeID    string
	ControllerNodeName  string
	InventoryGeneration uint64
	InventoryUpdatedAt  time.Time
}

Context is the trusted, node-local platform identity relevant to a project workspace. It deliberately contains no application-supplied server fields.

Jump to

Keyboard shortcuts

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