Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ECSNodeClass CEL validation #60

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

daimaxiaxie
Copy link
Contributor

What type of PR is this?

/kind feature

What this PR does / why we need it:

Added ECSNodeClass CEL validation.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?


Copy link

gitautomator bot commented Oct 25, 2024

Thanks to your contribution, the maintainers will review it as soon as they can!

@daimaxiaxie daimaxiaxie force-pushed the node-class-cel branch 3 times, most recently from 459f40e to 97c52db Compare October 25, 2024 09:20
@daimaxiaxie
Copy link
Contributor Author

/cc @jwcesign @helen-frank

pkg/apis/apis.go Outdated
)

var (
Group = "karpenter.k8s.alicloud"
CompatibilityGroup = "compatibility." + Group
CRDs = apis.CRDs // object.Unmarshal[apiextensionsv1.CustomResourceDefinition](crds.ECSNodeClassCRD)
CRDs = append(apis.CRDs, object.Unmarshal[apiextensionsv1.CustomResourceDefinition](config.ECSNodeClassCRD))
Copy link
Contributor

Choose a reason for hiding this comment

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

cc @helen-frank , I remeber we decide to not use this, do you remeber the reason?

Copy link
Contributor

Choose a reason for hiding this comment

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

The test work needed this, but we didn't have time to write test cases before

Copy link
Contributor

Choose a reason for hiding this comment

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

Got

Copy link
Contributor

@jwcesign jwcesign Oct 28, 2024

Choose a reason for hiding this comment

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

This is used to check the validation rule, I think we can launch a kind to and apply the CRD to check whether it's validate.
img_v3_02g3_7360316d-03cb-41f9-a043-073b1b73445g

So, check it in the ut is a little bit redundant and needs to write much code.

What do you think? @daimaxiaxie

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If e2e, you need to use a lot of CR yaml to verify the rules. I think it is not as convenient as code.

@jwcesign
Copy link
Contributor

BTW, what means CEL

@daimaxiaxie
Copy link
Contributor Author

BTW, what means CEL

Common Expression Language https://kubernetes.io/docs/reference/using-api/cel/

@jwcesign
Copy link
Contributor

Hi, @daimaxiaxie
We will back to this PR after the v0.1.0 released.

Thanks!

@peng19940915
Copy link

it's cool!

@daimaxiaxie daimaxiaxie marked this pull request as draft November 29, 2024 09:01
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.

None yet

4 participants