From b5207821132f9e587b8c85faaaff1f55d64e0ed0 Mon Sep 17 00:00:00 2001 From: Ben Crastnopol Date: Mon, 18 May 2026 14:25:33 -0400 Subject: [PATCH] Add printer columns to RestateCloudEnvironment CRD MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `RestateCloudEnvironment` CRD was the only Restate CRD that didn't declare any `printcolumn`s, so `kube`'s `CustomResourceExt::crd()` emitted `additionalPrinterColumns: []`. This empty-array default is stripped by the k8s API server on apply, which makes downstream GitOps tooling (e.g., ArgoCD) report perpetual drift on the field that no amount of re-syncing can converge. Add three useful printer columns — Environment ID, Region, and Age — mirroring what `RestateCluster` already does. Side benefits: - `kubectl get rce` now shows the environment ID and region directly. - The generated CRD no longer has `additionalPrinterColumns: []`, so the k8s/Helm round-trip is consistent for any consumer of this CRD. Both the Rust source and the regenerated `crd/restatecloudenvironments.yaml` are updated together. --- crd/restatecloudenvironments.yaml | 12 +++++++++++- src/resources/restatecloudenvironments.rs | 5 ++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/crd/restatecloudenvironments.yaml b/crd/restatecloudenvironments.yaml index 8ed3ceb..77df35a 100644 --- a/crd/restatecloudenvironments.yaml +++ b/crd/restatecloudenvironments.yaml @@ -12,7 +12,17 @@ spec: singular: restatecloudenvironment scope: Cluster versions: - - additionalPrinterColumns: [] + - additionalPrinterColumns: + - jsonPath: .spec.environmentId + name: Environment + type: string + - jsonPath: .spec.region + name: Region + type: string + - description: CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC + jsonPath: .metadata.creationTimestamp + name: Age + type: date name: v1beta1 schema: openAPIV3Schema: diff --git a/src/resources/restatecloudenvironments.rs b/src/resources/restatecloudenvironments.rs index e450674..2a6d690 100644 --- a/src/resources/restatecloudenvironments.rs +++ b/src/resources/restatecloudenvironments.rs @@ -19,7 +19,10 @@ pub static RESTATE_CLOUD_ENVIRONMENT_FINALIZER: &str = "cloudenvironments.restat kind = "RestateCloudEnvironment", group = "restate.dev", version = "v1beta1", - schema = "manual" + schema = "manual", + printcolumn = r#"{"name":"Environment", "type":"string", "jsonPath":".spec.environmentId"}"#, + printcolumn = r#"{"name":"Region", "type":"string", "jsonPath":".spec.region"}"#, + printcolumn = r#"{"name":"Age", "description": "CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC", "type":"date", "jsonPath":".metadata.creationTimestamp"}"# )] #[kube(shortname = "rce")] #[serde(rename_all = "camelCase")]