Compare commits

..

4 Commits

Author SHA1 Message Date
Jeff McCune
f20f2fd203 show: compile build plans with sub-processes
This is a first stab at compiling build plans with a pool of holos
compile sub-processes.  Tested against the kargo-demo repository.
2025-05-05 19:43:39 -07:00
Jeff McCune
07f0ddd7b2 compile: take a BuildPlanRequest as input
This package clarifies and simplifies the input protocol of the holos
compile command.  A BuildPlanRequest represents the complete context
necessary to compile a BuildPlan.

This patch also upgrades cue to v0.13.0-alpha4
2025-05-05 19:43:37 -07:00
Jeff McCune
72d465fecc compile: export a build plan to stdout
This patch copies the build plan rendering from the show buildplans
command to implement the rendering in the compile subcommand.
2025-05-05 19:43:37 -07:00
Jeff McCune
1fc2f28289 compile: add basic structure of holos compile command
This command reads Component objects from a reader, exports a BuildPlan
from CUE, then marshals the result to the writer.

The purpose is to run concurrent instances of CUE to speed up build plan
generation prior to task execution.
2025-05-05 19:43:36 -07:00
170 changed files with 566 additions and 22946 deletions

View File

@@ -1,13 +0,0 @@
{
"permissions": {
"allow": [
"Bash(cd:*)",
"Bash(holos:*)",
"Bash(cue:*)",
"Bash(git commit:*)",
"Bash(git add:*)",
"Bash(make:*)"
],
"deny": []
}
}

View File

@@ -25,6 +25,6 @@ jobs:
with:
go-version: stable
- name: golangci-lint
uses: golangci/golangci-lint-action@v7
uses: golangci/golangci-lint-action@v6
with:
version: v2.1.6
version: v1.64.5

View File

@@ -30,8 +30,6 @@ jobs:
- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: '3.17.3'
- name: Set up Kubectl
uses: azure/setup-kubectl@v4

5
.gitignore vendored
View File

@@ -16,7 +16,4 @@ node_modules/
# nix
/.direnv/
result
# claude
/.claude/settings.local.json
result

View File

@@ -1,20 +1,2 @@
version: "2"
linters:
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
paths:
- third_party$
- builtin$
- examples$
formatters:
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
run:
timeout: 5m

115
CLAUDE.md
View File

@@ -1,115 +0,0 @@
# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## Project Overview
Holos is a configuration management tool for Kubernetes that implements the rendered manifests pattern using CUE. It unifies Helm charts, Kustomize bases, and raw Kubernetes manifests into a single, declarative pipeline.
### Core Flow
```
Platform → Components → BuildPlan → Generators → Transformers → Validators → Manifests
```
## Key Commands
```bash
# Development
make build # Build the binary
make install # Install binary (REQUIRED before testing holos commands)
make test # Run all tests
make fmt # Format Go code
make lint # Run linters
make coverage # Generate coverage report
# Documentation
make update-docs # Update generated docs
make website # Build the documentation website
# Usage (run 'make install' first to test code changes)
holos render platform # Render entire platform
holos render component # Render single component
holos show buildplans # Show build plans
holos init platform # Initialize new platform
```
## Architecture
### Directory Structure
- `/api/` - API definitions (v1alpha5 stable, v1alpha6 in development)
- `/cmd/` - CLI entry point
- `/internal/cli/` - Command implementations
- `/internal/component/` - Component handling logic
- `/internal/platform/` - Platform handling logic
- `/internal/generate/` - Code generation
### Key Files
- `/internal/cli/render/render.go` - Core render logic
- `/internal/component/component.go` - Component processing
- `/api/core/v1alpha*/types.go` - API type definitions
### Component Types
1. **Helm** - Wraps Helm charts
2. **Kustomize** - Wraps Kustomize bases
3. **Kubernetes** - Raw Kubernetes manifests
## CUE Patterns
Components are defined in CUE:
```cue
package holos
holos: Component.BuildPlan
Component: #Helm & {
Name: "example"
Chart: {
version: "1.0.0"
repository: {
name: "example"
url: "https://charts.example.com"
}
}
}
```
## Testing
- Unit tests: `*_test.go` files colocated with source
- Integration tests: `/cmd/holos/tests/`
- Example platforms: `/internal/testutil/fixtures/`
- Run single test: `go test -run TestName ./path/to/package`
## Development Patterns
1. Error handling: Prefer `errors.Format()` from `/internal/errors/` over `fmt.Errorf()`
2. Logging: Use structured `slog`, get logger with `logger.FromContext(ctx)`
3. CLI commands: Follow Cobra patterns in `/internal/cli/`
4. CUE formatting: Always run `cue fmt` on CUE files
5. Go formatting: Always run `go fmt` on go files
6. Develop against v1alpha6 packages.
7. Commits: Use the package name as the first word in the commit, lower case. Commit without asking permission. Always run `make lint` and `make test` before committing.
## Version Management
- Version files: `/version/embedded/{major,minor,patch}`
- Bump version: `make bump`
- API versions: v1alpha5 (stable), v1alpha6 (development)
## Key Concepts
- **Platform**: Top-level configuration containing all components
- **Component**: Unit of configuration (DAG of Tasks producing deployment configs for one component)
- **TaskSet**: DAG of Tasks (Similar to how make tasks behave)
- **BuildPlan**: Instructions for building a component. Deprecated in v1alpha6, use TaskSet instead.
- **Generator**: Creates manifests (Helm, Kustomize, etc.) author schema only in v1alpha6
- **Transformer**: Modifies generated manifests, author schema only in v1alpha6
- **Validator**: Validates final manifests, author schema only in v1alpha6
## Resources
- Tutorials: `/doc/md/tutorial/`
- Platform templates: `/internal/generate/platforms/`
- Test fixtures: `/internal/testutil/fixtures/`
- Core schemas: `/api/core/` (Abstraction over low level data pipeline tasks)
- Author schemas: `/api/author/` (User facing abstractions over core Schemas)

View File

