Skip to content

Refactor/e2e centralize data#546

Merged
oleg-kushniriov merged 10 commits into
ai-dynamo:mainfrom
oleg-kushniriov:refactor/e2e-centralize-data
Apr 23, 2026
Merged

Refactor/e2e centralize data#546
oleg-kushniriov merged 10 commits into
ai-dynamo:mainfrom
oleg-kushniriov:refactor/e2e-centralize-data

Conversation

@oleg-kushniriov

Copy link
Copy Markdown
Contributor

###What type of PR is this?

/kind cleanup

What this PR does / why we need it:

Consolidates scattered hardcoded strings and inline GVK/GVR definitions into canonical constants, eliminating duplicated magic strings across the e2e codebase.

GVK consolidation:

  • Created e2e/grove/gvk/gvk.go — canonical GVK constants for all Grove CRDs (PodCliqueSet, PodClique, PodCliqueScalingGroup, PodGang) and third-party CRDs (ComputeDomain)
  • Created e2e/setup/gvk.go — resourceType definitions and groveManagedResourceTypes moved from shared_cluster.go, with kindToResource and newResourceType helpers
  • Created e2e/tests/gvk.go — test-local GVK constants for cert-manager and apiextensions CRDs
  • Replaced all inline schema.GroupVersionKind{...} literals in workload.go, diagnostics/collector.go, shared_cluster.go, resource_sharing_test.go, cert_management_test.go, crd_installer_test.go with imports from the canonical packages

Label constant consolidation:

  • Replaced all hardcoded "app.kubernetes.io/part-of" with common.LabelPartOfKey
  • Replaced all hardcoded "app.kubernetes.io/name" with common.LabelAppNameKey
  • Replaced all hardcoded "app.kubernetes.io/component" with common.LabelComponentKey
  • Replaced all hardcoded "app.kubernetes.io/managed-by" with common.LabelManagedByKey
  • Replaced all hardcoded "grove-operator" label values with common.LabelManagedByValue or setup.OperatorDeploymentName
  • Replaced all hardcoded "grove-system" with setup.OperatorNamespace

Other improvements:

  • WaitForPodCliqueSetDeletion standalone function added
  • WorkloadManager.WaitForPCSG, WaitForPodClique, DeletePCSAndWait now delegate to standalone functions
  • reapplyNodeLabels uses targeted JSON merge patch instead of full-object MergeFrom

Which issue(s) this PR fixes:

Fixes #520

Special notes for your reviewer:

  • gvk.go files follow a convention: the package that operates on the CRD owns the GVK definition. grove/gvk/ for Grove + third-party CRDs, setup/gvk.go for cleanup resource types, tests/gvk.go for test-only CRDs.
  • The kindToResource helper assumes the standard K8s convention (strings.ToLower(kind) + "s"), which holds for all CRDs in this codebase.
  • Kubernetes core resource GVKs (Service, Secret, Role, etc.) are defined locally in setup/gvk.go since they're only used for cleanup operations.
  • e2e/utils/pprof/pprof.go still has "grove-system" in a comment — not a code reference, left as-is.

Does this PR introduce a API change?

 NONE

Additional documentation e.g., enhancement proposals, usage docs, etc.:

NONE

@copy-pr-bot

copy-pr-bot Bot commented Apr 21, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@oleg-kushniriov oleg-kushniriov self-assigned this Apr 21, 2026
@oleg-kushniriov oleg-kushniriov marked this pull request as draft April 21, 2026 09:01
@oleg-kushniriov oleg-kushniriov force-pushed the refactor/e2e-centralize-data branch from 584421b to d5ecfe3 Compare April 21, 2026 09:42
shayasoolin
shayasoolin previously approved these changes Apr 21, 2026
@oleg-kushniriov oleg-kushniriov marked this pull request as ready for review April 21, 2026 12:15
@oleg-kushniriov oleg-kushniriov force-pushed the refactor/e2e-centralize-data branch from d5ecfe3 to 16e14cc Compare April 23, 2026 07:03
Comment thread operator/e2e/grove/gvk/gvk.go
@oleg-kushniriov oleg-kushniriov requested a review from enoodle April 23, 2026 09:49
@oleg-kushniriov oleg-kushniriov merged commit 27ac545 into ai-dynamo:main Apr 23, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Centralize CRD GroupVersionResource definitions into gvr.go files per domain package

3 participants