-
Notifications
You must be signed in to change notification settings - Fork 319
Description
As part of moving resources from terraform controllers to direct controllers (Epic #5954), we need to create the Go types for DataflowJob.
Currently, DataflowJob is managed by the Terraform controller (marked with tf2crd=true). The goal is to create the Go types in apis/dataflow/v1beta1/ so that we can eventually migrate the controller implementation to the "direct" approach.
Instructions
-
Add to generate.sh:
Modifyapis/dataflow/v1beta1/generate.shto includeDataflowJob.
It likely maps togoogle.dataflow.v1beta3.Job.
Example:go run . generate-types \ --service google.dataflow.v1beta3 \ --api-version dataflow.cnrm.cloud.google.com/v1beta1 \ --resource DataflowFlexTemplateJob:FlexTemplateRuntimeEnvironment \ --resource DataflowJob:Job -
Generate Scaffolding:
Runapis/dataflow/v1beta1/generate.sh. This should createapis/dataflow/v1beta1/dataflowjob_types.go. -
Iterate on Types:
Compare the generated CRD with the existing one usingdev/tasks/diff-crds.
Modifyapis/dataflow/v1beta1/dataflowjob_types.gountil the CRD matches the existing one atconfig/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_dataflowjobs.dataflow.cnrm.cloud.google.com.yaml.Acceptance Criteria:
- Running
dev/tasks/diff-crdsshould not show differences (or minimal acceptable ones like descriptions). - Changes to the schema (fields added/removed) are NOT acceptable.
- Running
-
Copyright Headers:
Ensure the new file has the correct copyright header:// Copyright 2026 Google LLC -
Labels:
Ensure the controller-runtime annotations match the existing CRD labels, including:// +kubebuilder:metadata:labels="cnrm.cloud.google.com/managed-by-kcc=true" // +kubebuilder:metadata:labels="cnrm.cloud.google.com/system=true" // +kubebuilder:metadata:labels="cnrm.cloud.google.com/stability-level=stable" // +kubebuilder:metadata:labels="cnrm.cloud.google.com/tf2crd=true"
-
Status:
status.observedGenerationshould be anint64.
This issue is part of Epic #5954.