team

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package team hosts the `kuke team` parent command and its subcommands. The team-distribution epic (#792) lands `init` across four steps: skeleton + drop-in lifecycle (#796), pinned-source resolve + cache + role/harness/image load (#1041), render pipeline (needs-merge / image-select / bind) (#1042), and apply-with-prune to kukeond (#1043). After step 4, `kuke team init` reads the project's committed kuketeam.yaml roster, scaffolds the operator- global facts file (~/.kuke/kuketeams.yaml) on first run, renders the per- (role × harness) CellBlueprint/CellConfig pairs labeled with the project, applies that labeled set to kukeond (per-team prune via #1029 — re-running in one project prunes only that project's stale objects and leaves every other project untouched), and writes a per-project drop-in entry (~/.kuke/kuketeam.d/<project>.yaml). Nothing is written under ~/.kuke/rendered/ — the daemon owns the persisted blueprints/configs and the drop-in entry is the only host-side record of an applied team.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewInitCmd

func NewInitCmd() *cobra.Command

NewInitCmd builds the `kuke team init` subcommand. It reads the current project's kuketeam.yaml roster, scaffolds the operator-global facts file on first run, materializes the pinned agents source, renders the per-(role × harness) CellBlueprint/CellConfig pairs, applies them to kukeond under the project's team label (per-team prune via #1029), and writes the per-project drop-in entry. `--dry-run` stops after render, prints the rendered objects to stdout, applies nothing, and touches no files on disk.

func NewTeamCmd

func NewTeamCmd() *cobra.Command

NewTeamCmd builds the `kuke team` parent command and registers its subcommands. Persistent flags on the root kuke command are inherited automatically.

Types

type ApplyForTeamFunc

type ApplyForTeamFunc func(
	ctx context.Context, rawYAML []byte, team string,
) (kukeonv1.ApplyDocumentsResult, error)

ApplyForTeamFunc applies a per-(role × harness) rendered set to kukeond under the project's team label, pruning that team's stale objects in the same call (the per-team prune-apply contract from #1029). The default implementation dials kukeond and invokes ApplyDocumentsForTeam; tests inject a stub via MockApplyForTeamKey so the apply path can run hermetically.

type BuildAllFunc

type BuildAllFunc func(
	ctx context.Context,
	cacheDir, sourceRef, realm string,
	leaves []*model.ImageCatalogEntry,
	progressW, stdout, stderr io.Writer,
) error

BuildAllFunc runs the local-build path for `kuke team init --build`: it walks the FROM directives of the selected catalog leaves under cacheDir, derives the base-before-leaves order, and invokes kukebuild once per image into the target realm's containerd namespace (no registry push). The default implementation delegates to teambuild.BuildAll; tests inject a stub via MockBuildAllKey so the build path can run without a kukebuild binary on PATH.

type GitConfigFunc

type GitConfigFunc func(ctx context.Context, key string) (string, bool)

GitConfigFunc reads a single `git config --global <key>` value, reporting whether the key was set. Injected via MockGitConfigKey in tests so the scaffold is hermetic and does not read the host operator's real git config.

type MockApplyForTeamKey

type MockApplyForTeamKey struct{}

MockApplyForTeamKey injects an ApplyForTeamFunc via context for tests.

type MockBuildAllKey

type MockBuildAllKey struct{}

MockBuildAllKey injects a BuildAllFunc via context for tests.

type MockGitConfigKey

type MockGitConfigKey struct{}

MockGitConfigKey injects a GitConfigFunc via context for tests.

type MockProjectRepoURLKey

type MockProjectRepoURLKey struct{}

MockProjectRepoURLKey injects a ProjectRepoURLFunc via context for tests.

type MockResolveKey

type MockResolveKey struct{}

MockResolveKey injects a ResolveFunc via context for tests.

type ProjectRepoURLFunc

type ProjectRepoURLFunc func(ctx context.Context, projectDir string) (string, bool)

ProjectRepoURLFunc resolves the clone URL of the project repo whose kuketeam.yaml is at projectDir. The default implementation runs `git -C <projectDir> remote get-url origin`; tests inject a stub via MockProjectRepoURLKey so the render path stays hermetic. A missing remote returns ok=false; the render pipeline then leaves the project repo slot unfilled rather than failing the whole `kuke team init` (the operator may be init-ing a project that has not yet been pushed).

type ResolveFunc

type ResolveFunc func(
	ctx context.Context,
	cache teamsource.Cache,
	tc *model.TeamsConfig,
	pt *model.ProjectTeam,
) (*teamsource.Bundle, error)

ResolveFunc materializes the agents source and loads the role/harness/image documents the project's roster references. The default implementation delegates to teamsource.Resolve against a real on-disk cache; tests inject a stub via MockResolveKey so the render path can run without cloning git.

Jump to

Keyboard shortcuts

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