Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
9392a3c
feat: implement datumctl compute CLI plugin
scotwells May 22, 2026
0f4a88e
fix: use default namespace and correct instance type in compute commands
scotwells May 22, 2026
fd50779
fix: remove datumctl SDK dependency and fix CI Go version
scotwells May 22, 2026
acf5a2f
feat: add datumctl plugin SDK and upgrade controller-runtime to v0.23.3
scotwells May 22, 2026
3d28d08
fix: resolve golangci-lint issues surfaced by v2.12.2 upgrade
scotwells May 22, 2026
3590106
fix: address remaining lint issues missed in previous pass
scotwells May 22, 2026
65b8f86
fix: suppress errcheck for CLI output and resolve remaining lint issues
scotwells May 22, 2026
3c274e6
feat: add shell autocompletion for workload-name arguments
scotwells May 22, 2026
77bae17
feat: surface flags on plain Tab for deploy command
scotwells May 26, 2026
9c2e9df
feat: make CSI webhook cert component generic, patch issuer per overlay
scotwells May 26, 2026
e03d15f
refactor: move webhook cert issuer patch to infra repo
scotwells May 26, 2026
bfe3f44
feat: add util.PrintJSON/PrintYAML helpers and completion functions
scotwells May 27, 2026
f772863
feat: add -o table|wide|json|yaml to instances and quota commands
scotwells May 27, 2026
c5ff3aa
feat: add workloads command group and remove status command
scotwells May 27, 2026
886e8db
fix: replace interface{} with any in printer helpers
scotwells May 27, 2026
ba48aa1
fix: address code review findings in workloads and instances commands
scotwells May 27, 2026
ac044f7
feat: add network preflight check with interactive create prompt
scotwells May 28, 2026
d8486ec
feat: add entitlement check and rewrite quota against AllowanceBucket…
scotwells May 28, 2026
4f0cd81
feat: rewrite entitlement check with typed client-go watch
scotwells May 28, 2026
42f2dd7
feat: register networking scheme in datumctl compute client
scotwells May 29, 2026
e604260
refactor: remove client-side revision history from compute CLI
scotwells May 29, 2026
4aa7d40
fix: pin network-services-operator and milo deps to match federated-s…
scotwells May 29, 2026
8c15212
fix: restore ValidateCreate and truncated webhook body lost in rebase…
scotwells May 29, 2026
291f5a4
feat: Read instance city and workload from labels in CLI
scotwells May 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '~1.25.0'
go-version-file: 'go.mod'

- name: Run linter
uses: golangci/golangci-lint-action@v8
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '~1.25.0'
go-version-file: 'go.mod'

- name: Install the latest version of kind
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '~1.25.0'
go-version-file: 'go.mod'

- name: Running Tests
run: |
Expand Down
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ linters:
- linters:
- prealloc
path: internal/controller/instancecontrol/
- linters:
- errcheck
path: internal/cmd/.*
paths:
- third_party$
- builtin$
Expand Down
51 changes: 51 additions & 0 deletions .goreleaser-plugin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
version: 2

project_name: datumctl-compute

before:
hooks:
- go mod tidy

builds:
- id: datumctl-compute
binary: datumctl-compute
main: ./cmd/datumctl-compute
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
- windows
goarch:
- amd64
- arm64
ldflags:
- "-X main.version=v{{.Version}}"

archives:
- id: datumctl-compute
builds:
- datumctl-compute
format: tar.gz
name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
format_overrides:
- goos: windows
format: zip

checksum:
name_template: "checksums.txt"

changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
- "^chore:"
20 changes: 20 additions & 0 deletions api/v1alpha/labels.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,26 @@ const (

WorkloadUIDLabel = LabelNamespace + "/workload-uid"
WorkloadDeploymentUIDLabel = LabelNamespace + "/workload-deployment-uid"
// WorkloadDeploymentNameLabel carries the WorkloadDeployment name on each
// Instance. Unlike WorkloadDeploymentUIDLabel — which carries the
// edge/Karmada UID and therefore differs across federation planes —
// WorkloadDeploymentNameLabel is identical in the project cluster, Karmada,
// and on the edge, making it safe for cross-plane owner-ref resolution and
// CLI lookup.
WorkloadDeploymentNameLabel = LabelNamespace + "/workload-deployment-name"

InstanceIndexLabel = LabelNamespace + "/instance-index"

// CityCodeLabel carries the city code (e.g. "DFW") that the Instance is
// scheduled to. Stamped at creation time and immutable.
CityCodeLabel = LabelNamespace + "/city-code"

// WorkloadNameLabel carries the name of the Workload that owns this
// Instance. Stamped at creation time and immutable.
WorkloadNameLabel = LabelNamespace + "/workload-name"

// PlacementNameLabel carries the name of the placement entry within the
// Workload spec that produced this Instance. Stamped at creation time and
// immutable.
PlacementNameLabel = LabelNamespace + "/placement-name"
)
26 changes: 26 additions & 0 deletions cmd/datumctl-compute/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package main

