Skip to content

[Blocked on all other GA PRs, will go last] CRD Rename#294

Draft
carlydf wants to merge 6 commits intocrd-renamefrom
crd-rename-changes
Draft

[Blocked on all other GA PRs, will go last] CRD Rename#294
carlydf wants to merge 6 commits intocrd-renamefrom
crd-rename-changes

Conversation

@carlydf
Copy link
Copy Markdown
Collaborator

@carlydf carlydf commented Apr 23, 2026

What was changed

Not ready for review :)

Why?

Checklist

  1. Closes

  2. How was this tested:

  1. Any docs updates needed?

carlydf and others added 6 commits April 23, 2026 15:02
…Connection

Primary CRD types drop the redundant Temporal prefix. Deprecated stubs
(TemporalWorkerDeployment, TemporalConnection) are kept as minimal structs
with CEL create-rejection to block new creates during the migration window.

Key changes:
- api/v1alpha1: rename primary types, move deprecated stubs to separate files,
  add WRT dual-field (workerDeploymentRef + temporalWorkerDeploymentRef) with
  EffectiveWorkerDeploymentName() resolver, update zz_generated.deepcopy.go
- workerdeployment_webhook.go: renamed from temporalworker_webhook.go, paths
  updated to /mutate|validate-temporal-io-v1alpha1-workerdeployment
- internal/controller: rename reconciler struct/fields; add DeprecatedTWDReconciler
  (sets Ready=False with one of three reasons; never touches Temporal APIs);
  add migrateFromDeprecatedTWD() that patches Deployment and WRT ownerRefs from
  deprecated TWD UID to new WD UID, then labels the TWD as migrated
- internal/k8s, planner, temporal, defaults: update all type references

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… update RBAC/webhook

CRD chart (temporal-worker-controller-crds):
- Add temporal.io_workerdeployments.yaml and temporal.io_connections.yaml
  (full schemas, short names: wd/wdeployment and conn)
- Simplify deprecated temporal.io_temporalworkerdeployments.yaml and
  temporal.io_temporalconnections.yaml: minimal spec schema with
  x-kubernetes-preserve-unknown-fields, CEL rule (oldSelf != null) to reject
  new creates while allowing updates/deletes
- Update temporal.io_workerresourcetemplates.yaml: add workerDeploymentRef
  field alongside temporalWorkerDeploymentRef (dual-field migration support)
- Archive original full-schema deprecated CRDs to deprecated/ for reference
- Bump chart version to 0.25.0

Controller chart (temporal-worker-controller):
- rbac.yaml: add manager ClusterRole rules for workerdeployments/connections
  primary resources; add workerdeployment-editor/viewer and connection-
  editor/viewer ClusterRoles; keep deprecated temporalworkerdeployment and
  temporalconnection roles for migration window; fix temporal.io.temporal.io
  apiGroup typo in old editor/viewer roles
- webhook.yaml: replace old twd-validating-webhook with wd-mutating-webhook
  and wd-validating-webhook pointing at updated /workerdeployment paths
- Bump chart version to 0.25.0

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Renamed/deleted:
- temporalworker_webhook_test.go → workerdeployment_webhook_test.go
- temporalworkerdeployment_cel_validation_test.go → workerdeployment_cel_validation_test.go

Updated throughout: type references (TWD→WorkerDeployment, TC→Connection),
makeTWD helpers, kind strings, field names.

New in deprecated_reconciler_test.go:
- DeprecatedTWDReconciler: three condition-state unit tests (Deprecated,
  WorkerDeploymentExists, MigratedToWorkerDeployment) + not-found no-op
- migrateFromDeprecatedTWD: transfers Deployment and WRT ownerRefs from
  deprecated TWD UID to new WD UID; skips if already migrated; leaves
  unrelated Deployments untouched

New in workerresourcetemplate_webhook_test.go:
- Deprecated temporalWorkerDeploymentRef emits a deprecation warning
- Both refs set → rejected
- Neither ref set → rejected
- Immutability enforced across all ref-field combinations including
  deprecated→new field switching with same/different effective names

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
TemporalConnectionSpec → ConnectionSpec.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
//+kubebuilder:resource:shortName=tconn
//+kubebuilder:resource:shortName=conn
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we / should we keep tconn?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant