Skip to content

Commit 68aaf00

Browse files
authored
Add baseline CoderControlPlane controller-runtime scaffolding (#2)
## Summary Adds baseline controller-runtime scaffolding for a new `CoderControlPlane` API and controller. ### Changes - Added `api/v1alpha1` package with group/version registration and `CoderControlPlane` types. - Generated deepcopy methods for the new API types. - Added `internal/controller/CoderControlPlaneReconciler` scaffold with no-op reconcile flow and RBAC markers. - Replaced hello-world `main.go` with controller-runtime manager bootstrap and reconciler wiring. - Replaced hello-world tests with scaffold smoke tests for scheme registration and defensive setup assertions. - Replaced placeholder `make codegen` target with a repeatable vendored deepcopy generator script. ### Validation - `make codegen` - `make test` - `make build` - `make verify-vendor` --- <details> <summary>📋 Implementation Plan</summary> # Plan: Add baseline `CoderControlPlane` controller-runtime scaffolding ## Context / Why The repository is currently a bootstrap "hello world" binary. This PR should introduce a **minimal but extensible** controller-runtime scaffold for a new resource `CoderControlPlane` with only placeholder API fields (`spec.image` and a placeholder status field). The goal is to create a clean template that future PRs can copy for additional resources/controllers, without prematurely adding business logic. ## Evidence - **Sub-agent report `349d2b2a6f`**: no existing API types/CRDs/controllers; recommended `api/v1alpha1` + controller skeleton layout. - **Sub-agent report `7e4a92efeb`**: no manager/controller wiring yet; `main.go` is still hello-world and needs controller-runtime manager setup. - **`main.go` (lines 1-16)**: prints `hello world`; no Kubernetes manager bootstrap. - **`main_test.go` (lines 1-11)**: only tests `helloMessage()`. - **`Makefile` (lines 1-28)**: has vendor/test/build plus placeholder `codegen` echo target. - **`go.mod` (lines 5-10)**: already includes `sigs.k8s.io/controller-runtime`, `k8s.io/apimachinery`, and `k8s.io/client-go`, so baseline deps for scaffolding are present. - **Repo tree**: no `api/`, `internal/controller/`, or `config/` scaffold exists yet. These sources are sufficient because they confirm this PR must establish first-time scaffolding rather than extending existing controller code. ## Implementation details (ordered) 1. **Create API group/version package for CR registration** - Add `api/v1alpha1/doc.go` and `api/v1alpha1/groupversion_info.go`. - Define `GroupVersion`, `SchemeBuilder`, and `AddToScheme` so future resources can register in the same package. - Keep this package intentionally reusable for additional resource types. ```go // api/v1alpha1/groupversion_info.go package v1alpha1 var ( GroupVersion = schema.GroupVersion{Group: "coder.com", Version: "v1alpha1"} SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} AddToScheme = SchemeBuilder.AddToScheme ) ``` 2. **Add `CoderControlPlane` API type with placeholder spec/status** - Add `api/v1alpha1/codercontrolplane_types.go` containing: - `CoderControlPlaneSpec` with placeholder field: - `Image string \`json:"image,omitempty"\`` - `CoderControlPlaneStatus` with a placeholder (e.g. `Phase string`). - Root/list objects (`CoderControlPlane`, `CoderControlPlaneList`). - Include kubebuilder markers (`object:root`, `subresource:status`) so this shape can become CRD/RBAC generation input later. - Ensure types are registered via `SchemeBuilder.Register(...)`. ```go type CoderControlPlaneSpec struct { Image string `json:"image,omitempty"` } type CoderControlPlaneStatus struct { Phase string `json:"phase,omitempty"` } ``` 3. **Add controller skeleton with no-op reconcile** - Add `internal/controller/codercontrolplane_controller.go` with: - `CoderControlPlaneReconciler` struct (`client.Client`, `Scheme *runtime.Scheme`). - `Reconcile(ctx, req)` that fetches the object and exits without business logic. - `SetupWithManager(mgr)` using `For(&v1alpha1.CoderControlPlane{})`. - RBAC markers for base resource/status/finalizers. - Include explicit TODO comments for future extension points (finalizers, status progression, child resources). - Keep defensive checks in setup/reconcile paths (fail fast on impossible states, consistent with repository style). ```go func (r *CoderControlPlaneReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { cp := &coderv1alpha1.CoderControlPlane{} if err := r.Get(ctx, req.NamespacedName, cp); err != nil { return ctrl.Result{}, client.IgnoreNotFound(err) } // TODO: add reconciliation logic in follow-up PRs. return ctrl.Result{}, nil } ``` 4. **Replace hello-world entrypoint with manager wiring** - Update `main.go` to initialize a controller-runtime manager: - Build scheme and register `client-go` built-ins + `api/v1alpha1`. - Construct manager from in-cluster/kubeconfig. - Register `CoderControlPlaneReconciler`. - Start manager with signal handler. - Remove `helloMessage()` usage from runtime path; convert to standard controller bootstrap logging/error handling. ```go if err := coderv1alpha1.AddToScheme(scheme); err != nil { setupLog.Error(err, "unable to add Coder API to scheme") os.Exit(1) } if err := (&controller.CoderControlPlaneReconciler{Client: mgr.GetClient(), Scheme: mgr.GetScheme()}).SetupWithManager(mgr); err != nil { setupLog.Error(err, "unable to create controller", "controller", "CoderControlPlane") os.Exit(1) } ``` 5. **Update tests from hello-world to scaffold smoke checks** - Replace/remove `main_test.go` hello-world assertion. - Add minimal compile/smoke-focused tests for the new scaffold (e.g., scheme registration test for `CoderControlPlane` GVK, optional lightweight setup test). - Keep tests intentionally light for this scaffolding PR; defer envtest-heavy behavior checks to follow-ups. 6. **Tighten build/codegen ergonomics just enough for repeatability** - Update `Makefile` so `codegen` is no longer a placeholder message; make it run whichever generation step is chosen for this PR (at minimum deepcopy generation workflow or explicit TODO-backed command stub used by CI/docs). - Keep changes minimal: enough to make adding the *next* resource/controller follow a repeatable pattern. <details> <summary>Why keep this minimal?</summary> This PR’s purpose is structural scaffolding. Avoid introducing broad deployment manifests or full envtest harness unless strictly required for compilation/testing. The next PRs can incrementally add richer generation, manifests, and reconcile behavior. </details> ## Validation plan - Run formatting/import fixes on touched Go files. - Run `make test`. - Run `make build`. - If `codegen` is updated in this PR, run `make codegen` and ensure generated artifacts are committed and `make test` still passes. ## Out of scope for this PR - Non-placeholder spec/status semantics. - Finalizer workflows, child resource orchestration, rollout logic. - Production-grade status conditions/events. - Multi-resource controller abstractions beyond what is needed to establish the template layout. </details> --- _Generated with [`mux`](https://github.com/coder/mux) • Model: `openai:gpt-5.3-codex` • Thinking: `xhigh`_
1 parent c19721b commit 68aaf00

989 files changed

Lines changed: 146706 additions & 13 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ verify-vendor:
2424
git diff --exit-code -- go.mod go.sum vendor/
2525

2626
codegen: $(VENDOR_STAMP)
27-
@echo "Run k8s.io/code-generator scripts from ./vendor once API packages exist"
27+
bash ./hack/update-codegen.sh
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
package v1alpha1
2+
3+
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
4+
5+
// CoderControlPlaneSpec defines the desired state of a CoderControlPlane.
6+
type CoderControlPlaneSpec struct {
7+
// Image is the placeholder container image for the control plane deployment.
8+
Image string `json:"image,omitempty"`
9+
}
10+
11+
// CoderControlPlaneStatus defines the observed state of a CoderControlPlane.
12+
type CoderControlPlaneStatus struct {
13+
// Phase is a placeholder status field for future reconciliation stages.
14+
Phase string `json:"phase,omitempty"`
15+
}
16+
17+
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
18+
// +kubebuilder:object:root=true
19+
// +kubebuilder:resource:scope=Namespaced
20+
// +kubebuilder:subresource:status
21+
22+
// CoderControlPlane is the schema for Coder control plane resources.
23+
type CoderControlPlane struct {
24+
metav1.TypeMeta `json:",inline"`
25+
metav1.ObjectMeta `json:"metadata,omitempty"`
26+
27+
Spec CoderControlPlaneSpec `json:"spec,omitempty"`
28+
Status CoderControlPlaneStatus `json:"status,omitempty"`
29+
}
30+
31+
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
32+
// +kubebuilder:object:root=true
33+
34+
// CoderControlPlaneList contains a list of CoderControlPlane objects.
35+
type CoderControlPlaneList struct {
36+
metav1.TypeMeta `json:",inline"`
37+
metav1.ListMeta `json:"metadata,omitempty"`
38+
Items []CoderControlPlane `json:"items"`
39+
}
40+
41+
func init() {
42+
SchemeBuilder.Register(&CoderControlPlane{}, &CoderControlPlaneList{})
43+
}

api/v1alpha1/doc.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// Package v1alpha1 contains API schema definitions for the coder.com API group.
2+
//
3+
// +k8s:deepcopy-gen=package
4+
// +groupName=coder.com
5+
package v1alpha1

api/v1alpha1/groupversion_info.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package v1alpha1
2+
3+
import (
4+
"k8s.io/apimachinery/pkg/runtime/schema"
5+
"sigs.k8s.io/controller-runtime/pkg/scheme"
6+
)
7+
8+
var (
9+
// GroupVersion is group version used to register these objects.
10+
GroupVersion = schema.GroupVersion{Group: "coder.com", Version: "v1alpha1"}
11+
12+
// SchemeBuilder is used to add go types to the GroupVersionKind scheme.
13+
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
14+
15+
// AddToScheme adds the types in this group-version to the provided scheme.
16+
AddToScheme = SchemeBuilder.AddToScheme
17+
)

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 103 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go.mod

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,37 @@ require (
1010
)
1111

1212
require (
13+
github.com/beorn7/perks v1.0.1 // indirect
14+
github.com/cespare/xxhash/v2 v2.3.0 // indirect
1315
github.com/davecgh/go-spew v1.1.1 // indirect
1416
github.com/emicklei/go-restful/v3 v3.12.2 // indirect
1517
github.com/evanphx/json-patch/v5 v5.9.11 // indirect
18+
github.com/fsnotify/fsnotify v1.9.0 // indirect
1619
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
1720
github.com/go-logr/logr v1.4.3 // indirect
21+
github.com/go-logr/zapr v1.3.0 // indirect
1822
github.com/go-openapi/jsonpointer v0.21.0 // indirect
1923
github.com/go-openapi/jsonreference v0.20.2 // indirect
2024
github.com/go-openapi/swag v0.23.0 // indirect
25+
github.com/google/btree v1.1.3 // indirect
2126
github.com/google/gnostic-models v0.7.0 // indirect
27+
github.com/google/go-cmp v0.7.0 // indirect
2228
github.com/google/uuid v1.6.0 // indirect
2329
github.com/josharian/intern v1.0.0 // indirect
2430
github.com/json-iterator/go v1.1.12 // indirect
2531
github.com/mailru/easyjson v0.7.7 // indirect
2632
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
2733
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
2834
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
35+
github.com/pmezard/go-difflib v1.0.0 // indirect
36+
github.com/prometheus/client_golang v1.23.2 // indirect
37+
github.com/prometheus/client_model v0.6.2 // indirect
38+
github.com/prometheus/common v0.66.1 // indirect
39+
github.com/prometheus/procfs v0.16.1 // indirect
2940
github.com/spf13/pflag v1.0.9 // indirect
3041
github.com/x448/float16 v0.8.4 // indirect
42+
go.uber.org/multierr v1.11.0 // indirect
43+
go.uber.org/zap v1.27.0 // indirect
3144
go.yaml.in/yaml/v2 v2.4.3 // indirect
3245
go.yaml.in/yaml/v3 v3.0.4 // indirect
3346
golang.org/x/mod v0.29.0 // indirect
@@ -39,11 +52,13 @@ require (
3952
golang.org/x/text v0.31.0 // indirect
4053
golang.org/x/time v0.9.0 // indirect
4154
golang.org/x/tools v0.38.0 // indirect
55+
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
4256
google.golang.org/protobuf v1.36.8 // indirect
4357
gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect
4458
gopkg.in/inf.v0 v0.9.1 // indirect
4559
gopkg.in/yaml.v3 v3.0.1 // indirect
4660
k8s.io/api v0.35.0 // indirect
61+
k8s.io/apiextensions-apiserver v0.35.0 // indirect
4762
k8s.io/gengo/v2 v2.0.0-20250922181213-ec3ebc5fd46b // indirect
4863
k8s.io/klog/v2 v2.130.1 // indirect
4964
k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912 // indirect

go.sum

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
1010
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
1111
github.com/emicklei/go-restful/v3 v3.12.2 h1:DhwDP0vY3k8ZzE0RunuJy8GhNpPL6zqLkDf9B/a0/xU=
1212
github.com/emicklei/go-restful/v3 v3.12.2/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
13+
github.com/evanphx/json-patch v0.5.2 h1:xVCHIVMUu1wtM/VkR9jVZ45N3FhZfYMMYGorLCR8P3k=
14+
github.com/evanphx/json-patch v0.5.2/go.mod h1:ZWS5hhDbVDyob71nXKNL0+PWn6ToqBHMikGIFbs31qQ=
1315
github.com/evanphx/json-patch/v5 v5.9.11 h1:/8HVnzMq13/3x9TPvjG08wUGqBTmZBsCWzjTM0wiaDU=
1416
github.com/evanphx/json-patch/v5 v5.9.11/go.mod h1:3j+LviiESTElxA4p3EMKAB9HXj3/XEtnUf6OZxqIQTM=
17+
github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=
18+
github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
1519
github.com/fxamacker/cbor/v2 v2.9.0 h1:NpKPmjDBgUfBms6tr6JZkTHtfFGcMKsw3eGcmD/sapM=
1620
github.com/fxamacker/cbor/v2 v2.9.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ=
1721
github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
@@ -28,11 +32,15 @@ github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+Gr
2832
github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ=
2933
github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI=
3034
github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8=
35+
github.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg=
36+
github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4=
3137
github.com/google/gnostic-models v0.7.0 h1:qwTtogB15McXDaNqTZdzPJRHvaVJlAl+HVQnLmJEJxo=
3238
github.com/google/gnostic-models v0.7.0/go.mod h1:whL5G0m6dmc5cPxKc5bdKdEN3UjI7OUGxBlw57miDrQ=
3339
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
3440
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
3541
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
42+
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
43+
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
3644
github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 h1:BHT72Gu3keYf3ZEu2J0b1vyeLSOYI8bm5wbJM/8yDe8=
3745
github.com/google/pprof v0.0.0-20250403155104-27863c87afa6/go.mod h1:boTsfXsheKC2y+lKOCMpSfarhxDeIzfZG1jqGcPl3cA=
3846
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
@@ -41,13 +49,17 @@ github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8Hm
4149
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
4250
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
4351
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
52+
github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo=
53+
github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ=
4454
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
4555
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
4656
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
4757
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
4858
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
4959
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
5060
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
61+
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
62+
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
5163
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
5264
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
5365
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
@@ -62,6 +74,8 @@ github.com/onsi/ginkgo/v2 v2.27.2 h1:LzwLj0b89qtIy6SSASkzlNvX6WktqurSHwkk2ipF/Ns
6274
github.com/onsi/ginkgo/v2 v2.27.2/go.mod h1:ArE1D/XhNXBXCBkKOLkbsb2c81dQHCRcF5zwn/ykDRo=
6375
github.com/onsi/gomega v1.38.2 h1:eZCjf2xjZAqe+LeWvKb5weQ+NcPwX84kqJ0cZNxok2A=
6476
github.com/onsi/gomega v1.38.2/go.mod h1:W2MJcYxRGV63b418Ai34Ud0hEdTVXq9NW9+Sx6uXf3k=
77+
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
78+
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
6579
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
6680
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
6781
github.com/prometheus/client_golang v1.23.2 h1:Je96obch5RDVy3FDMndoUsjAhG5Edi49h0RJWRi/o0o=
@@ -89,6 +103,8 @@ github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu
89103
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
90104
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
91105
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
106+
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
107+
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
92108
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
93109
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
94110
go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
@@ -119,6 +135,8 @@ golang.org/x/tools/go/expect v0.1.1-deprecated h1:jpBZDwmgPhXsKZC6WhL20P4b/wmnps
119135
golang.org/x/tools/go/expect v0.1.1-deprecated/go.mod h1:eihoPOH+FgIqa3FpoTwguz/bVUSGBlGQU67vpBeOrBY=
120136
golang.org/x/tools/go/packages/packagestest v0.1.1-deprecated h1:1h2MnaIAIXISqTFKdENegdpAgUXz6NrPEsbIeWaBRvM=
121137
golang.org/x/tools/go/packages/packagestest v0.1.1-deprecated/go.mod h1:RVAQXBGNv1ib0J382/DPCRS/BPnsGebyM1Gj5VSDpG8=
138+
gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw=
139+
gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY=
122140
google.golang.org/protobuf v1.36.8 h1:xHScyCOEuuwZEc6UtSOvPbAT4zRh0xcNRYekJwfqyMc=
123141
google.golang.org/protobuf v1.36.8/go.mod h1:fuxRtAxBytpl4zzqUh6/eyUujkJdNiuEkXntxiD/uRU=
124142
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=

hack/update-codegen.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
SCRIPT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
5+
6+
if [[ ! -d "${SCRIPT_ROOT}/api/v1alpha1" ]]; then
7+
echo "assertion failed: expected API package at ${SCRIPT_ROOT}/api/v1alpha1" >&2
8+
exit 1
9+
fi
10+
11+
INPUT_PKG="$(cd "${SCRIPT_ROOT}" && GOFLAGS=-mod=vendor go list ./api/v1alpha1)"
12+
if [[ -z "${INPUT_PKG}" ]]; then
13+
echo "assertion failed: go list returned empty package path for ./api/v1alpha1" >&2
14+
exit 1
15+
fi
16+
17+
cd "${SCRIPT_ROOT}"
18+
GOFLAGS=-mod=vendor go run ./vendor/k8s.io/code-generator/cmd/deepcopy-gen \
19+
--output-file zz_generated.deepcopy.go \
20+
--go-header-file /dev/null \
21+
"${INPUT_PKG}"

0 commit comments

Comments
 (0)