import (
"os"

"go.datum.net/datumctl/plugin"

"go.datum.net/compute/internal/cmd/compute"
)

// version is set at build time via ldflags.
var version = "dev"

func main() {
plugin.ServeManifest(plugin.Manifest{
Name: "compute",
Version: version,
Description: "Deploy and manage containerized workloads on Datum Cloud",
APIVersion: 1,
MinAPIVersion: 1,
})

if err := compute.Command().Execute(); err != nil {
os.Exit(1)
}
}
107 changes: 60 additions & 47 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,58 +1,73 @@
module go.datum.net/compute

go 1.25.0
go 1.25.8

require (
github.com/go-logr/logr v1.4.3
github.com/google/go-cmp v0.7.0
github.com/karmada-io/api v1.15.0
github.com/karmada-io/api v1.17.0
github.com/onsi/ginkgo/v2 v2.27.2
github.com/onsi/gomega v1.38.2
github.com/spf13/cobra v1.10.2
github.com/stretchr/testify v1.11.1
go.datum.net/datumctl v0.14.1-0.20260523153711-b44de1c715c1
go.datum.net/network-services-operator v0.21.10-0.20260528021428-b0f2347f5359
go.miloapis.com/milo v0.25.2-0.20260528192736-e4258524ad42
golang.org/x/crypto v0.45.0
golang.org/x/sync v0.18.0
go.miloapis.com/milo v0.26.1-0.20260527023322-a78982bd81f2
go.miloapis.com/service-catalog v0.0.0-20260529025310-809b6c6e4d91
golang.org/x/crypto v0.49.0
golang.org/x/sync v0.20.0
golang.org/x/term v0.43.0
google.golang.org/protobuf v1.36.11
k8s.io/api v0.35.0
k8s.io/apimachinery v0.35.0
k8s.io/client-go v0.35.0
k8s.io/utils v0.0.0-20251002143259-bc988d571ff4
k8s.io/api v0.35.3
k8s.io/apimachinery v0.35.3
k8s.io/client-go v0.35.3
k8s.io/utils v0.0.0-20260319190234-28399d86e0b5
sigs.k8s.io/controller-runtime v0.23.3
sigs.k8s.io/gateway-api v1.3.1-0.20250527223622-54df0a899c1c
sigs.k8s.io/multicluster-runtime v0.23.3
sigs.k8s.io/yaml v1.6.0
)