@@ -1,6 +1,6 @@
FROM registry.k8s.io/kubectl:v1.33.4 AS kubectl
FROM registry.k8s.io/kubectl:v1.31.0 AS kubectl
# https://github.com/GoogleContainerTools/distroless
FROM golang:1.24 AS build
FROM golang:1.23 AS build
WORKDIR /go/src/app
COPY . .
@@ -18,8 +18,8 @@ RUN curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/s
COPY --from=kubectl /bin/kubectl /usr/local/bin/
# Use debian slim instead of distroless to get package management.
FROM public.ecr.aws/docker/library/debian:13-slim AS final
# distroless
FROM gcr.io/distroless/static-debian12 AS final
COPY --from=build \
/go/bin/holos \
/go/bin/kustomize \
@@ -27,12 +27,5 @@ COPY --from=build \
/usr/local/bin/helm \
/bin/
# Extra packages
# git - https://github.com/holos-run/holos/issues/440
RUN apt update && \
apt install -y --no-install-recommends git ca-certificates && \
apt clean && \
rm -rf /var/lib/apt/lists/*
# Usage: docker run -v $(pwd):/app --workdir /app --rm -it quay.io/holos-run/holos holos render platform
CMD ["/bin/holos"]

View File

@@ -136,7 +136,6 @@ unity: ## https://cuelabs.dev/unity/
.PHONY: update-docs
update-docs: ## Update doc examples
HOLOS_UPDATE_SCRIPTS=1 go test -v ./doc/md/...
HOLOS_UPDATE_SCRIPTS=1 go test -v ./doc/website/versioned_docs/...
.PHONY: help
help: ## Display this help menu.

View File

@@ -274,8 +274,8 @@ type Chart struct {
// repository. Holos gets the username and password from the environment
// variables represented by the Auth field.
type Repository struct {
Name string `json:"name,omitempty" yaml:"name,omitempty"`
URL string `json:"url,omitempty" yaml:"url,omitempty"`
Name string `json:"name" yaml:"name"`
URL string `json:"url" yaml:"url"`
Auth Auth `json:"auth,omitempty" yaml:"auth,omitempty"`
}

View File

@@ -12,8 +12,7 @@ stderr -count=1 '^rendered platform'
# Holos uses CUE to build a platform specification.
exec holos show platform
cp stdout platform.yaml
exec holos compare yaml platform.yaml want/1.platform_spec.yaml
cmp stdout want/1.platform_spec.yaml
# Define the host and port in projects/blackbox.schema.cue
mv projects/blackbox.schema.cue.disabled projects/blackbox.schema.cue
@@ -26,7 +25,7 @@ mv platform/prometheus.cue.disabled platform/prometheus.cue
exec holos render platform
stderr -count=1 '^rendered prometheus'
stderr -count=1 '^rendered platform'
exec holos compare yaml deploy/components/prometheus/prometheus.gen.yaml want/1.prometheus.gen.yaml
cmp deploy/components/prometheus/prometheus.gen.yaml want/1.prometheus.gen.yaml
# Add the CUE configuration to manage the blackbox Helm Chart component.
mv projects/platform/components/blackbox/blackbox.cue.disabled projects/platform/components/blackbox/blackbox.cue
@@ -38,7 +37,7 @@ exec holos render platform ./platform
stderr -count=1 '^rendered prometheus'
stderr -count=1 '^rendered blackbox'
stderr -count=1 '^rendered platform'
exec holos compare yaml deploy/components/blackbox/blackbox.gen.yaml want/1.blackbox.gen.yaml
cmp deploy/components/blackbox/blackbox.gen.yaml want/1.blackbox.gen.yaml
# Import helm values
exec cue import --package holos --path 'Helm: Values:' --outfile projects/platform/components/prometheus/values.cue projects/platform/components/prometheus/vendor/25.27.0/prometheus/values.yaml
@@ -56,7 +55,7 @@ mv platform/httpbin.cue.disabled platform/httpbin.cue
# Render the platform with httpbin
exec holos render platform ./platform
stderr -count=1 '^rendered httpbin'
exec holos compare yaml deploy/components/httpbin/httpbin.gen.yaml want/1.httpbin.gen.yaml
cmp deploy/components/httpbin/httpbin.gen.yaml want/1.httpbin.gen.yaml
# Verify the labels are correct
grep 'replacement: blackbox:9115' deploy/components/prometheus/prometheus.gen.yaml

View File

@@ -3,8 +3,7 @@
exec holos init platform v1alpha5 --force
# want a buildplan shown
exec holos show buildplans
cp stdout buildplan-output.yaml
exec holos compare yaml buildplan-output.yaml buildplan.yaml
cmp stdout buildplan.yaml
# want this error to go away
! stderr 'cannot convert non-concrete value string'
-- platform/example.cue --

View File

@@ -4,12 +4,10 @@ env HOME=$WORK
exec holos init platform v1alpha5 --force
exec holos show platform
cp stdout empty.yaml
exec holos compare yaml empty.yaml want/empty.yaml
cmp stdout want/empty.yaml
exec holos show platform -t foo
cp stdout foo.yaml
exec holos compare yaml foo.yaml want/foo.yaml
cmp stdout want/foo.yaml
-- platform/empty.cue --
@if(foo)

View File

@@ -1,5 +1,4 @@
# https://github.com/holos-run/holos/issues/330
# take care to install helm 3.17.3 otherwise kube versions may not align
exec holos init platform v1alpha5 --force
# Make sure the helm chart works with plain helm
exec helm template ./components/capabilities/vendor/0.1.0/capabilities
@@ -7,13 +6,13 @@ stdout 'name: has-foo-v1beta1'
stdout 'kubeVersion: v'
exec holos render platform ./platform
# When no capabilities are specified
exec holos compare yaml deploy/components/capabilities/capabilities.gen.yaml want/when-no-capabilities-specified.yaml
cmp deploy/components/capabilities/capabilities.gen.yaml want/when-no-capabilities-specified.yaml
# With APIVersions specified
exec holos compare yaml deploy/components/specified/specified.gen.yaml want/with-capabilities-specified.yaml
cmp deploy/components/specified/specified.gen.yaml want/with-capabilities-specified.yaml
# With KubeVersion specified
exec holos compare yaml deploy/components/kubeversion1/kubeversion1.gen.yaml want/with-kubeversion-specified.yaml
cmp deploy/components/kubeversion1/kubeversion1.gen.yaml want/with-kubeversion-specified.yaml
# With both APIVersions and KubeVersion specified
exec holos compare yaml deploy/components/kubeversion2/kubeversion2.gen.yaml want/with-both-specified.yaml
cmp deploy/components/kubeversion2/kubeversion2.gen.yaml want/with-both-specified.yaml
-- want/with-both-specified.yaml --
apiVersion: v1
kind: Service
@@ -45,7 +44,7 @@ apiVersion: v1
kind: Service
metadata:
annotations:
kubeVersion: v1.99.0
kubeVersion: v1.31.0
name: has-foo-v1beta1
spec:
ports:
@@ -58,7 +57,7 @@ apiVersion: v1
kind: Service
metadata:
annotations:
kubeVersion: v1.99.0
kubeVersion: v1.31.0
name: has-foo-v1
spec:
ports:
@@ -104,7 +103,7 @@ Component: #Helm & {
Chart: version: "0.1.0"
_APIVersions: string | *"[]" @tag(apiVersions, type=string)
APIVersions: json.Unmarshal(_APIVersions)
KubeVersion: string | *"v1.99.0" @tag(kubeVersion, type=string)
KubeVersion: string | *"v1.31.0" @tag(kubeVersion, type=string)
}
-- components/capabilities/vendor/0.1.0/capabilities/Chart.yaml --
apiVersion: v2
@@ -138,7 +137,7 @@ kind: Service
metadata:
name: has-foo-v1beta1
annotations:
kubeVersion: v1.99.0
kubeVersion: v1.31.0
spec:
ports:
- port: 80

View File

@@ -12,8 +12,7 @@ stderr -count=1 '^rendered platform'
# When author.#Kubernetes is empty
exec holos cue export --expression holos --out=yaml ./components/empty
cp stdout empty.yaml
exec holos compare yaml empty.yaml want.txt
cmp stdout want.txt
-- components/empty/empty.cue --
package holos

View File

@@ -4,4 +4,4 @@ cmp stdout $WORK/output.txt
-- command.sh --
holos --version
-- output.txt --
0.106.0
0.104.1

View File

@@ -1 +1 @@
0.105.1
0.104.1

View File

@@ -1,2 +1,3 @@
rendered podinfo in 169.504ms
rendered platform in 169.609583ms
cached podinfo 6.6.2
rendered podinfo in 1.938665041s
rendered platform in 1.938759417s

View File

@@ -9,8 +9,9 @@
|-- platform
| |-- platform.gen.cue
| `-- podinfo.cue
|-- platform.metadata.json
|-- resources.cue
|-- schema.cue
`-- tags.cue
8 directories, 6 files
8 directories, 7 files

View File

@@ -4,4 +4,4 @@ cmp stdout $WORK/output.txt
-- command.sh --
holos --version
-- output.txt --
0.106.0
0.104.1

View File

@@ -1 +1 @@
0.105.1
0.104.1

View File

@@ -1,3 +1,3 @@
[main 67f5363] add blackbox configuration
[main 1adcd08] add blackbox configuration
1 file changed, 15 insertions(+)
create mode 100644 config/prometheus/blackbox.cue
create mode 100644 components/blackbox.cue

View File

@@ -1,3 +1,2 @@
[main bef876c] integrate blackbox and prometheus together
3 files changed, 1359 insertions(+), 2 deletions(-)
create mode 100644 components/prometheus/values.cue.orig
[main 4221803] integrate blackbox and prometheus together
2 files changed, 4 insertions(+), 2 deletions(-)

View File

@@ -1,4 +1,4 @@
[main 9dd00f3] import values
2 files changed, 1826 insertions(+)
[main 52e90ea] import values
2 files changed, 1815 insertions(+)
create mode 100644 components/blackbox/values.cue
create mode 100644 components/prometheus/values.cue

View File

@@ -1,3 +1,3 @@
rendered blackbox in 112.795875ms
rendered prometheus in 144.441042ms
rendered platform in 144.505625ms
rendered blackbox in 365.936792ms
rendered prometheus in 371.855875ms
rendered platform in 372.109916ms

View File

@@ -1,4 +1,4 @@
[main c523ef0] add blackbox and prometheus
[main b5df111] add blackbox and prometheus
5 files changed, 1550 insertions(+)
create mode 100644 components/blackbox/blackbox.cue
create mode 100644 components/prometheus/prometheus.cue

View File

@@ -1,3 +1,5 @@
rendered blackbox in 877.548833ms
rendered prometheus in 882.902333ms
rendered platform in 883.561541ms
cached prometheus-blackbox-exporter 9.0.1
rendered blackbox in 3.825430417s
cached prometheus 25.27.0
rendered prometheus in 4.840089667s
rendered platform in 4.840137792s

View File

@@ -1,2 +1,2 @@
[main 3aa63f4] render integrated blackbox and prometheus manifests
[main 67efe0d] render integrated blackbox and prometheus manifests
2 files changed, 7 insertions(+), 7 deletions(-)

View File

@@ -4,4 +4,4 @@ cmp stdout $WORK/output.txt
-- command.sh --
holos --version
-- output.txt --
0.106.0
0.104.1

View File

@@ -1 +1 @@
0.105.1
0.104.1

View File

@@ -27,9 +27,9 @@ spec:
- includeSelectors: false
pairs:
app.kubernetes.io/name: httpbin
patches: []
images:
- name: mccutchen/go-httpbin
patches: []
resources:
- resources.gen.yaml
- httpbin.yaml

View File

@@ -1,4 +1,4 @@
[main 2fc33ea] add httpbin
[main 823e136] add httpbin
4 files changed, 113 insertions(+)
create mode 100644 components/httpbin/httpbin.cue
create mode 100644 components/httpbin/httpbin.yaml

View File

@@ -1,3 +1,3 @@
[main 6d5bbc3] annotate httpbin for prometheus probes
[main 96f5f45] annotate httpbin for prometheus probes
2 files changed, 18 insertions(+)
create mode 100644 components/httpbin/patches.cue

View File

@@ -1,2 +1,2 @@
rendered httpbin in 82.637042ms
rendered platform in 82.702458ms
rendered httpbin in 112.916375ms
rendered platform in 112.990333ms

View File

@@ -1,2 +1,2 @@
rendered httpbin in 80.916166ms
rendered platform in 80.992958ms
rendered httpbin in 111.183042ms
rendered platform in 111.265792ms

View File

@@ -84,14 +84,10 @@ Install these tools to use Holos's full capabilities:
- [Kubectl] for [kustomize] operations
:::note
Holos is tested with Helm `v3.17.3`. If you see `Error: chart requires
Holos is tested with Helm `v3.16.2`. If you see `Error: chart requires
kubeVersion` errors, try upgrading Helm.
:::
## Known Issues
Helm `v3.18.0` has a [known issue](https://github.com/NixOS/nixpkgs/pull/322994) that causes it to produce incorrect output. This may affect Holos users. For more details, see [Holos issue #433](https://github.com/holos-run/holos/issues/433).
## Next Steps
With your platform structure initialized, proceed to [Hello Holos] to learn Helm

View File

@@ -1,391 +0,0 @@
# v1alpha6 Build Plan Executor
This document outlines the plan to finalize the v1alpha6 build plan executor for `holos render platform`. The goal is to use the compiler pool to produce a complete set of BuildPlans, then combine them into a topologically sorted DAG for efficient concurrent execution.
## Related Issues
- [#435 v1alpha6 Design](https://github.com/holos-run/holos/issues/435)
- [#389 Concurrent Component Compiler](https://github.com/holos-run/holos/issues/389)
- [#452 Fix concurrent helm invocations](https://github.com/holos-run/holos/issues/452)
## Current State Analysis
### What's Implemented
1. **Compiler Pool** (`internal/compile/compile.go`):
- `compile.Compile()` function spawns a pool of `holos compile` subprocesses
- Producer-consumer pattern with task queue using channels
- Each worker maintains a persistent subprocess with stdin/stdout pipes
- JSON streaming protocol for BuildPlanRequest/BuildPlanResponse
2. **`holos show buildplans`** (`internal/cli/show.go`):
- Uses `compile.Compile()` to produce BuildPlans concurrently
- Displays BuildPlans without executing them
- Validates the compiler pool works correctly
3. **`holos render platform`** (`internal/cli/render/render.go`):
- Spawns individual `holos render component` subprocesses
- Each subprocess independently compiles AND executes its BuildPlan
- Does NOT use the compiler pool
4. **BuildPlan Execution** (`internal/component/v1alpha6/v1alpha6.go`):
- `BuildPlan.Build()` processes artifacts concurrently
- Within each artifact: generators run concurrently, transformers sequentially, validators concurrently
- Worker pool for task execution within a single BuildPlan
### What's Missing
1. **Compiler Pool in `holos render platform`**: The render command still spawns individual subprocesses instead of using the compiler pool.
2. **Unified DAG Execution**: BuildPlans execute independently. No cross-BuildPlan task deduplication or optimization.
3. **Helm Chart Deduplication**: Each component fetches Helm charts independently. Multiple components using the same chart/version fetch redundantly.
4. **Topological Sort**: No dependency analysis or task ordering across BuildPlans.
## Architecture Design
### Phase 1: Compile All BuildPlans
Use the existing compiler pool to compile all BuildPlans before executing any.
```
holos render platform
├─> Platform.Build()
│ └─> Collect all Components
├─> compile.Compile(ctx, concurrency, requests)
│ ├─> Producer: sends BuildPlanRequest per component
│ ├─> N Workers: each runs holos compile subprocess
│ └─> Returns: []BuildPlanResponse with all BuildPlans
└─> Phase 2: Execute BuildPlans
```
### Phase 2: Build Unified Task DAG
Transform all BuildPlans into a single DAG of executable tasks.
```go
// Task represents a single executable unit of work
type Task struct {
ID string // Unique identifier
Kind string // helm-fetch, generator, transformer, validator, write-artifact
BuildPlan string // Which BuildPlan this task belongs to
Artifact string // Which Artifact within the BuildPlan
Inputs []string // Task IDs this depends on
Outputs []string // Output keys this produces
Run func(ctx) error // Execution function
}
// TaskDAG represents the complete dependency graph
type TaskDAG struct {
Tasks map[string]*Task // All tasks by ID
Adjacency map[string][]string // task -> tasks that depend on it
InDegree map[string]int // task -> number of dependencies
}
```
#### Task Types
1. **helm-fetch**: Download a Helm chart to local cache
- Key: `helm-fetch:{repo}:{chart}:{version}`
- Deduplicated across all BuildPlans
2. **generator**: Execute a Generator (Resources, Helm template, File, Command)
- Key: `{buildplan}:{artifact}:gen:{output}`
- helm-fetch tasks depend on generators that use Helm
3. **transformer**: Execute a Transformer (Kustomize, Join, Command)
- Key: `{buildplan}:{artifact}:transform:{output}`
- Sequential within artifact, depends on generators or prior transformers
4. **validator**: Execute a Validator (Command)
- Key: `{buildplan}:{artifact}:validate:{idx}`
- Depends on final transformer output
5. **write-artifact**: Write artifact to filesystem
- Key: `{buildplan}:{artifact}:write`
- Depends on validators completing
### Phase 3: Topological Sort and Execution
Execute tasks using Kahn's algorithm for topological ordering with concurrent execution.
```go
func ExecuteDAG(ctx context.Context, dag *TaskDAG, workers int) error {
g, ctx := errgroup.WithContext(ctx)
ready := make(chan *Task, len(dag.Tasks))
completed := make(chan string, len(dag.Tasks))
// Initialize with tasks that have no dependencies
for id, task := range dag.Tasks {
if dag.InDegree[id] == 0 {
ready <- task
}
}
// Coordinator goroutine
g.Go(func() error {
remaining := len(dag.Tasks)
for remaining > 0 {
select {
case <-ctx.Done():
return ctx.Err()
case id := <-completed:
remaining--
// Decrement in-degree of dependent tasks
for _, depID := range dag.Adjacency[id] {
dag.InDegree[depID]--
if dag.InDegree[depID] == 0 {
ready <- dag.Tasks[depID]
}
}
}
}
close(ready)
return nil
})
// Worker goroutines
for i := 0; i < workers; i++ {
g.Go(func() error {
for task := range ready {
if err := task.Run(ctx); err != nil {
return err
}
completed <- task.ID
}
return nil
})
}
return g.Wait()
}
```
### Helm Chart Deduplication
Extract all Helm chart references, deduplicate, and create fetch tasks.
```go
type ChartKey struct {
Repository string
Name string
Version string
}
func ExtractHelmCharts(plans []BuildPlan) map[ChartKey][]TaskRef {
charts := make(map[ChartKey][]TaskRef)
for _, plan := range plans {
for _, artifact := range plan.Spec.Artifacts {
for _, gen := range artifact.Generators {
if gen.Kind == "Helm" {
key := ChartKey{
Repository: gen.Helm.Chart.Repository.URL,
Name: gen.Helm.Chart.Name,
Version: gen.Helm.Chart.Version,
}
charts[key] = append(charts[key], TaskRef{
BuildPlan: plan.Metadata.Name,
Artifact: artifact.Artifact,
Generator: gen.Output,
})
}
}
}
}
return charts
}
```
## Implementation Plan
### Step 1: Wire Compiler Pool to Render Platform
Modify `internal/cli/render/render.go` to:
1. Collect all components from the Platform
2. Build `[]BuildPlanRequest` for each component
3. Call `compile.Compile()` to get all BuildPlans
4. Execute BuildPlans (initially using existing per-BuildPlan execution)
**Files to modify:**
- `internal/cli/render/render.go`
**Validation:**
- `holos render platform` produces identical output to before
- Compilation is faster due to concurrent pool
### Step 2: Create Task DAG Package
Create new package `internal/dag/` with:
1. Task and TaskDAG types
2. DAG construction from BuildPlans
3. Topological sort execution
4. Shared artifact store across BuildPlans
**Files to create:**
- `internal/dag/dag.go` - Core types and construction
- `internal/dag/execute.go` - DAG execution with worker pool
- `internal/dag/dag_test.go` - Unit tests
### Step 3: Implement Helm Chart Deduplication
1. Extract all Helm chart references before execution
2. Create single fetch task per unique chart
3. Helm generator tasks depend on corresponding fetch task
4. Use file system locking for concurrent safety
**Files to modify:**
- `internal/dag/dag.go` - Add chart extraction and fetch task creation
- `internal/component/v1alpha6/v1alpha6.go` - Refactor helm fetch logic
### Step 4: Integrate DAG Execution into Render Platform
Replace per-BuildPlan execution with unified DAG execution.
**Files to modify:**
- `internal/cli/render/render.go`
- `internal/platform/platform.go`
### Step 5: Update Build Plan Execution to Use Shared Store
Modify BuildPlan execution to:
1. Accept a shared artifact store
2. Support external Helm chart cache
3. Report task completion to coordinator
**Files to modify:**
- `internal/component/v1alpha6/v1alpha6.go`
- `internal/artifact/artifact.go`
## Testing Strategy
### Unit Tests
1. DAG construction from BuildPlans
2. Topological sort correctness
3. Cycle detection
4. Helm chart deduplication
### Integration Tests
1. Render platform with multiple components sharing Helm charts
2. Verify deduplication reduces Helm fetches
3. Verify output matches non-DAG execution
4. Use `holos compare buildplans` to validate equivalence
### Performance Tests
1. Measure compilation time improvement
2. Measure execution time with chart deduplication
3. Benchmark with varying concurrency levels
## Migration Path
1. **v0.106.0**: Wire compiler pool to render platform (Step 1)
2. **v0.107.0**: Introduce DAG package, optional via flag (Steps 2-3)
3. **v0.108.0**: Make DAG execution default, deprecate old path (Steps 4-5)
## Future Considerations
### TaskSet Schema (v1alpha6 Design Goal)
The DAG implementation provides a foundation for the TaskSet schema:
```cue
TaskSet: {
tasks: [string]: Task
}
Task: {
kind: "HelmFetch" | "Generator" | "Transformer" | "Validator" | "Write"
inputs: [...string] // Task IDs
outputs: [...string] // Output keys
// Kind-specific fields
}
```
### Cross-Component Dependencies
Future enhancement to support:
```cue
Component: {
dependsOn: [...string] // Other component names
}
```
### Caching
Consider caching:
1. Compiled BuildPlans (CUE evaluation cache)
2. Generator outputs (content-addressed)
3. Transformer outputs (input-hash based)
## Appendix: Current Code Flow
### `holos show buildplans` (Uses Compiler Pool)
```
show.go:84 showBuildPlans.Run()
├─> p.Select() - Get components matching selectors
├─> Build []BuildPlanRequest from components
├─> compile.Compile(ctx, concurrency, reqs)
│ compile.go:155
│ ├─> Producer goroutine sends requests to channel
│ ├─> N Consumer goroutines run holos compile
│ └─> Returns []BuildPlanResponse
└─> Encode and output BuildPlans
```
### `holos render platform` (Current: Per-Component Subprocess)
```
render.go:49 renderPlatform.Run()
├─> platform.Platform.Build()
│ platform.go
│ └─> For each component (concurrent, limited):
│ └─> PerComponentFunc()
└─> PerComponentFunc() spawns subprocess:
holos render component [path]
└─> component.go
├─> Compile CUE to BuildPlan
└─> BuildPlan.Build() - Execute artifact pipeline
```
### Proposed: `holos render platform` (With Compiler Pool + DAG)
```
render.go renderPlatform.Run()
├─> Collect all components from Platform
├─> compile.Compile(ctx, concurrency, reqs)
│ └─> Returns []BuildPlanResponse
├─> dag.Build(buildPlans)
│ ├─> Extract and deduplicate Helm charts
│ ├─> Create fetch tasks
│ ├─> Create generator tasks (depend on fetch)
│ ├─> Create transformer tasks (depend on generators)
│ ├─> Create validator tasks (depend on transformers)
│ └─> Create write tasks (depend on validators)
└─> dag.Execute(ctx, workers)
├─> Topological sort execution
├─> Fixed worker pool with errgroup
└─> Write artifacts to filesystem
```

View File

@@ -4,4 +4,4 @@ cmp stdout $WORK/output.txt
-- command.sh --
holos --version
-- output.txt --
0.106.0
0.104.1

View File

@@ -1,2 +1,3 @@
rendered podinfo in 290.020792ms
rendered platform in 290.155667ms
cached podinfo 6.6.2
rendered podinfo in 1.938665041s
rendered platform in 1.938759417s

View File

@@ -9,8 +9,9 @@
|-- platform
| |-- platform.gen.cue
| `-- podinfo.cue
|-- platform.metadata.json
|-- resources.cue
|-- schema.cue
`-- tags.cue
8 directories, 6 files
8 directories, 7 files

View File

@@ -4,4 +4,4 @@ cmp stdout $WORK/output.txt
-- command.sh --
holos --version
-- output.txt --
0.106.0
0.104.1

View File

@@ -1,3 +1,3 @@
[main fd30368] add blackbox configuration
[main 1adcd08] add blackbox configuration
1 file changed, 15 insertions(+)
create mode 100644 config/prometheus/blackbox.cue
create mode 100644 components/blackbox.cue

View File

@@ -1,3 +1,2 @@
[main e9a22bd] integrate blackbox and prometheus together
3 files changed, 1359 insertions(+), 2 deletions(-)
create mode 100644 components/prometheus/values.cue.orig
[main 4221803] integrate blackbox and prometheus together
2 files changed, 4 insertions(+), 2 deletions(-)

View File

@@ -1,4 +1,4 @@
[main dbaf504] import values
2 files changed, 1826 insertions(+)
[main 52e90ea] import values
2 files changed, 1815 insertions(+)
create mode 100644 components/blackbox/values.cue
create mode 100644 components/prometheus/values.cue

View File

@@ -1,3 +1,3 @@
rendered blackbox in 120.236ms
rendered prometheus in 147.333125ms
rendered platform in 147.385208ms
rendered blackbox in 365.936792ms
rendered prometheus in 371.855875ms
rendered platform in 372.109916ms

View File

@@ -1,4 +1,4 @@
[main c523ef0] add blackbox and prometheus
[main b5df111] add blackbox and prometheus
5 files changed, 1550 insertions(+)
create mode 100644 components/blackbox/blackbox.cue
create mode 100644 components/prometheus/prometheus.cue

View File

@@ -1,3 +1,5 @@
rendered blackbox in 1.023009333s
rendered prometheus in 1.1285565s
rendered platform in 1.128658458s
cached prometheus-blackbox-exporter 9.0.1
rendered blackbox in 3.825430417s
cached prometheus 25.27.0
rendered prometheus in 4.840089667s
rendered platform in 4.840137792s

View File

@@ -1,2 +1,2 @@
[main ed5ce22] render integrated blackbox and prometheus manifests
[main 67efe0d] render integrated blackbox and prometheus manifests
2 files changed, 7 insertions(+), 7 deletions(-)

View File

@@ -4,4 +4,4 @@ cmp stdout $WORK/output.txt
-- command.sh --
holos --version
-- output.txt --
0.106.0
0.104.1

View File

@@ -27,9 +27,9 @@ spec:
- includeSelectors: false
pairs:
app.kubernetes.io/name: httpbin
patches: []
images:
- name: mccutchen/go-httpbin
patches: []
resources:
- resources.gen.yaml
- httpbin.yaml

View File

@@ -1,4 +1,4 @@
[main bdb182b] add httpbin
[main 823e136] add httpbin
4 files changed, 113 insertions(+)
create mode 100644 components/httpbin/httpbin.cue
create mode 100644 components/httpbin/httpbin.yaml

View File

@@ -1,3 +1,3 @@
[main d557fa2] annotate httpbin for prometheus probes
[main 96f5f45] annotate httpbin for prometheus probes
2 files changed, 18 insertions(+)
create mode 100644 components/httpbin/patches.cue

View File

@@ -1,2 +1,2 @@
rendered httpbin in 79.923ms
rendered platform in 79.99475ms
rendered httpbin in 112.916375ms
rendered platform in 112.990333ms

View File

@@ -1,2 +1,2 @@
rendered httpbin in 81.503708ms
rendered platform in 81.573166ms
rendered httpbin in 111.183042ms
rendered platform in 111.265792ms

43
go.mod
View File

@@ -1,29 +1,28 @@
module github.com/holos-run/holos
go 1.24.0
go 1.23.0
toolchain go1.23.6
require (
cuelang.org/go v0.15.1
github.com/google/go-cmp v0.7.0
cuelang.org/go v0.13.0-alpha.4
github.com/mattn/go-isatty v0.0.20
github.com/mattn/go-runewidth v0.0.15
github.com/olekukonko/tablewriter v0.0.5
github.com/patrickdappollonio/kubectl-slice v1.4.2
github.com/princjef/gomarkdoc v1.1.0
github.com/rogpeppe/go-internal v1.14.1
github.com/spf13/cobra v1.10.1
github.com/spf13/pflag v1.0.10
github.com/spf13/viper v1.19.0
github.com/spf13/cobra v1.9.1
github.com/spf13/pflag v1.0.6
github.com/stretchr/testify v1.10.0
golang.org/x/sync v0.17.0
golang.org/x/tools v0.38.0
golang.org/x/sync v0.13.0
golang.org/x/tools v0.32.0
gopkg.in/yaml.v3 v3.0.1
helm.sh/helm/v3 v3.16.3
sigs.k8s.io/kustomize/kustomize/v5 v5.5.0
)
require (
cuelabs.dev/go/oci/ociregistry v0.0.0-20250722084951-074d06050084 // indirect
cuelabs.dev/go/oci/ociregistry v0.0.0-20250304105642-27e071d2c9b1 // indirect
dario.cat/mergo v1.0.1 // indirect
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
@@ -58,7 +57,7 @@ require (
github.com/docker/go-connections v0.5.0 // indirect
github.com/docker/go-metrics v0.0.1 // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/emicklei/proto v1.14.2 // indirect
github.com/emicklei/proto v1.14.0 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/evanphx/json-patch v5.9.0+incompatible // indirect
github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d // indirect
@@ -82,6 +81,7 @@ require (
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/btree v1.0.1 // indirect
github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 // indirect
github.com/google/go-cmp v0.7.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/pprof v0.0.0-20240622144329-c177fd99eaa9 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
@@ -110,7 +110,6 @@ require (
github.com/magiconair/properties v1.8.7 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mb0/glob v0.0.0-20160210091149-1eb79d2de6c4 // indirect
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
github.com/miekg/dns v1.1.58 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
@@ -141,7 +140,7 @@ require (
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.55.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/protocolbuffers/txtpbfmt v0.0.0-20251016062345-16587c79cd91 // indirect
github.com/protocolbuffers/txtpbfmt v0.0.0-20250129171521-feedd8250727 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/rubenv/sql-migrate v1.7.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
@@ -154,8 +153,9 @@ require (
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.7.0 // indirect
github.com/spf13/viper v1.18.2 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/tetratelabs/wazero v1.9.0 // indirect
github.com/tetratelabs/wazero v1.6.0 // indirect
github.com/x-cray/logrus-prefixed-formatter v0.5.2 // indirect
github.com/x448/float16 v0.8.4 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
@@ -168,15 +168,14 @@ require (
go.opentelemetry.io/otel/metric v1.28.0 // indirect
go.opentelemetry.io/otel/trace v1.28.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/crypto v0.43.0 // indirect
golang.org/x/crypto v0.37.0 // indirect
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
golang.org/x/mod v0.29.0 // indirect
golang.org/x/net v0.46.0 // indirect
golang.org/x/oauth2 v0.32.0 // indirect
golang.org/x/sys v0.37.0 // indirect
golang.org/x/term v0.36.0 // indirect
golang.org/x/text v0.30.0 // indirect
golang.org/x/mod v0.24.0 // indirect
golang.org/x/net v0.39.0 // indirect
golang.org/x/oauth2 v0.29.0 // indirect
golang.org/x/sys v0.32.0 // indirect
golang.org/x/term v0.31.0 // indirect
golang.org/x/text v0.24.0 // indirect
golang.org/x/time v0.5.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect
google.golang.org/grpc v1.65.0 // indirect

75
go.sum
View File

@@ -1,7 +1,7 @@
cuelabs.dev/go/oci/ociregistry v0.0.0-20250722084951-074d06050084 h1:4k1yAtPvZJZQTu8DRY8muBo0LHv6TqtrE0AO5n6IPYs=
cuelabs.dev/go/oci/ociregistry v0.0.0-20250722084951-074d06050084/go.mod h1:4WWeZNxUO1vRoZWAHIG0KZOd6dA25ypyWuwD3ti0Tdc=
cuelang.org/go v0.15.1 h1:MRnjc/KJE+K42rnJ3a+425f1jqXeOOgq9SK4tYRTtWw=
cuelang.org/go v0.15.1/go.mod h1:NYw6n4akZcTjA7QQwJ1/gqWrrhsN4aZwhcAL0jv9rZE=
cuelabs.dev/go/oci/ociregistry v0.0.0-20250304105642-27e071d2c9b1 h1:Dmbd5Q+ENb2C6carvwrMsrOUwJ9X9qfL5JdW32gYAHo=
cuelabs.dev/go/oci/ociregistry v0.0.0-20250304105642-27e071d2c9b1/go.mod h1:dqrnoZx62xbOZr11giMPrWbhlaV8euHwciXZEy3baT8=
cuelang.org/go v0.13.0-alpha.4 h1:tmMJdmPCh6Y1vCPbvlsrG/g4Un3AnLajTScNDhLGMwU=
cuelang.org/go v0.13.0-alpha.4/go.mod h1:kA/8D9/d32IBp2lISWo90BEJhLyS9tqBcvqw2QAEhEg=
dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s=
dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
@@ -115,8 +115,8 @@ github.com/elazarl/goproxy v1.2.1 h1:njjgvO6cRG9rIqN2ebkqy6cQz2Njkx7Fsfv/zIZqgug
github.com/elazarl/goproxy v1.2.1/go.mod h1:YfEbZtqP4AetfO6d40vWchF3znWX7C7Vd6ZMfdL8z64=
github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g=
github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
github.com/emicklei/proto v1.14.2 h1:wJPxPy2Xifja9cEMrcA/g08art5+7CGJNFNk35iXC1I=
github.com/emicklei/proto v1.14.2/go.mod h1:rn1FgRS/FANiZdD2djyH7TMA9jdRDcYQ9IEN9yvjX0A=
github.com/emicklei/proto v1.14.0 h1:WYxC0OrBuuC+FUCTZvb8+fzEHdZMwLEF+OnVfZA3LXU=
github.com/emicklei/proto v1.14.0/go.mod h1:rn1FgRS/FANiZdD2djyH7TMA9jdRDcYQ9IEN9yvjX0A=
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=
github.com/evanphx/json-patch v5.9.0+incompatible h1:fBXyNpNMuTTDdquAq/uisOr2lShz4oaXpDTX2bLe7ls=
@@ -308,8 +308,6 @@ github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh
github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU=
github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/mb0/glob v0.0.0-20160210091149-1eb79d2de6c4 h1:NK3O7S5FRD/wj7ORQ5C3Mx1STpyEMuFe+/F0Lakd1Nk=
github.com/mb0/glob v0.0.0-20160210091149-1eb79d2de6c4/go.mod h1:FqD3ES5hx6zpzDainDaHgkTIqrPaI9uX4CVWqYZoQjY=
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d h1:5PJl274Y63IEHC+7izoQE9x6ikvDFZS2mDVS3drnohI=
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE=
github.com/miekg/dns v1.1.58 h1:ca2Hdkz+cDg/7eNF6V56jjzuZ4aCAE+DbVkILdQWG/4=
@@ -366,8 +364,6 @@ github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
github.com/opencontainers/image-spec v1.1.1 h1:y0fUlFfIZhPF1W537XOLg0/fcx6zcHCJwooC2xJA040=
github.com/opencontainers/image-spec v1.1.1/go.mod h1:qpqAh3Dmcf36wStyyWU+kCeDgrGnAve2nCC8+7h8Q0M=
github.com/patrickdappollonio/kubectl-slice v1.4.2 h1:U1Jrma4BRK9D1Mbly8oP6uA06/gmOif6KjVQFrPUBzI=
github.com/patrickdappollonio/kubectl-slice v1.4.2/go.mod h1:gt3IidcTPeCcazqcMuXF51VWU5mGsQv6YlNpXxQvPsE=
github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4=
github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=
github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI=
@@ -408,8 +404,8 @@ github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsT
github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ=
github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
github.com/protocolbuffers/txtpbfmt v0.0.0-20251016062345-16587c79cd91 h1:s1LvMaU6mVwoFtbxv/rCZKE7/fwDmDY684FfUe4c1Io=
github.com/protocolbuffers/txtpbfmt v0.0.0-20251016062345-16587c79cd91/go.mod h1:JSbkp0BviKovYYt9XunS95M3mLPibE9bGg+Y95DsEEY=
github.com/protocolbuffers/txtpbfmt v0.0.0-20250129171521-feedd8250727 h1:A8EM8fVuYc0qbVMw9D6EiKdKTIm1SmLvAWcCc2mipGY=
github.com/protocolbuffers/txtpbfmt v0.0.0-20250129171521-feedd8250727/go.mod h1:VmWrOlMnBZNtToCWzRlZlIXcJqjo0hS5dwQbRD62gL8=
github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
@@ -441,13 +437,12 @@ github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8=
github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY=
github.com/spf13/cast v1.7.0 h1:ntdiHjuueXFgm5nzDRdOS4yfT43P5Fnud6DH50rz/7w=
github.com/spf13/cast v1.7.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo=
github.com/spf13/cobra v1.10.1 h1:lJeBwCfmrnXthfAupyUTzJ/J4Nc1RsHC/mSRU2dll/s=
github.com/spf13/cobra v1.10.1/go.mod h1:7SmJGaTHFVBY0jW4NXGluQoLvhqFQM+6XSKD+P4XaB0=
github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=
github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI=
github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+Ntkg=
github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo=
github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0=
github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o=
github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/viper v1.18.2 h1:LUXCnvUvSM6FXAsj6nnfc8Q2tp1dIgUfY9Kc8GsSOiQ=
github.com/spf13/viper v1.18.2/go.mod h1:EKmWIqdnk5lOcmR72yw6hS+8OPYcwD0jteitLMVB+yk=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
@@ -461,8 +456,8 @@ github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOf
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
github.com/tetratelabs/wazero v1.9.0 h1:IcZ56OuxrtaEz8UYNRHBrUa9bYeX9oVY93KspZZBf/I=
github.com/tetratelabs/wazero v1.9.0/go.mod h1:TSbcXCfFP0L2FGkRPxHphadXPjo1T6W+CseNNY7EkjM=
github.com/tetratelabs/wazero v1.6.0 h1:z0H1iikCdP8t+q341xqepY4EWvHEw8Es7tlqiVzlP3g=
github.com/tetratelabs/wazero v1.6.0/go.mod h1:0U0G41+ochRKoPKCJlh0jMg1CHkyfK8kDqiirMmKY8A=
github.com/x-cray/logrus-prefixed-formatter v0.5.2 h1:00txxvfBM9muc0jiLIEAkAcIMJzfthRT6usrui8uGmg=
github.com/x-cray/logrus-prefixed-formatter v0.5.2/go.mod h1:2duySbKsL6M18s5GU7VPsoEPHyzalCE06qoARUCeBBE=
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
@@ -500,21 +495,19 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=
go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.43.0 h1:dduJYIi3A3KOfdGOHX8AVZ/jGiyPa3IbBozJ5kNuE04=
golang.org/x/crypto v0.43.0/go.mod h1:BFbav4mRNlXJL4wNeejLpWxB7wMbc79PdRGhWKncxR0=
golang.org/x/crypto v0.37.0 h1:kJNSjF/Xp7kU0iB2Z+9viTPMW4EqqsrywMXLJOOsXSE=
golang.org/x/crypto v0.37.0/go.mod h1:vg+k43peMZ0pUMhYmVAWysMK35e6ioLh3wB8ZCAfbVc=
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8=
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.29.0 h1:HV8lRxZC4l2cr3Zq1LvtOsi/ThTgWnUk/y64QSs8GwA=
golang.org/x/mod v0.29.0/go.mod h1:NyhrlYXJ2H4eJiRy/WDBO6HMqZQ6q9nk4JzS3NuCK+w=
golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU=
golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
@@ -524,18 +517,18 @@ golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLL
golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.46.0 h1:giFlY12I07fugqwPuWJi68oOnpfqFnJIJzaIIm2JVV4=
golang.org/x/net v0.46.0/go.mod h1:Q9BGdFy1y4nkUwiLvT5qtyhAnEHgnQ/zd8PfU6nc210=
golang.org/x/oauth2 v0.32.0 h1:jsCblLleRMDrxMN29H3z/k1KliIvpLgCkE6R8FXXNgY=
golang.org/x/oauth2 v0.32.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA=
golang.org/x/net v0.39.0 h1:ZCu7HMWDxpXpaiKdhzIfaltL9Lp31x/3fCP11bc6/fY=
golang.org/x/net v0.39.0/go.mod h1:X7NRbYVEA+ewNkCNyJ513WmMdQ3BineSwVtN2zD/d+E=
golang.org/x/oauth2 v0.29.0 h1:WdYw2tdTK1S8olAzWHdgeqfy+Mtm9XNhv/xJsY65d98=
golang.org/x/oauth2 v0.29.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.17.0 h1:l60nONMj9l5drqw6jlhIELNv9I0A4OFgRsG9k2oT9Ug=
golang.org/x/sync v0.17.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
golang.org/x/sync v0.13.0 h1:AauUjRAJ9OSnvULf/ARrrVywoJDy0YS2AwQ98I37610=
golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -565,16 +558,16 @@ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.37.0 h1:fdNQudmxPjkdUTPnLn5mdQv7Zwvbvpaxqs831goi9kQ=
golang.org/x/sys v0.37.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20=
golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.36.0 h1:zMPR+aF8gfksFprF/Nc/rd1wRS1EI6nDBGyWAvDzx2Q=
golang.org/x/term v0.36.0/go.mod h1:Qu394IJq6V6dCBRgwqshf3mPF85AqzYEzofzRdZkWss=
golang.org/x/term v0.31.0 h1:erwDkOK1Msy6offm1mOgvspSkslFnIGsFnxOKoufg3o=
golang.org/x/term v0.31.0/go.mod h1:R4BeIy7D95HzImkxGkTW1UQTtP54tio2RyHz7PwK0aw=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.30.0 h1:yznKA/E9zq54KzlzBEAWn1NXSQ8DIp/NYMy88xJjl4k=
golang.org/x/text v0.30.0/go.mod h1:yDdHFIX9t+tORqspjENWgzaCVXgk0yYnYuSZ8UzzBVM=
golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0=
golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU=
golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=
golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
@@ -582,8 +575,8 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.38.0 h1:Hx2Xv8hISq8Lm16jvBZ2VQf+RLmbd7wVUsALibYI/IQ=
golang.org/x/tools v0.38.0/go.mod h1:yEsQ/d/YK8cjh0L6rZlY8tgtlKiBNTL14pGDJPJpYQs=
golang.org/x/tools v0.32.0 h1:Q7N1vhpkQv7ybVzLFtTjvQya2ewbwNDZzUgfXGqtMWU=
golang.org/x/tools v0.32.0/go.mod h1:ZxrU41P/wAbZD8EDa6dDCa6XfpkhJ7HFMjHJXfBDu8s=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

View File

@@ -1,70 +0,0 @@
package cli
import (
"github.com/holos-run/holos/internal/compare"
"github.com/holos-run/holos/internal/errors"
"github.com/spf13/cobra"
)
// New for the compare command.
func NewCompareCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "compare",
Short: "Compare Holos resources",
Long: "Compare Holos resources to verify semantic equivalence",
Args: func(cmd *cobra.Command, args []string) error {
if len(args) > 0 {
return errors.Format("unknown command %q for %q", args[0], cmd.CommandPath())
}
return nil
},
RunE: func(cmd *cobra.Command, args []string) error {
return cmd.Help()
},
}
cmd.AddCommand(NewCompareBuildPlansCmd())
cmd.AddCommand(NewCompareYAMLCmd())
return cmd
}
// New for the compare buildplans subcommand.
func NewCompareBuildPlansCmd() *cobra.Command {
var backwardsCompatible bool
cmd := &cobra.Command{
Use: "buildplans [file1] [file2]",
Short: "Compare two BuildPlan files",
Long: "Compare two BuildPlan files to verify they are semantically equivalent",
Args: cobra.ExactArgs(2),
RunE: func(cmd *cobra.Command, args []string) error {
c := compare.New()
return c.BuildPlans(args[0], args[1], backwardsCompatible)
},
}
cmd.Flags().BoolVar(&backwardsCompatible, "backwards-compatible", false, "Enable backwards compatibility mode where file2 may have fields missing from file1")
return cmd
}
// New for the compare yaml subcommand.
func NewCompareYAMLCmd() *cobra.Command {
var backwardsCompatible bool
cmd := &cobra.Command{
Use: "yaml [file1] [file2]",
Short: "Compare two yaml object streams",
Long: "Compare two yaml object streams to verify they are structurally equivalent",
Args: cobra.ExactArgs(2),
RunE: func(cmd *cobra.Command, args []string) error {
c := compare.New()
// TODO(jeff): Add a YAML() function.
return c.BuildPlans(args[0], args[1], backwardsCompatible)
},
}
cmd.Flags().BoolVar(&backwardsCompatible, "backwards-compatible", false, "Enable backwards compatibility mode where file2 may have fields missing from file1")
return cmd
}

View File

@@ -61,8 +61,6 @@ func (r *renderPlatform) Run(ctx context.Context, p *platform.Platform) error {
args := make([]string, 0, 100)
args = append(args, prefixArgs...)
args = append(args, "render", "component")
// Add the write-to flag
args = append(args, "--write-to", r.pcfg.WriteTo)
// holos render platform --inject tags
for _, tag := range r.pcfg.TagMap.Tags() {
args = append(args, "--inject", tag)

View File

@@ -17,7 +17,6 @@ import (
"github.com/holos-run/holos/internal/cli/command"
"github.com/holos-run/holos/internal/cli/render"
"github.com/holos-run/holos/internal/cli/slice"
"github.com/holos-run/holos/internal/cli/txtar"
cueCmd "cuelang.org/go/cmd/cue/cmd"
@@ -77,15 +76,9 @@ func New(cfg *holos.Config) *cobra.Command {
// Show
rootCmd.AddCommand(NewShowCmd(platform.NewConfig()))
// Compare
rootCmd.AddCommand(NewCompareCmd())
// Compile
rootCmd.AddCommand(NewCompileCmd())
// Slice - https://github.com/patrickdappollonio/kubectl-slice
rootCmd.AddCommand(slice.NewKubectlSliceCmd())
return rootCmd
}
@@ -117,9 +110,9 @@ func HandleError(ctx context.Context, err error, hc *holos.Config) (exitCode int
if errors.As(err, &errAt) {
loc := errAt.Source.Loc()
err2 := errAt.Unwrap()
log.ErrorContext(ctx, fmt.Sprintf("error at %s: %s", loc, err2), "err", err2, "loc", loc)
log.ErrorContext(ctx, fmt.Sprintf("could not run: %s at %s", err2, loc), "err", err2, "loc", loc)
} else {
log.ErrorContext(ctx, err.Error(), "err", err)
log.ErrorContext(ctx, fmt.Sprintf("could not run: %s", err), "err", err)
}
// cue errors are bundled up as a list and refer to multiple files / lines.

View File

@@ -81,8 +81,7 @@ func TestShowAlpha6(t *testing.T) {
err = yaml.Unmarshal(wantBytes, &want)
require.NoError(t, err)
want.BuildContext.RootDir = tempDir
want.BuildContext.HolosExecutable, err = util.Executable()
require.NoError(t, err)
want.BuildContext.HolosExecutable = "holos"
want.BuildContext.LeafDir = "fixtures/v1alpha6/components/slice"
t.Run("FormatYAML", func(t *testing.T) {

View File

@@ -1,22 +0,0 @@
// MIT License
// Copyright (c) 2021 Patrick D'appollonio
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
package slice

View File

@@ -1,212 +0,0 @@
package slice
import (
"bytes"
"fmt"
"os"
"strings"
"github.com/patrickdappollonio/kubectl-slice/slice"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"github.com/spf13/viper"
)
var version = "development"
const (
helpShort = "kubectl-slice allows you to split a YAML into multiple subfiles using a pattern."
helpLong = `kubectl-slice allows you to split a YAML into multiple subfiles using a pattern.
For documentation, available functions, and more, visit: https://github.com/patrickdappollonio/kubectl-slice.`
)
var examples = []string{
"kubectl-slice -f foo.yaml -o ./ --include-kind Pod,Namespace",
"kubectl-slice -f foo.yaml -o ./ --exclude-kind Pod",
"kubectl-slice -f foo.yaml -o ./ --exclude-name *-svc",
"kubectl-slice -f foo.yaml --exclude-name *-svc --stdout",
"kubectl-slice -f foo.yaml --include Pod/* --stdout",
"kubectl-slice -f foo.yaml --exclude deployment/kube* --stdout",
"kubectl-slice -d ./ --recurse -o ./ --include-kind Pod,Namespace",
"kubectl-slice -d ./ --recurse --stdout --include Pod/*",
"kubectl-slice --config config.yaml",
}
func generateExamples([]string) string {
var s bytes.Buffer
for pos, v := range examples {
s.WriteString(fmt.Sprintf(" %s", v))
if pos != len(examples)-1 {
s.WriteString("\n")
}
}
return s.String()
}
func NewKubectlSliceCmd() *cobra.Command {
opts := slice.Options{}
var configFile string
rootCommand := &cobra.Command{
Use: "kubectl-slice",
Short: helpShort,
Long: helpLong,
Version: version,
SilenceUsage: true,
SilenceErrors: true,
Example: generateExamples(examples),
PreRunE: func(cmd *cobra.Command, args []string) error {
return bindCobraAndViper(cmd, configFile)
},
RunE: func(cmd *cobra.Command, args []string) error {
// Bind to the appropriate stdout/stderr
opts.Stdout = cmd.OutOrStdout()
opts.Stderr = cmd.ErrOrStderr()
// If no input file has been provided or it's "-", then
// point the app to stdin
if (opts.InputFile == "" || opts.InputFile == "-") && opts.InputFolder == "" {
opts.InputFile = os.Stdin.Name()
// Check if we're receiving data from the terminal
// or from piped content. Users from piped content
// won't see this message. Users that might have forgotten
// setting the flags correctly will see this message.
if !opts.Quiet {
if fi, err := os.Stdin.Stat(); err == nil && fi.Mode()&os.ModeNamedPipe == 0 {
fmt.Fprintln(opts.Stderr, "Receiving data from the terminal. Press CTRL+D when you're done typing or CTRL+C")
fmt.Fprintln(opts.Stderr, "to exit without processing the content. If you're seeing this by mistake, make")
fmt.Fprintln(opts.Stderr, "sure the command line flags, environment variables or config file are correct.")
}
}
}
// Create a new instance. This will also perform a basic validation.
instance, err := slice.New(opts)
if err != nil {
return fmt.Errorf("validation failed: %w", err)
}
return instance.Execute()
},
}
rootCommand.Flags().StringVarP(&opts.InputFile, "input-file", "f", "", "the input file used to read the initial macro YAML file; if empty or \"-\", stdin is used (exclusive with --input-folder)")
rootCommand.Flags().StringVarP(&opts.InputFolder, "input-folder", "d", "", "the input folder used to read the initial macro YAML files (exclusive with --input-file)")
rootCommand.Flags().StringSliceVar(&opts.InputFolderExt, "extensions", []string{".yaml", ".yml"}, "the extensions to look for in the input folder")
rootCommand.Flags().BoolVarP(&opts.Recurse, "recurse", "r", false, "if true, the input folder will be read recursively (has no effect unless used with --input-folder)")
rootCommand.Flags().StringVarP(&opts.OutputDirectory, "output-dir", "o", "", "the output directory used to output the splitted files")
rootCommand.Flags().StringVarP(&opts.GoTemplate, "template", "t", slice.DefaultTemplateName, "go template used to generate the file name when creating the resource files in the output directory")
rootCommand.Flags().BoolVar(&opts.DryRun, "dry-run", false, "if true, no files are created, but the potentially generated files will be printed as the command output")
rootCommand.Flags().BoolVar(&opts.DebugMode, "debug", false, "enable debug mode")
rootCommand.Flags().BoolVarP(&opts.Quiet, "quiet", "q", false, "if true, no output is written to stdout/err")
rootCommand.Flags().StringSliceVar(&opts.IncludedKinds, "include-kind", nil, "resource kind to include in the output (singular, case insensitive, glob supported)")
rootCommand.Flags().StringSliceVar(&opts.ExcludedKinds, "exclude-kind", nil, "resource kind to exclude in the output (singular, case insensitive, glob supported)")
rootCommand.Flags().StringSliceVar(&opts.IncludedNames, "include-name", nil, "resource name to include in the output (singular, case insensitive, glob supported)")
rootCommand.Flags().StringSliceVar(&opts.ExcludedNames, "exclude-name", nil, "resource name to exclude in the output (singular, case insensitive, glob supported)")
rootCommand.Flags().StringSliceVar(&opts.Included, "include", nil, "resource name to include in the output (format <kind>/<name>, case insensitive, glob supported)")
rootCommand.Flags().StringSliceVar(&opts.Excluded, "exclude", nil, "resource name to exclude in the output (format <kind>/<name>, case insensitive, glob supported)")
rootCommand.Flags().BoolVarP(&opts.StrictKubernetes, "skip-non-k8s", "s", false, "if enabled, any YAMLs that don't contain at least an \"apiVersion\", \"kind\" and \"metadata.name\" will be excluded from the split")
rootCommand.Flags().BoolVar(&opts.SortByKind, "sort-by-kind", false, "if enabled, resources are sorted by Kind, a la Helm, before saving them to disk")
rootCommand.Flags().BoolVar(&opts.OutputToStdout, "stdout", false, "if enabled, no resource is written to disk and all resources are printed to stdout instead")
rootCommand.Flags().StringVarP(&configFile, "config", "c", "", "path to the config file")
rootCommand.Flags().BoolVar(&opts.AllowEmptyKinds, "allow-empty-kinds", false, "if enabled, resources with empty kinds don't produce an error when filtering")
rootCommand.Flags().BoolVar(&opts.AllowEmptyNames, "allow-empty-names", false, "if enabled, resources with empty names don't produce an error when filtering")
rootCommand.Flags().BoolVar(&opts.IncludeTripleDash, "include-triple-dash", false, "if enabled, the typical \"---\" YAML separator is included at the beginning of resources sliced")
rootCommand.Flags().BoolVar(&opts.PruneOutputDir, "prune", false, "if enabled, the output directory will be pruned before writing the files")
rootCommand.Flags().BoolVar(&opts.RemoveFileComments, "remove-comments", false, "if enabled, comments generated by the app are removed from the sliced files (but keep comments from the original file)")
rootCommand.Flags().StringSliceVar(&opts.IncludedGroups, "include-group", nil, "resource kind to include in the output (singular, case insensitive, glob supported)")
rootCommand.Flags().StringSliceVar(&opts.ExcludedGroups, "exclude-group", nil, "resource kind to exclude in the output (singular, case insensitive, glob supported)")
_ = rootCommand.Flags().MarkHidden("debug")
return rootCommand
}
// envVarPrefix is the prefix used for environment variables.
// Using underscores to ensure compatibility with the shell.
const envVarPrefix = "KUBECTL_SLICE"
// skippedFlags is a list of flags that are not bound through
// Viper. These include things like "help", "version", and of
// course, "config", since it doesn't make sense to say where
// the config file is located in the config file itself.
var skippedFlags = [...]string{
"help",
"version",
"config",
}
// bindCobraAndViper binds the settings loaded by Viper
// to the flags defined in Cobra.
func bindCobraAndViper(cmd *cobra.Command, configFileLocation string) error {
v := viper.New()
// If a configuration file has been passed...
if cmd.Flags().Lookup("config").Changed {
// ... then set it as the configuration file
v.SetConfigFile(configFileLocation)
// then read the configuration file
if err := v.ReadInConfig(); err != nil {
return fmt.Errorf("failed to read configuration file: %w", err)
}
}
// Handler for potential error
var err error
// Recurse through all the variables
cmd.Flags().VisitAll(func(flag *pflag.Flag) {
// Skip the flags that are not bound through Viper
for _, v := range skippedFlags {
if v == flag.Name {
return
}
}
// Normalize key names with underscores instead of dashes
nameUnderscored := strings.ReplaceAll(flag.Name, "-", "_")
envVarName := strings.ToUpper(fmt.Sprintf("%s_%s", envVarPrefix, nameUnderscored))
// Bind the flag to the environment variable
if val, found := os.LookupEnv(envVarName); found {
v.Set(nameUnderscored, val)
}
// If the CLI flag hasn't been changed, but the value is set in
// the configuration file, then set the CLI flag to the value
// from the configuration file
if !flag.Changed && v.IsSet(nameUnderscored) {
// Type check for all the supported types
switch val := v.Get(nameUnderscored).(type) {
case string:
_ = cmd.Flags().Set(flag.Name, val)
case []interface{}:
var stringified []string
for _, v := range val {
stringified = append(stringified, fmt.Sprintf("%v", v))
}
_ = cmd.Flags().Set(flag.Name, strings.Join(stringified, ","))
case bool:
_ = cmd.Flags().Set(flag.Name, fmt.Sprintf("%t", val))
case int:
_ = cmd.Flags().Set(flag.Name, fmt.Sprintf("%d", val))
default:
err = fmt.Errorf("unsupported type %T for flag %q", val, nameUnderscored)
return
}
}
})
// If an error occurred, return it
return err
}

View File

@@ -1,401 +0,0 @@
package compare
import (
"bytes"
"io"
"os"
"sort"
"strings"
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/holos-run/holos/internal/errors"
"gopkg.in/yaml.v3"
)
// Comparer handles comparison operations between BuildPlans
type Comparer struct {
}
// New creates a new Comparer instance
func New() *Comparer {
return &Comparer{}
}
// BuildPlans compares two BuildPlan Files for semantic equivalence.
//
// The holos show buildplans command writes a BuildPlan File to standard output.
// A BuildPlan File is a yaml encoded stream of BuildPlan objects.
//
// BuildPlan File one is equivalent to two when:
// 1. one and two have an equal number of BuildPlan objects.
// 2. each object in one is equivalent to exactly one unique object in two.
//
// Two BuildPlans, before and after, are equivalent when:
//
// 1. All field values in before are equivalent to the same field in after
// 2. Both 1 and 2 apply to nested objects, recursively.
// 3. Field f is equivalent when before.f exactly equals after.f, except for:
// 3.1. Objects in the spec.artifacts list may appear in any arbitrary order.
// 3.2. The ordering of keys does not matter.
// 4. Backwards compatibility behavior (controlled by isBackwardsCompatible):
// - When false: after and before must have exactly the same fields
// - When true: after may have additional fields that don't exist in before
// (e.g., new features added in a newer version)
// Example:
// before has {name: "x", version: "1.0"}
// after has {name: "x", version: "1.0", newFeature: "enabled"}
// This comparison passes when isBackwardsCompatible=true
// 5. Fields in before must always be present in after (regardless of backwards
// compatibility mode).
// 6. List type fields with a null value are equivalent to:
// 6.1. null values
// 6.2. empty values ([])
// 6.2. a missing field
//
// A BuildPlan File is valid when:
// 1. Two or more identical objects exist in the same file. They must be
// treated as unique objects when comparing BuildPlan Files
// 2. Two objects may have the same value for the metadata.name field.
// 3. The kind field of all objects in the file stream is "BuildPlan"
func (c *Comparer) BuildPlans(one, two string, isBackwardsCompatible bool) error {
// Read both files
file1, err := os.Open(one)
if err != nil {
return errors.Format("opening first file: %w", err)
}
defer file1.Close()
file2, err := os.Open(two)
if err != nil {
return errors.Format("opening second file: %w", err)
}
defer file2.Close()
// Read all content from both files
content1, err := io.ReadAll(file1)
if err != nil {
return errors.Format("reading first file: %w", err)
}
content2, err := io.ReadAll(file2)
if err != nil {
return errors.Format("reading second file: %w", err)
}
// Handle empty files case
if len(content1) == 0 && len(content2) == 0 {
return errors.NotImplemented()
}
// Parse YAML streams (multiple documents)
docs1, err := parseYAMLStream(content1)
if err != nil {
return errors.Format("parsing first file: %w", err)
}
docs2, err := parseYAMLStream(content2)
if err != nil {
return errors.Format("parsing second file: %w", err)
}
// Compare the document lists
return c.compareDocumentLists(docs1, docs2, isBackwardsCompatible)
}
// normalizeStructure processes a structure to handle null, empty, and missing fields
// according to the BuildPlan spec requirement 6
func (c *Comparer) normalizeStructure(v interface{}) interface{} {
switch val := v.(type) {
case map[string]interface{}:
normalized := make(map[string]interface{})
for k, v := range val {
normalizedValue := c.normalizeStructure(v)
// Only add fields that are not nil or empty slices
if !c.isNullOrEmpty(normalizedValue) {
normalized[k] = normalizedValue
}
}
return normalized
case []interface{}:
// Handle empty slices as nil
if len(val) == 0 {
return nil
}
normalized := make([]interface{}, len(val))
for i, v := range val {
normalized[i] = c.normalizeStructure(v)
}
return normalized
default:
return v
}
}
// isNullOrEmpty checks if a value is nil or an empty slice
func (c *Comparer) isNullOrEmpty(v interface{}) bool {
if v == nil {
return true
}
if slice, ok := v.([]interface{}); ok {
return len(slice) == 0
}
return false
}
// filterToCommonFields filters v1 to only include fields that exist in v2
// This is used for backwards compatibility to allow the "after" file to have extra fields
// that don't exist in the "before" file
func (c *Comparer) filterToCommonFields(v1, v2 interface{}) interface{} {
switch m1 := v1.(type) {
case map[string]interface{}:
m2, ok := v2.(map[string]interface{})
if !ok {
return v1
}
filtered := make(map[string]interface{})
for k, val1 := range m1 {
if val2, exists := m2[k]; exists {
filtered[k] = c.filterToCommonFields(val1, val2)
}
}
return filtered
case []interface{}:
slice2, ok := v2.([]interface{})
if !ok {
return v1
}
var filtered []interface{}
for i, elem1 := range m1 {
if i < len(slice2) {
filtered = append(filtered, c.filterToCommonFields(elem1, slice2[i]))
}
}
return filtered
default:
return v1
}
}
// compareStructures compares two BuildPlan structures for semantic equivalence
func (c *Comparer) compareStructures(bp1, bp2 map[string]interface{}, isBackwardsCompatible bool) error {
// Normalize the structures to handle null, empty, and missing fields
norm1 := c.normalizeStructure(bp1).(map[string]interface{})
norm2 := c.normalizeStructure(bp2).(map[string]interface{})
// If backwards compatible, remove fields from norm2 that don't exist in norm1
// This allows "after" to have extra fields that "before" doesn't have
if isBackwardsCompatible {
filtered := c.filterToCommonFields(norm2, norm1)
if m, ok := filtered.(map[string]interface{}); ok {
norm2 = m
}
}
// Create comparison options for go-cmp
opts := []cmp.Option{
cmpopts.EquateEmpty(),
cmp.Transformer("sortSlices", func(s []interface{}) []interface{} {
return c.sortSlice(s)
}),
}
// Deep order-independent comparison
if cmp.Equal(norm1, norm2, opts...) {
return nil
}
// Get the diff for the error message
diff := cmp.Diff(norm1, norm2, opts...)
// Extract specific field differences from the diff
fieldDiffs := c.extractFieldDifferences(diff)
// Return the extracted differences or the full diff
if fieldDiffs != "" {
return errors.New(fieldDiffs)
}
return errors.New(diff)
}
// sortSlice sorts a slice based on comparable string representation
func (c *Comparer) sortSlice(slice []interface{}) []interface{} {
sorted := make([]interface{}, len(slice))
copy(sorted, slice)
sort.Slice(sorted, func(i, j int) bool {
iStr := c.toComparableString(sorted[i])
jStr := c.toComparableString(sorted[j])
return iStr < jStr
})
return sorted
}
// toComparableString converts a value to a comparable string
func (c *Comparer) toComparableString(v interface{}) string {
switch val := v.(type) {
case map[string]interface{}:
// Try to get identifying fields
if artifact, ok := val["artifact"].(string); ok {
return artifact
}
if name, ok := val["name"].(string); ok {
return name
}
if metadata, ok := val["metadata"].(map[string]interface{}); ok {
if name, ok := metadata["name"].(string); ok {
return name
}
}
// Fallback to YAML representation
yamlBytes, _ := yaml.Marshal(val)
return string(yamlBytes)
default:
// Convert to YAML for comparison
yamlBytes, _ := yaml.Marshal(v)
return string(yamlBytes)
}
}
// parseYAMLStream parses a byte array containing one or more YAML documents
func parseYAMLStream(content []byte) ([]map[string]interface{}, error) {
var documents []map[string]interface{}
decoder := yaml.NewDecoder(bytes.NewReader(content))
for {
var doc map[string]interface{}
err := decoder.Decode(&doc)
if err == io.EOF {
break
}
if err != nil {
return nil, err
}
if doc != nil {
documents = append(documents, doc)
}
}
return documents, nil
}
// compareDocumentLists compares two lists of YAML documents
func (c *Comparer) compareDocumentLists(docs1, docs2 []map[string]interface{}, isBackwardsCompatible bool) error {
if len(docs1) != len(docs2) {
return errors.New("different number of documents")
}
// Create a bipartite matching between documents
used := make([]bool, len(docs2))
// First pass: try to find exact matches
for _, doc1 := range docs1 {
for j, doc2 := range docs2 {
if used[j] {
continue
}
// Check if documents are exactly equal
if c.documentsExactlyEqual(doc1, doc2) {
used[j] = true
break
}
}
}
// Second pass: handle unmatched documents
usedIdx := 0
for i, doc1 := range docs1 {
// Find if this document was matched in first pass
matchFound := false
for j, doc2 := range docs2 {
if used[j] && c.documentsExactlyEqual(doc1, doc2) {
matchFound = true
break
}
}
if !matchFound {
// Find the next unused document to compare against
for usedIdx < len(docs2) && used[usedIdx] {
usedIdx++
}
if usedIdx < len(docs2) {
// Compare structures
if err := c.compareStructures(doc1, docs2[usedIdx], isBackwardsCompatible); err != nil {
return errors.Format("document %d not equivalent: \n%w", i, err)
}
used[usedIdx] = true
}
}
}
return nil
}
// documentsExactlyEqual checks if two documents are exactly equal
func (c *Comparer) documentsExactlyEqual(doc1, doc2 map[string]interface{}) bool {
// Create comparison options for go-cmp
opts := []cmp.Option{
cmpopts.EquateEmpty(),
cmp.Transformer("sortSlices", func(s []interface{}) []interface{} {
return c.sortSlice(s)
}),
}
return cmp.Equal(doc1, doc2, opts...)
}
// extractFieldDifferences extracts specific field differences from a go-cmp diff
func (c *Comparer) extractFieldDifferences(diff string) string {
var differences []string
lines := strings.Split(diff, "\n")
for _, line := range lines {
// Look for lines that indicate field differences
trimmed := strings.TrimSpace(line)
// Handle lines with - or + prefixes
if strings.HasPrefix(trimmed, "-") || strings.HasPrefix(trimmed, "+") {
// Skip formatting markers
if strings.HasPrefix(trimmed, "---") || strings.HasPrefix(trimmed, "+++") {
continue
}
// Check if this is a field difference (contains a colon)
if strings.Contains(trimmed, ":") {
// Extract the field name and value
parts := strings.SplitN(trimmed[1:], ":", 2)
if len(parts) == 2 {
fieldName := strings.TrimSpace(parts[0])
value := strings.TrimSpace(parts[1])
// Clean up the field name (remove quotes if present)
fieldName = strings.Trim(fieldName, "\"")
value = strings.TrimSuffix(value, ",")
// Clean up value formatting
if strings.HasPrefix(value, "string(") {
value = strings.TrimPrefix(value, "string(")
value = strings.TrimSuffix(value, ")")
} else if strings.HasPrefix(value, "int(") {
value = strings.TrimPrefix(value, "int(")
value = strings.TrimSuffix(value, ")")
}
value = strings.Trim(value, "\"")
// Rebuild the difference line
prefix := trimmed[:1]
differences = append(differences, prefix+" "+fieldName+": "+value)
}
}
}
}
return strings.Join(differences, "\n")
}

View File

@@ -1,88 +0,0 @@
package compare
import (
"encoding/json"
"os"
"path/filepath"
"testing"
"github.com/stretchr/testify/assert"
)
type testCase struct {
ExitCode int `json:"exitCode"`
Name string `json:"name,omitempty"`
Msg string `json:"msg,omitempty"`
File1 string `json:"file1"`
File2 string `json:"file2"`
ExpectedError string `json:"expectedError,omitempty"` // Deprecated: use ExpectedErrors
ExpectedErrors []string `json:"expectedErrors,omitempty"`
IsBackwardsCompatible *bool `json:"isBackwardsCompatible,omitempty"`
}
func TestBuildPlans(t *testing.T) {
fixturesDir := "testdata"
entries, err := os.ReadDir(fixturesDir)
if err != nil {
t.Fatalf("could not read fixtures directory: %v", err)
}
for _, entry := range entries {
if !entry.IsDir() {
continue
}
dirName := entry.Name()
t.Run(dirName, func(t *testing.T) {
testDir := filepath.Join(fixturesDir, dirName)
// Read the testcase.json file
testcaseData, err := os.ReadFile(filepath.Join(testDir, "testcase.json"))
if err != nil {
t.Fatalf("could not read testcase.json: %v", err)
}
var tc testCase
if err := json.Unmarshal(testcaseData, &tc); err != nil {
t.Fatalf("could not parse testcase.json: %v", err)
}
// Use the test name if provided, otherwise use directory name
testName := dirName
if tc.Name != "" {
testName = tc.Name
}
// Run the test with the appropriate name
t.Run(testName, func(t *testing.T) {
// Build the full file paths
file1Path := filepath.Join(testDir, tc.File1)
file2Path := filepath.Join(testDir, tc.File2)
// Create a new comparer and run the comparison
c := New()
// Use isBackwardsCompatible from test case if provided, default to false
isBackwardsCompatible := false
if tc.IsBackwardsCompatible != nil {
isBackwardsCompatible = *tc.IsBackwardsCompatible
}
err := c.BuildPlans(file1Path, file2Path, isBackwardsCompatible)
// Check the result based on expected exit code
if tc.ExitCode == 0 {
assert.NoError(t, err, tc.Msg)
} else {
assert.Error(t, err, tc.Msg)
// Support both old expectedError and new expectedErrors
if tc.ExpectedError != "" {
assert.ErrorContains(t, err, tc.ExpectedError, tc.Msg)
}
// Check each expected error substring
for _, expectedErr := range tc.ExpectedErrors {
assert.ErrorContains(t, err, expectedErr, tc.Msg)
}
}
})
})
}
}

View File

@@ -1,810 +0,0 @@
kind: BuildPlan
apiVersion: v1alpha5
metadata:
name: kargo-stages
labels:
holos.run/component.name: kargo-stages
holos.run/project.name: httpbin
holos.run/stack.name: httpbin
annotations:
app.holos.run/description: kargo-stages for project httpbin
example.com/description: bar
spec:
artifacts:
- artifact: projects/httpbin/components/kargo-stages/kargo-stages.gen.yaml
generators:
- kind: Resources
output: resources.gen.yaml
resources:
Stage:
dev:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: dev
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/dev-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/dev-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/dev-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/dev-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/dev-httpbin
uses: git-push
- config:
apps:
- name: httpbin-dev-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
direct: true
prod-us-central:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: prod-us-central
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/prod-us-central-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/prod-us-central-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/prod-us-central-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/prod-us-central-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/prod-us-central-httpbin
uses: git-push
- config:
apps:
- name: httpbin-prod-us-central-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- uat
prod-us-east:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: prod-us-east
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/prod-us-east-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/prod-us-east-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/prod-us-east-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/prod-us-east-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/prod-us-east-httpbin
uses: git-push
- config:
apps:
- name: httpbin-prod-us-east-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- uat
prod-us-west:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: prod-us-west
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/prod-us-west-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/prod-us-west-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/prod-us-west-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/prod-us-west-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/prod-us-west-httpbin
uses: git-push
- config:
apps:
- name: httpbin-prod-us-west-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- uat
test:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: test
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/test-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/test-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/test-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/test-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/test-httpbin
uses: git-push
- config:
apps:
- name: httpbin-test-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- dev
uat:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: uat
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/uat-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/uat-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/uat-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/uat-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/uat-httpbin
uses: git-push
- config:
apps:
- name: httpbin-uat-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- test
Warehouse:
httpbin:
apiVersion: kargo.akuity.io/v1alpha1
kind: Warehouse
metadata:
name: httpbin
namespace: httpbin
spec:
interval: 5m0s
subscriptions:
- image:
discoveryLimit: 5
repoURL: quay.io/holos/mccutchen/go-httpbin
semverConstraint: ^2.0.0
strictSemvers: true
transformers:
- kind: Kustomize
inputs:
- resources.gen.yaml
output: projects/httpbin/components/kargo-stages/kargo-stages.gen.yaml
kustomize:
kustomization:
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
labels:
- includeSelectors: false
pairs:
argocd.argoproj.io/instance: httpbin-kargo-stages
resources:
- resources.gen.yaml
- artifact: projects/httpbin/gitops/kargo-stages.application.gen.yaml
generators:
- kind: Resources
output: projects/httpbin/gitops/kargo-stages.application.gen.yaml
resources:
Application:
httpbin-kargo-stages:
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
labels: {}
name: httpbin-kargo-stages
namespace: argocd
spec:
destination:
server: https://kubernetes.default.svc
project: httpbin
source:
path: deploy/projects/httpbin/components/kargo-stages
repoURL: https://github.com/holos-run/kargo-demo.git
targetRevision: main
---
kind: BuildPlan
apiVersion: v1alpha5
metadata:
name: kargo-stages
labels:
holos.run/component.name: kargo-stages
holos.run/project.name: httpbin
holos.run/stack.name: httpbin
annotations:
example.com/description: bar
spec:
artifacts:
- artifact: projects/httpbin/components/kargo-stages/kargo-stages.gen.yaml
generators:
- kind: Resources
output: resources.gen.yaml
resources:
Stage:
dev:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: dev
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/dev-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/dev-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/dev-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/dev-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/dev-httpbin
uses: git-push
- config:
apps:
- name: httpbin-dev-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
direct: true
prod-us-central:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: prod-us-central
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/prod-us-central-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/prod-us-central-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/prod-us-central-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/prod-us-central-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/prod-us-central-httpbin
uses: git-push
- config:
apps:
- name: httpbin-prod-us-central-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- uat
prod-us-east:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: prod-us-east
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/prod-us-east-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/prod-us-east-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/prod-us-east-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/prod-us-east-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/prod-us-east-httpbin
uses: git-push
- config:
apps:
- name: httpbin-prod-us-east-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- uat
prod-us-west:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: prod-us-west
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/prod-us-west-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/prod-us-west-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/prod-us-west-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/prod-us-west-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/prod-us-west-httpbin
uses: git-push
- config:
apps:
- name: httpbin-prod-us-west-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- uat
test:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: test
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/test-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/test-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/test-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/test-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/test-httpbin
uses: git-push
- config:
apps:
- name: httpbin-test-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- dev
uat:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: uat
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/uat-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/uat-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/uat-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/uat-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/uat-httpbin
uses: git-push
- config:
apps:
- name: httpbin-uat-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- test
Warehouse:
httpbin:
apiVersion: kargo.akuity.io/v1alpha1
kind: Warehouse
metadata:
name: httpbin
namespace: httpbin
spec:
interval: 5m0s
subscriptions:
- image:
discoveryLimit: 5
repoURL: quay.io/holos/mccutchen/go-httpbin
semverConstraint: ^2.0.0
strictSemvers: true
transformers:
- kind: Kustomize
inputs:
- resources.gen.yaml
output: projects/httpbin/components/kargo-stages/kargo-stages.gen.yaml
kustomize:
kustomization:
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
labels:
- includeSelectors: false
pairs:
argocd.argoproj.io/instance: httpbin-kargo-stages
resources:
- resources.gen.yaml
- artifact: projects/httpbin/gitops/kargo-stages.application.gen.yaml
generators:
- kind: Resources
output: projects/httpbin/gitops/kargo-stages.application.gen.yaml
resources:
Application:
httpbin-kargo-stages:
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
labels: {}
name: httpbin-kargo-stages
namespace: argocd
spec:
destination:
server: https://kubernetes.default.svc
project: httpbin
source:
path: deploy/projects/httpbin/components/kargo-stages
repoURL: https://github.com/holos-run/kargo-demo.git
targetRevision: main

View File

@@ -1,810 +0,0 @@
kind: BuildPlan
apiVersion: v1alpha5
metadata:
name: kargo-stages
labels:
holos.run/component.name: kargo-stages
holos.run/project.name: httpbin
holos.run/stack.name: httpbin
annotations:
app.holos.run/description: kargo-stages for project httpbin
example.com/description: foo
spec:
artifacts:
- artifact: projects/httpbin/components/kargo-stages/kargo-stages.gen.yaml
generators:
- kind: Resources
output: resources.gen.yaml
resources:
Stage:
dev:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: dev
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/dev-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/dev-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/dev-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/dev-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/dev-httpbin
uses: git-push
- config:
apps:
- name: httpbin-dev-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
direct: true
prod-us-central:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: prod-us-central
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/prod-us-central-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/prod-us-central-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/prod-us-central-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/prod-us-central-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/prod-us-central-httpbin
uses: git-push
- config:
apps:
- name: httpbin-prod-us-central-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- uat
prod-us-east:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: prod-us-east
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/prod-us-east-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/prod-us-east-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/prod-us-east-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/prod-us-east-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/prod-us-east-httpbin
uses: git-push
- config:
apps:
- name: httpbin-prod-us-east-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- uat
prod-us-west:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: prod-us-west
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/prod-us-west-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/prod-us-west-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/prod-us-west-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/prod-us-west-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/prod-us-west-httpbin
uses: git-push
- config:
apps:
- name: httpbin-prod-us-west-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- uat
test:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: test
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/test-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/test-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/test-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/test-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/test-httpbin
uses: git-push
- config:
apps:
- name: httpbin-test-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- dev
uat:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: uat
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/uat-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/uat-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/uat-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/uat-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/uat-httpbin
uses: git-push
- config:
apps:
- name: httpbin-uat-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- test
Warehouse:
httpbin:
apiVersion: kargo.akuity.io/v1alpha1
kind: Warehouse
metadata:
name: httpbin
namespace: httpbin
spec:
interval: 5m0s
subscriptions:
- image:
discoveryLimit: 5
repoURL: quay.io/holos/mccutchen/go-httpbin
semverConstraint: ^2.0.0
strictSemvers: true
transformers:
- kind: Kustomize
inputs:
- resources.gen.yaml
output: projects/httpbin/components/kargo-stages/kargo-stages.gen.yaml
kustomize:
kustomization:
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
labels:
- includeSelectors: false
pairs:
argocd.argoproj.io/instance: httpbin-kargo-stages
resources:
- resources.gen.yaml
- artifact: projects/httpbin/gitops/kargo-stages.application.gen.yaml
generators:
- kind: Resources
output: projects/httpbin/gitops/kargo-stages.application.gen.yaml
resources:
Application:
httpbin-kargo-stages:
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
labels: {}
name: httpbin-kargo-stages
namespace: argocd
spec:
destination:
server: https://kubernetes.default.svc
project: httpbin
source:
path: deploy/projects/httpbin/components/kargo-stages
repoURL: https://github.com/holos-run/kargo-demo.git
targetRevision: main
---
kind: BuildPlan
apiVersion: v1alpha5
metadata:
name: kargo-stages
labels:
holos.run/component.name: kargo-stages
holos.run/project.name: httpbin
holos.run/stack.name: httpbin
annotations:
example.com/description: bar
spec:
artifacts:
- artifact: projects/httpbin/components/kargo-stages/kargo-stages.gen.yaml
generators:
- kind: Resources
output: resources.gen.yaml
resources:
Stage:
dev:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: dev
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/dev-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/dev-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/dev-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/dev-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/dev-httpbin
uses: git-push
- config:
apps:
- name: httpbin-dev-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
direct: true
prod-us-central:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: prod-us-central
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/prod-us-central-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/prod-us-central-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/prod-us-central-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/prod-us-central-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/prod-us-central-httpbin
uses: git-push
- config:
apps:
- name: httpbin-prod-us-central-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- uat
prod-us-east:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: prod-us-east
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/prod-us-east-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/prod-us-east-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/prod-us-east-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/prod-us-east-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/prod-us-east-httpbin
uses: git-push
- config:
apps:
- name: httpbin-prod-us-east-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- uat
prod-us-west:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: prod-us-west
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/prod-us-west-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/prod-us-west-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/prod-us-west-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/prod-us-west-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/prod-us-west-httpbin
uses: git-push
- config:
apps:
- name: httpbin-prod-us-west-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- uat
test:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: test
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/test-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/test-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/test-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/test-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/test-httpbin
uses: git-push
- config:
apps:
- name: httpbin-test-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- dev
uat:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: uat
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/uat-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/uat-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/uat-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/uat-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/uat-httpbin
uses: git-push
- config:
apps:
- name: httpbin-uat-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- test
Warehouse:
httpbin:
apiVersion: kargo.akuity.io/v1alpha1
kind: Warehouse
metadata:
name: httpbin
namespace: httpbin
spec:
interval: 5m0s
subscriptions:
- image:
discoveryLimit: 5
repoURL: quay.io/holos/mccutchen/go-httpbin
semverConstraint: ^2.0.0
strictSemvers: true
transformers:
- kind: Kustomize
inputs:
- resources.gen.yaml
output: projects/httpbin/components/kargo-stages/kargo-stages.gen.yaml
kustomize:
kustomization:
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
labels:
- includeSelectors: false
pairs:
argocd.argoproj.io/instance: httpbin-kargo-stages
resources:
- resources.gen.yaml
- artifact: projects/httpbin/gitops/kargo-stages.application.gen.yaml
generators:
- kind: Resources
output: projects/httpbin/gitops/kargo-stages.application.gen.yaml
resources:
Application:
httpbin-kargo-stages:
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
labels: {}
name: httpbin-kargo-stages
namespace: argocd
spec:
destination:
server: https://kubernetes.default.svc
project: httpbin
source:
path: deploy/projects/httpbin/components/kargo-stages
repoURL: https://github.com/holos-run/kargo-demo.git
targetRevision: main

View File

@@ -1,7 +0,0 @@
{
"exitCode": 1,
"name": "DuplicatedAnnotationsInAfter",
"msg": "should not match when the same object is duplicated in after and differs only by an arbitrary deeply nested field in before, in this case an annotation",
"file1": "before.yaml",
"file2": "after.yaml"
}

View File

@@ -1,24 +0,0 @@
---
kind: BuildPlan
apiVersion: v1alpha5
metadata:
name: component
labels:
holos.run/component.name: component
holos.run/stack.name: demo
annotations:
holos.run/purpose: example
holos.run/environment: prod
spec:
artifacts:
- artifact: component.yaml
generators:
- kind: Kubernetes
output: manifests.yaml
resources:
- name: deployment
namespace: default
transformers:
- kind: SetLabels
labels:
app: demo

View File

@@ -1,17 +0,0 @@
---
kind: BuildPlan
apiVersion: v1alpha5
metadata:
name: component
labels:
holos.run/component.name: component
# Missing holos.run/stack.name
# Missing annotations
spec:
artifacts:
- artifact: component.yaml
generators:
- kind: Kubernetes
output: manifests.yaml
# Missing resources
# Missing transformers

View File

@@ -1,9 +0,0 @@
{
"exitCode": 0,
"name": "BuildPlan_4",
"msg": "BuildPlan spec 4: after may have fields missing from before if isBackwardsCompatible is true - should pass when before has missing fields and isBackwardsCompatible is true",
"file1": "before.yaml",
"file2": "after.yaml",
"expectedErrors": [],
"isBackwardsCompatible": true
}

View File

@@ -1,404 +0,0 @@
kind: BuildPlan
apiVersion: v1alpha5
metadata:
name: kargo-stages
labels:
holos.run/component.name: kargo-stages
holos.run/project.name: httpbin
holos.run/stack.name: httpbin
annotations:
app.holos.run/description: kargo-stages for project httpbin
spec:
artifacts:
- artifact: projects/httpbin/components/kargo-stages/kargo-stages.gen.yaml
generators:
- kind: Resources
output: resources.gen.yaml
resources:
Stage:
dev:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: dev
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/dev-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/dev-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/dev-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/dev-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/dev-httpbin
uses: git-push
- config:
apps:
- name: httpbin-dev-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
direct: true
prod-us-central:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: prod-us-central
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/prod-us-central-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/prod-us-central-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/prod-us-central-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/prod-us-central-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/prod-us-central-httpbin
uses: git-push
- config:
apps:
- name: httpbin-prod-us-central-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- uat
prod-us-east:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: prod-us-east
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/prod-us-east-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/prod-us-east-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/prod-us-east-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/prod-us-east-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/prod-us-east-httpbin
uses: git-push
- config:
apps:
- name: httpbin-prod-us-east-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- uat
prod-us-west:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: prod-us-west
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/prod-us-west-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/prod-us-west-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/prod-us-west-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/prod-us-west-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/prod-us-west-httpbin
uses: git-push
- config:
apps:
- name: httpbin-prod-us-west-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- uat
test:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: test
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/test-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/test-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/test-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/test-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/test-httpbin
uses: git-push
- config:
apps:
- name: httpbin-test-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- dev
uat:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: uat
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/uat-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/uat-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/uat-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/uat-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/uat-httpbin
uses: git-push
- config:
apps:
- name: httpbin-uat-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- test
Warehouse:
httpbin:
apiVersion: kargo.akuity.io/v1alpha1
kind: Warehouse
metadata:
name: httpbin
namespace: httpbin
spec:
interval: 5m0s
subscriptions:
- image:
discoveryLimit: 5
repoURL: quay.io/holos/mccutchen/go-httpbin
semverConstraint: ^2.0.0
strictSemvers: true
transformers:
- kind: Kustomize
inputs:
- resources.gen.yaml
output: projects/httpbin/components/kargo-stages/kargo-stages.gen.yaml
kustomize:
kustomization:
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
labels:
- includeSelectors: false
pairs:
argocd.argoproj.io/instance: httpbin-kargo-stages
resources:
- resources.gen.yaml
- artifact: projects/httpbin/gitops/kargo-stages.application.gen.yaml
generators:
- kind: Resources
output: projects/httpbin/gitops/kargo-stages.application.gen.yaml
resources:
Application:
httpbin-kargo-stages:
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
labels: {}
name: httpbin-kargo-stages
namespace: argocd
spec:
destination:
server: https://kubernetes.default.svc
project: httpbin
source:
path: deploy/projects/httpbin/components/kargo-stages
repoURL: https://github.com/holos-run/kargo-demo.git
targetRevision: main

View File

@@ -1,404 +0,0 @@
kind: BuildPlan
apiVersion: v1alpha5
metadata:
name: kargo-stages
labels:
holos.run/component.name: kargo-stages
holos.run/project.name: httpbin
holos.run/stack.name: httpbin
annotations:
app.holos.run/description: kargo-stages for project httpbin
spec:
artifacts:
- artifact: projects/httpbin/components/kargo-stages/kargo-stages.gen.yaml
generators:
- kind: Resources
output: resources.gen.yaml
resources:
Stage:
dev:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: dev
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/dev-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/dev-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/dev-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/dev-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/dev-httpbin
uses: git-push
- config:
apps:
- name: httpbin-dev-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
direct: true
prod-us-central:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: prod-us-central
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/prod-us-central-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/prod-us-central-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/prod-us-central-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/prod-us-central-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/prod-us-central-httpbin
uses: git-push
- config:
apps:
- name: httpbin-prod-us-central-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- uat
prod-us-east:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: prod-us-east
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/prod-us-east-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/prod-us-east-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/prod-us-east-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/prod-us-east-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/prod-us-east-httpbin
uses: git-push
- config:
apps:
- name: httpbin-prod-us-east-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- uat
prod-us-west:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: prod-us-west
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/prod-us-west-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/prod-us-west-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/prod-us-west-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/prod-us-west-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/prod-us-west-httpbin
uses: git-push
- config:
apps:
- name: httpbin-prod-us-west-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- uat
test:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: test
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/test-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/test-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/test-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/test-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/test-httpbin
uses: git-push
- config:
apps:
- name: httpbin-test-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- dev
uat:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: uat
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/uat-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/uat-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/uat-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/uat-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/uat-httpbin
uses: git-push
- config:
apps:
- name: httpbin-uat-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- test
Warehouse:
httpbin:
apiVersion: kargo.akuity.io/v1alpha1
kind: Warehouse
metadata:
name: httpbin
namespace: httpbin
spec:
interval: 5m0s
subscriptions:
- image:
discoveryLimit: 5
repoURL: quay.io/holos/mccutchen/go-httpbin
semverConstraint: ^2.0.0
strictSemvers: true
transformers:
- kind: Kustomize
inputs:
- resources.gen.yaml
output: projects/httpbin/components/kargo-stages/kargo-stages.gen.yaml
kustomize:
kustomization:
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
labels:
- includeSelectors: false
pairs:
argocd.argoproj.io/instance: httpbin-kargo-stages
resources:
- resources.gen.yaml
- artifact: projects/httpbin/gitops/kargo-stages.application.gen.yaml
generators:
- kind: Resources
output: projects/httpbin/gitops/kargo-stages.application.gen.yaml
resources:
Application:
httpbin-kargo-stages:
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
labels: {}
name: httpbin-kargo-stages
namespace: argocd
spec:
destination:
server: https://kubernetes.default.svc
project: httpbin
source:
path: deploy/projects/httpbin/components/kargo-stages
repoURL: https://github.com/holos-run/kargo-demo.git
targetRevision: main

View File

@@ -1,8 +0,0 @@
{
"exitCode": 0,
"name": "FullBuildPlan",
"msg": "should match full build plans",
"file1": "before.yaml",
"file2": "after.yaml",
"expectedErrors": []
}

View File

@@ -1,404 +0,0 @@
kind: BuildPlan
apiVersion: v1alpha5
metadata:
name: kargo-stages
labels:
holos.run/component.name: kargo-stages
holos.run/project.name: httpbin
holos.run/stack.name: httpbin
annotations:
app.holos.run/description: kargo-stages for project httpbin
spec:
artifacts:
- artifact: projects/httpbin/gitops/kargo-stages.application.gen.yaml
generators:
- kind: Resources
output: projects/httpbin/gitops/kargo-stages.application.gen.yaml
resources:
Application:
httpbin-kargo-stages:
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
labels: {}
name: httpbin-kargo-stages
namespace: argocd
spec:
destination:
server: https://kubernetes.default.svc
project: httpbin
source:
path: deploy/projects/httpbin/components/kargo-stages
repoURL: https://github.com/holos-run/kargo-demo.git
targetRevision: main
- artifact: projects/httpbin/components/kargo-stages/kargo-stages.gen.yaml
generators:
- kind: Resources
output: resources.gen.yaml
resources:
Stage:
dev:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: dev
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/dev-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/dev-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/dev-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/dev-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/dev-httpbin
uses: git-push
- config:
apps:
- name: httpbin-dev-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
direct: true
prod-us-central:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: prod-us-central
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/prod-us-central-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/prod-us-central-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/prod-us-central-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/prod-us-central-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/prod-us-central-httpbin
uses: git-push
- config:
apps:
- name: httpbin-prod-us-central-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- uat
prod-us-east:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: prod-us-east
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/prod-us-east-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/prod-us-east-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/prod-us-east-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/prod-us-east-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/prod-us-east-httpbin
uses: git-push
- config:
apps:
- name: httpbin-prod-us-east-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- uat
prod-us-west:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: prod-us-west
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/prod-us-west-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/prod-us-west-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/prod-us-west-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/prod-us-west-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/prod-us-west-httpbin
uses: git-push
- config:
apps:
- name: httpbin-prod-us-west-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- uat
test:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: test
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/test-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/test-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/test-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/test-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/test-httpbin
uses: git-push
- config:
apps:
- name: httpbin-test-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- dev
uat:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: uat
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/uat-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/uat-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/uat-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/uat-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/uat-httpbin
uses: git-push
- config:
apps:
- name: httpbin-uat-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- test
Warehouse:
httpbin:
apiVersion: kargo.akuity.io/v1alpha1
kind: Warehouse
metadata:
name: httpbin
namespace: httpbin
spec:
interval: 5m0s
subscriptions:
- image:
discoveryLimit: 5
repoURL: quay.io/holos/mccutchen/go-httpbin
semverConstraint: ^2.0.0
strictSemvers: true
transformers:
- kind: Kustomize
inputs:
- resources.gen.yaml
output: projects/httpbin/components/kargo-stages/kargo-stages.gen.yaml
kustomize:
kustomization:
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
labels:
- includeSelectors: false
pairs:
argocd.argoproj.io/instance: httpbin-kargo-stages
resources:
- resources.gen.yaml

View File

@@ -1,404 +0,0 @@
kind: BuildPlan
apiVersion: v1alpha5
metadata:
name: kargo-stages
labels:
holos.run/component.name: kargo-stages
holos.run/project.name: httpbin
holos.run/stack.name: httpbin
annotations:
app.holos.run/description: kargo-stages for project httpbin
spec:
artifacts:
- artifact: projects/httpbin/components/kargo-stages/kargo-stages.gen.yaml
generators:
- kind: Resources
output: resources.gen.yaml
resources:
Stage:
dev:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: dev
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/dev-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/dev-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/dev-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/dev-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/dev-httpbin
uses: git-push
- config:
apps:
- name: httpbin-dev-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
direct: true
prod-us-central:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: prod-us-central
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/prod-us-central-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/prod-us-central-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/prod-us-central-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/prod-us-central-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/prod-us-central-httpbin
uses: git-push
- config:
apps:
- name: httpbin-prod-us-central-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- uat
prod-us-east:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: prod-us-east
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/prod-us-east-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/prod-us-east-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/prod-us-east-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/prod-us-east-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/prod-us-east-httpbin
uses: git-push
- config:
apps:
- name: httpbin-prod-us-east-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- uat
prod-us-west:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: prod-us-west
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/prod-us-west-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/prod-us-west-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/prod-us-west-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/prod-us-west-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/prod-us-west-httpbin
uses: git-push
- config:
apps:
- name: httpbin-prod-us-west-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- uat
test:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: test
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/test-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/test-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/test-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/test-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/test-httpbin
uses: git-push
- config:
apps:
- name: httpbin-test-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- dev
uat:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: uat
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/uat-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/uat-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/uat-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/uat-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/uat-httpbin
uses: git-push
- config:
apps:
- name: httpbin-uat-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- test
Warehouse:
httpbin:
apiVersion: kargo.akuity.io/v1alpha1
kind: Warehouse
metadata:
name: httpbin
namespace: httpbin
spec:
interval: 5m0s
subscriptions:
- image:
discoveryLimit: 5
repoURL: quay.io/holos/mccutchen/go-httpbin
semverConstraint: ^2.0.0
strictSemvers: true
transformers:
- kind: Kustomize
inputs:
- resources.gen.yaml
output: projects/httpbin/components/kargo-stages/kargo-stages.gen.yaml
kustomize:
kustomization:
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
labels:
- includeSelectors: false
pairs:
argocd.argoproj.io/instance: httpbin-kargo-stages
resources:
- resources.gen.yaml
- artifact: projects/httpbin/gitops/kargo-stages.application.gen.yaml
generators:
- kind: Resources
output: projects/httpbin/gitops/kargo-stages.application.gen.yaml
resources:
Application:
httpbin-kargo-stages:
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
labels: {}
name: httpbin-kargo-stages
namespace: argocd
spec:
destination:
server: https://kubernetes.default.svc
project: httpbin
source:
path: deploy/projects/httpbin/components/kargo-stages
repoURL: https://github.com/holos-run/kargo-demo.git
targetRevision: main

View File

@@ -1,8 +0,0 @@
{
"exitCode": 0,
"name": "BuildPlan_3.1",
"msg": "BuildPlan spec 3.1: Objects in the spec.artifacts list may appear in any arbitrary order - should match when artifacts are reordered",
"file1": "before.yaml",
"file2": "after.yaml",
"expectedErrors": []
}

View File

@@ -1,404 +0,0 @@
kind: BuildPlan
apiVersion: v1alpha5
metadata:
name: kargo-stages
labels:
holos.run/component.name: kargo-stages
holos.run/project.name: httpbin
holos.run/stack.name: not-httpbin
annotations:
app.holos.run/description: kargo-stages for project httpbin
spec:
artifacts:
- artifact: projects/httpbin/gitops/kargo-stages.application.gen.yaml
generators:
- kind: Resources
output: projects/httpbin/gitops/kargo-stages.application.gen.yaml
resources:
Application:
httpbin-kargo-stages:
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
labels: {}
name: httpbin-kargo-stages
namespace: argocd
spec:
destination:
server: https://kubernetes.default.svc
project: httpbin
source:
path: deploy/projects/httpbin/components/kargo-stages
repoURL: https://github.com/holos-run/kargo-demo.git
targetRevision: main
- artifact: projects/httpbin/components/kargo-stages/kargo-stages.gen.yaml
generators:
- kind: Resources
output: resources.gen.yaml
resources:
Stage:
dev:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: dev
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/dev-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/dev-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/dev-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/dev-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/dev-httpbin
uses: git-push
- config:
apps:
- name: httpbin-dev-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
direct: true
prod-us-central:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: prod-us-central
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/prod-us-central-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/prod-us-central-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/prod-us-central-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/prod-us-central-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/prod-us-central-httpbin
uses: git-push
- config:
apps:
- name: httpbin-prod-us-central-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- uat
prod-us-east:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: prod-us-east
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/prod-us-east-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/prod-us-east-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/prod-us-east-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/prod-us-east-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/prod-us-east-httpbin
uses: git-push
- config:
apps:
- name: httpbin-prod-us-east-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- uat
prod-us-west:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: prod-us-west
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/prod-us-west-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/prod-us-west-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/prod-us-west-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/prod-us-west-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/prod-us-west-httpbin
uses: git-push
- config:
apps:
- name: httpbin-prod-us-west-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- uat
test:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: test
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/test-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/test-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/test-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/test-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/test-httpbin
uses: git-push
- config:
apps:
- name: httpbin-test-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- dev
uat:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: uat
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/uat-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/uat-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/uat-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/uat-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/uat-httpbin
uses: git-push
- config:
apps:
- name: httpbin-uat-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- test
Warehouse:
httpbin:
apiVersion: kargo.akuity.io/v1alpha1
kind: Warehouse
metadata:
name: httpbin
namespace: httpbin
spec:
interval: 5m0s
subscriptions:
- image:
discoveryLimit: 5
repoURL: quay.io/holos/mccutchen/go-httpbin
semverConstraint: ^2.0.0
strictSemvers: true
transformers:
- kind: Kustomize
inputs:
- resources.gen.yaml
output: projects/httpbin/components/kargo-stages/kargo-stages.gen.yaml
kustomize:
kustomization:
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
labels:
- includeSelectors: false
pairs:
argocd.argoproj.io/instance: httpbin-kargo-stages
resources:
- resources.gen.yaml

View File

@@ -1,404 +0,0 @@
kind: BuildPlan
apiVersion: v1alpha5
metadata:
name: kargo-stages
labels:
holos.run/component.name: kargo-stages
holos.run/project.name: httpbin
holos.run/stack.name: httpbin
annotations:
app.holos.run/description: kargo-stages for project httpbin
spec:
artifacts:
- artifact: projects/httpbin/components/kargo-stages/kargo-stages.gen.yaml
generators:
- kind: Resources
output: resources.gen.yaml
resources:
Stage:
dev:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: dev
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/dev-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/dev-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/dev-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/dev-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/dev-httpbin
uses: git-push
- config:
apps:
- name: httpbin-dev-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
direct: true
prod-us-central:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: prod-us-central
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/prod-us-central-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/prod-us-central-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/prod-us-central-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/prod-us-central-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/prod-us-central-httpbin
uses: git-push
- config:
apps:
- name: httpbin-prod-us-central-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- uat
prod-us-east:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: prod-us-east
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/prod-us-east-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/prod-us-east-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/prod-us-east-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/prod-us-east-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/prod-us-east-httpbin
uses: git-push
- config:
apps:
- name: httpbin-prod-us-east-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- uat
prod-us-west:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: prod-us-west
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/prod-us-west-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/prod-us-west-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/prod-us-west-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/prod-us-west-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/prod-us-west-httpbin
uses: git-push
- config:
apps:
- name: httpbin-prod-us-west-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- uat
test:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: test
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/test-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/test-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/test-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/test-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/test-httpbin
uses: git-push
- config:
apps:
- name: httpbin-test-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- dev
uat:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: uat
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/uat-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/uat-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/uat-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/uat-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/uat-httpbin
uses: git-push
- config:
apps:
- name: httpbin-uat-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- test
Warehouse:
httpbin:
apiVersion: kargo.akuity.io/v1alpha1
kind: Warehouse
metadata:
name: httpbin
namespace: httpbin
spec:
interval: 5m0s
subscriptions:
- image:
discoveryLimit: 5
repoURL: quay.io/holos/mccutchen/go-httpbin
semverConstraint: ^2.0.0
strictSemvers: true
transformers:
- kind: Kustomize
inputs:
- resources.gen.yaml
output: projects/httpbin/components/kargo-stages/kargo-stages.gen.yaml
kustomize:
kustomization:
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
labels:
- includeSelectors: false
pairs:
argocd.argoproj.io/instance: httpbin-kargo-stages
resources:
- resources.gen.yaml
- artifact: projects/httpbin/gitops/kargo-stages.application.gen.yaml
generators:
- kind: Resources
output: projects/httpbin/gitops/kargo-stages.application.gen.yaml
resources:
Application:
httpbin-kargo-stages:
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
labels: {}
name: httpbin-kargo-stages
namespace: argocd
spec:
destination:
server: https://kubernetes.default.svc
project: httpbin
source:
path: deploy/projects/httpbin/components/kargo-stages
repoURL: https://github.com/holos-run/kargo-demo.git
targetRevision: main

View File

@@ -1,8 +0,0 @@
{
"exitCode": 1,
"name": "FullBuildPlanDifferentLabelValues",
"msg": "should not match full build plans with out of order artifacts and different labels",
"file1": "before.yaml",
"file2": "after.yaml",
"expectedErrors": ["holos.run/stack.name: not-httpbin"]
}

View File

@@ -1,405 +0,0 @@
kind: BuildPlan
apiVersion: v1alpha5
metadata:
name: kargo-stages
labels:
holos.run/component.name: kargo-stages
holos.run/project.name: httpbin
holos.run/stack.name: httpbin
extra: not-in-before
annotations:
app.holos.run/description: kargo-stages for project httpbin
spec:
artifacts:
- artifact: projects/httpbin/components/kargo-stages/kargo-stages.gen.yaml
generators:
- kind: Resources
output: resources.gen.yaml
resources:
Stage:
dev:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: dev
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/dev-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/dev-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/dev-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/dev-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/dev-httpbin
uses: git-push
- config:
apps:
- name: httpbin-dev-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
direct: true
prod-us-central:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: prod-us-central
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/prod-us-central-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/prod-us-central-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/prod-us-central-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/prod-us-central-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/prod-us-central-httpbin
uses: git-push
- config:
apps:
- name: httpbin-prod-us-central-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- uat
prod-us-east:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: prod-us-east
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/prod-us-east-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/prod-us-east-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/prod-us-east-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/prod-us-east-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/prod-us-east-httpbin
uses: git-push
- config:
apps:
- name: httpbin-prod-us-east-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- uat
prod-us-west:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: prod-us-west
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/prod-us-west-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/prod-us-west-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/prod-us-west-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/prod-us-west-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/prod-us-west-httpbin
uses: git-push
- config:
apps:
- name: httpbin-prod-us-west-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- uat
test:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: test
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/test-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/test-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/test-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/test-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/test-httpbin
uses: git-push
- config:
apps:
- name: httpbin-test-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- dev
uat:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: uat
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/uat-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/uat-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/uat-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/uat-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/uat-httpbin
uses: git-push
- config:
apps:
- name: httpbin-uat-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- test
Warehouse:
httpbin:
apiVersion: kargo.akuity.io/v1alpha1
kind: Warehouse
metadata:
name: httpbin
namespace: httpbin
spec:
interval: 5m0s
subscriptions:
- image:
discoveryLimit: 5
repoURL: quay.io/holos/mccutchen/go-httpbin
semverConstraint: ^2.0.0
strictSemvers: true
transformers:
- kind: Kustomize
inputs:
- resources.gen.yaml
output: projects/httpbin/components/kargo-stages/kargo-stages.gen.yaml
kustomize:
kustomization:
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
labels:
- includeSelectors: false
pairs:
argocd.argoproj.io/instance: httpbin-kargo-stages
resources:
- resources.gen.yaml
- artifact: projects/httpbin/gitops/kargo-stages.application.gen.yaml
generators:
- kind: Resources
output: projects/httpbin/gitops/kargo-stages.application.gen.yaml
resources:
Application:
httpbin-kargo-stages:
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
labels: {}
name: httpbin-kargo-stages
namespace: argocd
spec:
destination:
server: https://kubernetes.default.svc
project: httpbin
source:
path: deploy/projects/httpbin/components/kargo-stages
repoURL: https://github.com/holos-run/kargo-demo.git
targetRevision: main

View File

@@ -1,404 +0,0 @@
kind: BuildPlan
apiVersion: v1alpha5
metadata:
name: kargo-stages
labels:
holos.run/component.name: kargo-stages
holos.run/project.name: httpbin
holos.run/stack.name: httpbin
annotations:
app.holos.run/description: kargo-stages for project httpbin
spec:
artifacts:
- artifact: projects/httpbin/components/kargo-stages/kargo-stages.gen.yaml
generators:
- kind: Resources
output: resources.gen.yaml
resources:
Stage:
dev:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: dev
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/dev-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/dev-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/dev-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/dev-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/dev-httpbin
uses: git-push
- config:
apps:
- name: httpbin-dev-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
direct: true
prod-us-central:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: prod-us-central
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/prod-us-central-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/prod-us-central-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/prod-us-central-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/prod-us-central-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/prod-us-central-httpbin
uses: git-push
- config:
apps:
- name: httpbin-prod-us-central-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- uat
prod-us-east:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: prod-us-east
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/prod-us-east-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/prod-us-east-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/prod-us-east-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/prod-us-east-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/prod-us-east-httpbin
uses: git-push
- config:
apps:
- name: httpbin-prod-us-east-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- uat
prod-us-west:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: prod-us-west
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/prod-us-west-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/prod-us-west-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/prod-us-west-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/prod-us-west-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/prod-us-west-httpbin
uses: git-push
- config:
apps:
- name: httpbin-prod-us-west-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- uat
test:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: test
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/test-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/test-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/test-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/test-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/test-httpbin
uses: git-push
- config:
apps:
- name: httpbin-test-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- dev
uat:
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: uat
namespace: httpbin
spec:
promotionTemplate:
spec:
steps:
- config:
checkout:
- branch: main
path: ./src
- branch: project/httpbin/component/uat-httpbin
create: true
path: ./out
repoURL: https://github.com/holos-run/kargo-demo.git
uses: git-clone
- config:
path: ./out
uses: git-clear
- as: update-image
config:
images:
- image: quay.io/holos/mccutchen/go-httpbin
path: ./src/deploy/projects/httpbin/components/uat-httpbin
uses: kustomize-set-image
- config:
outPath: ./out/uat-httpbin.gen.yaml
path: ./src/deploy/projects/httpbin/components/uat-httpbin
uses: kustomize-build
- as: commit
config:
messageFromSteps:
- update-image
path: ./out
uses: git-commit
- config:
path: ./out
targetBranch: project/httpbin/component/uat-httpbin
uses: git-push
- config:
apps:
- name: httpbin-uat-httpbin
sources:
- desiredCommitFromStep: commit
repoURL: https://github.com/holos-run/kargo-demo.git
uses: argocd-update
requestedFreight:
- origin:
kind: Warehouse
name: httpbin
sources:
stages:
- test
Warehouse:
httpbin:
apiVersion: kargo.akuity.io/v1alpha1
kind: Warehouse
metadata:
name: httpbin
namespace: httpbin
spec:
interval: 5m0s
subscriptions:
- image:
discoveryLimit: 5
repoURL: quay.io/holos/mccutchen/go-httpbin
semverConstraint: ^2.0.0
strictSemvers: true
transformers:
- kind: Kustomize
inputs:
- resources.gen.yaml
output: projects/httpbin/components/kargo-stages/kargo-stages.gen.yaml
kustomize:
kustomization:
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
labels:
- includeSelectors: false
pairs:
argocd.argoproj.io/instance: httpbin-kargo-stages
resources:
- resources.gen.yaml
- artifact: projects/httpbin/gitops/kargo-stages.application.gen.yaml
generators:
- kind: Resources
output: projects/httpbin/gitops/kargo-stages.application.gen.yaml
resources:
Application:
httpbin-kargo-stages:
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
labels: {}
name: httpbin-kargo-stages
namespace: argocd
spec:
destination:
server: https://kubernetes.default.svc
project: httpbin
source:
path: deploy/projects/httpbin/components/kargo-stages
repoURL: https://github.com/holos-run/kargo-demo.git
targetRevision: main

View File

@@ -1,8 +0,0 @@
{
"exitCode": 1,
"name": "BeforeLabelsAreSubsetOfAfter",
"msg": "should not match when before labels are a subset of after labels",
"file1": "before.yaml",
"file2": "after.yaml",
"expectedErrors": ["+ extra: not-in-before"]
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +0,0 @@
{
"exitCode": 0,
"name": "CompilerShouldMatch",
"msg": "output of the v1alpha6 compiler should match the v1alpha5 output",
"file1": "before.yaml",
"file2": "after.yaml"
}

View File

@@ -1,7 +0,0 @@
kind: BuildPlan
apiVersion: v1alpha5
metadata:
name: component1
spec:
artifacts:
- artifact: test.yaml

View File

@@ -1,15 +0,0 @@
kind: BuildPlan
apiVersion: v1alpha5
metadata:
name: component1
spec:
artifacts:
- artifact: test.yaml
---
kind: BuildPlan
apiVersion: v1alpha5
metadata:
name: component2
spec:
artifacts:
- artifact: test2.yaml

View File

@@ -1,8 +0,0 @@
{
"exitCode": 1,
"name": "BuildPlanFile_1",
"msg": "BuildPlan File spec 1: one and two have an equal number of BuildPlan objects - should fail when count differs",
"file1": "before.yaml",
"file2": "after.yaml",
"expectedErrors": ["different number of documents"]
}

View File

@@ -1,22 +0,0 @@
---
kind: BuildPlan
apiVersion: v1alpha5
metadata:
name: component
spec:
artifacts:
- artifact: component.yaml
generators:
- kind: Kubernetes
output: manifests.yaml
---
kind: BuildPlan
apiVersion: v1alpha5
metadata:
name: component
spec:
artifacts:
- artifact: component.yaml
generators:
- kind: Kubernetes
output: manifests.yaml

View File

@@ -1,22 +0,0 @@
---
kind: BuildPlan
apiVersion: v1alpha5
metadata:
name: component
spec:
artifacts:
- artifact: component.yaml
generators:
- kind: Kubernetes
output: manifests.yaml
---
kind: BuildPlan
apiVersion: v1alpha5
metadata:
name: component
spec:
artifacts:
- artifact: component.yaml
generators:
- kind: Kubernetes
output: manifests.yaml

View File

@@ -1,8 +0,0 @@
{
"exitCode": 0,
"name": "BuildPlanValid_1",
"msg": "BuildPlan File validity 1: Two or more identical objects exist in the same file. They must be treated as unique objects - should match when both files have identical objects",
"file1": "before.yaml",
"file2": "after.yaml",
"expectedErrors": []
}

View File

@@ -1,8 +0,0 @@
{
"exitCode": 1,
"name": "EmptyFiles",
"msg": "empty files should return not implemented error",
"file1": "1.yaml",
"file2": "2.yaml",
"expectedErrors": ["not implemented"]
}

View File

@@ -1,13 +0,0 @@
---
kind: BuildPlan
apiVersion: v1alpha5
metadata:
name: component
labels:
holos.run/component.name: component
spec:
artifacts:
- artifact: component.yaml
generators:
- kind: Kubernetes
output: manifests.yaml

View File

@@ -1,14 +0,0 @@
---
kind: BuildPlan
apiVersion: v1alpha5
metadata:
name: component
labels:
holos.run/component.name: component
holos.run/stack.name: demo
spec:
artifacts:
- artifact: component.yaml
generators:
- kind: Kubernetes
output: manifests.yaml

View File

@@ -1,8 +0,0 @@
{
"exitCode": 1,
"name": "BuildPlan_5",
"msg": "BuildPlan spec 5: Fields in a must always be present in b - should fail when field exists in a but not in b",
"file1": "before.yaml",
"file2": "after.yaml",
"expectedErrors": ["- holos.run/stack.name: demo"]
}

Some files were not shown because too many files have changed in this diff Show More