Skip to content

Commit 0feadc4

Browse files
authored
Greenfield: Implement direct controller, E2E fixtures, and fuzzer for VideoStitcherCDNKey (#11185)
# Description This Pull Request implements the direct controller, E2E test fixtures, and schema round-trip fuzzer for the Greenfield resource `VideoStitcherCDNKey`. ## Implementation Details 1. **Direct Controller**: - Implemented `pkg/controller/direct/videostitcher/videostitchercdnkey_controller.go` to handle resource lifecycle operations: `Find`, `Create`, `Update`, `Delete`, and `Export` via the official Google Cloud Go Video Stitcher REST/gRPC client library. - Leveraged top-level field diffing using the `tags` package for robust in-place updates. - Automatically registered the direct controller model and mapped resources. 2. **Mapper & Code Generation**: - Modified `generate.sh` in the API group directory to enable automatic mapping. - Generated conversion code (`mapper.generated.go`) to convert between the KRM spec and the GCP proto representation. 3. **Schema Round-Trip Fuzzer**: - Implemented `videostitchercdnkey_fuzzer.go` to register the KRM schema fuzzer. - Hand-wrote `videostitchercdnkey_fuzzer_test.go` and verified the translation layer for zero-data-loss and full compatibility. 4. **E2E Test Fixtures**: - Scaffolds both `minimal` and `maximal` test cases under `pkg/test/resourcefixture/testdata/basic/videostitcher/` to verify CRUD lifecycle. --- Fixes #11178 This PR was generated by the **overseer,overseer,greenfield,step/controller** agent (powered by the gemini-3.5-flash model).
2 parents 93b9712 + 0807a0d commit 0feadc4

15 files changed

Lines changed: 574 additions & 6 deletions

File tree

apis/videostitcher/v1alpha1/generate.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ go run . generate-types \
2828
--api-version videostitcher.cnrm.cloud.google.com/v1alpha1 \
2929
--resource VideoStitcherCDNKey:CdnKey
3030

31-
# Note: We do not run generate-mapper here as this PR is for types/CRD/Identity only.
31+
go run . generate-mapper \
32+
--service google.cloud.video.stitcher.v1 \
33+
--api-version videostitcher.cnrm.cloud.google.com/v1alpha1
3234

3335
cd ${REPO_ROOT}
3436
dev/tasks/generate-crds
37+
38+
go run -mod=readonly golang.org/x/tools/cmd/goimports@${GOLANG_X_TOOLS_VERSION} -w pkg/controller/direct/videostitcher/

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ require (
8585
cloud.google.com/go/spanner v1.91.0
8686
cloud.google.com/go/speech v1.35.0
8787
cloud.google.com/go/storage v1.62.0
88+
cloud.google.com/go/video v1.32.0
8889
cloud.google.com/go/vmwareengine v1.8.0
8990
cloud.google.com/go/workflows v1.19.0
9091
cloud.google.com/go/workstations v1.1.6

go.sum

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

pkg/controller/direct/register/register.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ import (
118118
_ "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/controller/direct/vertexai"
119119
_ "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/controller/direct/vertexai/examplestore"
120120
_ "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/controller/direct/vertexai/featuregroup"
121+
_ "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/controller/direct/videostitcher"
121122
_ "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/controller/direct/vmwareengine"
122123
_ "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/controller/direct/workflowexecutions"
123124
_ "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/controller/direct/workflows"

pkg/controller/direct/videostitcher/mapper.generated.go

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

0 commit comments

Comments
 (0)