require (
cel.dev/expr v0.24.0 // indirect
cel.dev/expr v0.25.1 // indirect
github.com/Masterminds/semver/v3 v3.4.0 // indirect
github.com/antlr4-go/antlr/v4 v4.13.1 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/emicklei/go-restful/v3 v3.12.2 // indirect
github.com/emicklei/go-restful/v3 v3.13.0 // indirect
github.com/evanphx/json-patch/v5 v5.9.11 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fsnotify/fsnotify v1.9.0 // indirect
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
github.com/go-logr/logr v1.4.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-logr/zapr v1.3.0 // indirect
github.com/go-openapi/jsonpointer v0.21.1 // indirect
github.com/go-openapi/jsonreference v0.21.0 // indirect
github.com/go-openapi/swag v0.23.1 // indirect
github.com/go-openapi/jsonpointer v0.22.4 // indirect
github.com/go-openapi/jsonreference v0.21.4 // indirect
github.com/go-openapi/swag v0.25.4 // indirect
github.com/go-openapi/swag/cmdutils v0.25.4 // indirect
github.com/go-openapi/swag/conv v0.25.4 // indirect
github.com/go-openapi/swag/fileutils v0.25.4 // indirect
github.com/go-openapi/swag/jsonname v0.25.4 // indirect
github.com/go-openapi/swag/jsonutils v0.25.4 // indirect
github.com/go-openapi/swag/loading v0.25.4 // indirect
github.com/go-openapi/swag/mangling v0.25.4 // indirect
github.com/go-openapi/swag/netutils v0.25.4 // indirect
github.com/go-openapi/swag/stringutils v0.25.4 // indirect
github.com/go-openapi/swag/typeutils v0.25.4 // indirect
github.com/go-openapi/swag/yamlutils v0.25.4 // indirect
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
github.com/google/btree v1.1.3 // indirect
github.com/google/cel-go v0.26.0 // indirect
github.com/google/gnostic-models v0.7.0 // indirect
github.com/google/cel-go v0.27.0 // indirect
github.com/google/gnostic-models v0.7.1 // indirect
github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.1 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.9.0 // indirect
github.com/klauspost/compress v1.18.3 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
Expand All @@ -61,47 +76,45 @@ require (
github.com/prometheus/client_model v0.6.2 // indirect
github.com/prometheus/common v0.66.1 // indirect
github.com/prometheus/procfs v0.17.0 // indirect
github.com/spf13/cobra v1.10.0 // indirect
github.com/spf13/pflag v1.0.9 // indirect
github.com/stoewer/go-strcase v1.3.1 // indirect
github.com/spf13/pflag v1.0.10 // indirect
github.com/x448/float16 v0.8.4 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.62.0 // indirect
go.opentelemetry.io/otel v1.37.0 // indirect
go.opentelemetry.io/otel v1.40.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.37.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.35.0 // indirect
go.opentelemetry.io/otel/metric v1.37.0 // indirect
go.opentelemetry.io/otel/sdk v1.37.0 // indirect
go.opentelemetry.io/otel/trace v1.37.0 // indirect
go.opentelemetry.io/proto/otlp v1.7.1 // indirect
go.opentelemetry.io/otel/metric v1.40.0 // indirect
go.opentelemetry.io/otel/sdk v1.40.0 // indirect
go.opentelemetry.io/otel/trace v1.40.0 // indirect
go.opentelemetry.io/proto/otlp v1.9.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
go.uber.org/zap v1.27.1 // indirect
go.yaml.in/yaml/v2 v2.4.3 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/exp v0.0.0-20250718183923-645b1fa84792 // indirect
golang.org/x/mod v0.29.0 // indirect
golang.org/x/net v0.47.0 // indirect
golang.org/x/oauth2 v0.30.0 // indirect
golang.org/x/sys v0.38.0 // indirect
golang.org/x/term v0.37.0 // indirect
golang.org/x/text v0.31.0 // indirect
golang.org/x/time v0.12.0 // indirect
golang.org/x/tools v0.38.0 // indirect
golang.org/x/mod v0.35.0 // indirect
golang.org/x/net v0.52.0 // indirect
golang.org/x/oauth2 v0.36.0 // indirect
golang.org/x/sys v0.44.0 // indirect
golang.org/x/text v0.35.0 // indirect
golang.org/x/time v0.15.0 // indirect
golang.org/x/tools v0.43.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.5.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20250728155136-f173205681a0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250728155136-f173205681a0 // indirect
google.golang.org/grpc v1.74.2 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20260319201613-d00831a3d3e7 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260311181403-84a4fc48630c // indirect
google.golang.org/grpc v1.79.3 // indirect
gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.35.0 // indirect
k8s.io/apiserver v0.35.0 // indirect
k8s.io/component-base v0.35.0 // indirect
k8s.io/apiextensions-apiserver v0.35.3 // indirect
k8s.io/apiserver v0.35.3 // indirect
k8s.io/component-base v0.35.3 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912 // indirect
k8s.io/kube-openapi v0.0.0-20260330154417-16be699c7b31 // indirect
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2 // indirect
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect
sigs.k8s.io/randfill v1.0.0 // indirect
sigs.k8s.io/structured-merge-diff/v6 v6.3.2-0.20260122202528-d9cc6641c482 // indirect
sigs.k8s.io/yaml v1.6.0 // indirect
sigs.k8s.io/structured-merge-diff/v6 v6.3.2 // indirect
)

replace go.miloapis.com/milo => go.miloapis.com/milo v0.25.2-0.20260528192736-e4258524ad42
Loading
Loading