Skip to content

Add validation webhook for ClusterTopology resource #251

Merged
Ronkahn21 merged 8 commits into
ai-dynamo:mainfrom
shmuel-runai:grove-33551/main-tas-validation
Nov 14, 2025
Merged

Add validation webhook for ClusterTopology resource #251
Ronkahn21 merged 8 commits into
ai-dynamo:mainfrom
shmuel-runai:grove-33551/main-tas-validation

Conversation

@shmuel-runai

Copy link
Copy Markdown
Contributor

What type of PR is this?

/kind feature
/kind api

What this PR does / why we need it:

Which issue(s) this PR fixes:

Implements validation webhook for ClusterTopology

Special notes for your reviewer:

Does this PR introduce a API change?

NONE

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

Design ref: docs/designs/topology.md

@shmuel-runai shmuel-runai marked this pull request as draft November 6, 2025 14:54
Comment thread operator/charts/templates/clustertopology-validating-webhook-config.yaml Outdated
Comment thread operator/internal/webhook/admission/clustertopology/validation/clustertopology.go Outdated
Comment thread operator/internal/webhook/admission/clustertopology/validation/clustertopology.go Outdated
Comment thread operator/internal/webhook/admission/clustertopology/validation/clustertopology.go Outdated
Comment thread operator/internal/webhook/admission/clustertopology/validation/clustertopology.go Outdated
Comment thread operator/internal/webhook/admission/clustertopology/validation/clustertopology.go Outdated

@gflarity gflarity left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Left a few comments. Also, the design calls that both domains and keys must be unique but I didn't notice a check for the Keys being unique.

@shmuel-runai shmuel-runai force-pushed the grove-33551/main-tas-validation branch from 3ad456a to f978975 Compare November 9, 2025 15:21
Comment thread operator/internal/webhook/admission/clustertopology/validation/clustertopology.go Outdated
Comment thread operator/internal/webhook/admission/clustertopology/validation/clustertopology.go Outdated
Comment thread operator/internal/webhook/admission/clustertopology/validation/clustertopology.go Outdated
Comment thread operator/internal/webhook/admission/clustertopology/validation/clustertopology.go Outdated
Comment thread operator/internal/webhook/admission/clustertopology/validation/clustertopology.go Outdated
Comment thread operator/internal/webhook/admission/clustertopology/validation/clustertopology.go Outdated
Comment thread operator/internal/webhook/admission/clustertopology/validation/clustertopology.go Outdated
Comment thread operator/internal/webhook/admission/clustertopology/validation/handler.go Outdated

@Ronkahn21 Ronkahn21 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

make sure to use lo packge, flows can be simplified but the overall idea looks good

Comment thread operator/internal/webhook/admission/clustertopology/validation/clustertopology.go Outdated
Comment thread operator/internal/webhook/admission/clustertopology/validation/clustertopology.go Outdated
Comment thread operator/internal/webhook/admission/clustertopology/validation/handler.go Outdated
@shmuel-runai shmuel-runai force-pushed the grove-33551/main-tas-validation branch from 17309e6 to 5780289 Compare November 10, 2025 20:27
@shmuel-runai shmuel-runai marked this pull request as ready for review November 10, 2025 20:32
gflarity
gflarity previously approved these changes Nov 12, 2025

@renormalize renormalize left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @shmuel-runai! Posted a few fits - please take a look.

Comment thread operator/internal/webhook/admission/clustertopology/validation/handler.go Outdated
Comment thread operator/internal/webhook/admission/clustertopology/validation/clustertopology.go Outdated
shayasoolin
shayasoolin previously approved these changes Nov 12, 2025

@shayasoolin shayasoolin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@renormalize renormalize left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks!

Design ref: docs/designs/topology.md

* Implement validating webhook that enforces topology domain hierarchy,
  valid Kubernetes label keys, and immutability constraints on updates
* Add comprehensive test coverage for create and update validation
* Register ClusterTopology validation webhook with operator
shmuel-runai and others added 7 commits November 13, 2025 14:27
* Add ValidatingWebhookConfiguration for ClusterTopology validation
* Add webhook labels and helper template in charts configuration
* Configure webhook to validate CREATE and UPDATE operations on
  clustertopologies resources with failurePolicy set to Fail
* Remove reduant namespace from the helm chart helm
* Add Testing for unique keys
* Add UT
* Misc code cleanup
* Add crd test base on envtest for testing API server checks
* Remove redundant checks from the webhook (and UT)
* Code cleanup
…/handler.go

Co-authored-by: Saketh Kalaga <51327242+renormalize@users.noreply.github.com>
Signed-off-by: shmuel-runai <149931913+shmuel-runai@users.noreply.github.com>
…/clustertopology.go

Co-authored-by: Saketh Kalaga <51327242+renormalize@users.noreply.github.com>
Signed-off-by: shmuel-runai <149931913+shmuel-runai@users.noreply.github.com>
…/clustertopology.go

Co-authored-by: Saketh Kalaga <51327242+renormalize@users.noreply.github.com>
Signed-off-by: shmuel-runai <149931913+shmuel-runai@users.noreply.github.com>
@sanjaychatterjee sanjaychatterjee force-pushed the grove-33551/main-tas-validation branch from 2f14a4a to bcf3763 Compare November 13, 2025 19:27
@renormalize

Copy link
Copy Markdown
Contributor

@Ronkahn21 can we get an approval from you as well, since you requested changes last and that is blocking the merge of this PR? Thanks.

@shmuel-runai while merging the PR please clean up unnecessary commit logs created during the review cycle in the commit message. Thanks.

@Ronkahn21 Ronkahn21 merged commit b12472e into ai-dynamo:main Nov 14, 2025
3 checks passed
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.

7 participants