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

Saulparedes/validate node name #298

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

Conversation

Redent0r
Copy link

@Redent0r Redent0r commented Jan 21, 2025

Merge Checklist
  • Followed patch format from upstream recommendation: https://github.com/kata-containers/community/blob/main/CONTRIBUTING.md#patch-format
    • Included a single commit in a given PR - at least unless there are related commits and each makes sense as a change on its own.
  • Aware about the PR to be merged using "create a merge commit" rather than "squash and merge" (or similar)
  • The upstream/missing label (or upstream/not-needed) has been set on the PR.
Summary

genpolicy: validate node name

Validate node name using upstream regexp
https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/util/validation/validation.go#L177

https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-subdomain-names

Test Methodology

https://dev.azure.com/mariner-org/mariner/_build/results?buildId=716039&view=results

@Redent0r Redent0r added the upstream/missing PRs that are yet to be upstreamed label Jan 21, 2025
@@ -53,7 +53,7 @@ spec:
- /bin/sh
args:
- "-c"
- while true; do echo $(ISTIO_META_CLUSTER_ID); sleep 10; done
- while true; do echo $(ISTIO_META_CLUSTER_ID); echo $(ISTIO_META_NODE_NAME); sleep 10; done
Copy link
Author

Choose a reason for hiding this comment

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

updated test case to show variables referencing node name in command line now get validated

@Redent0r Redent0r force-pushed the saulparedes/validate_node_name branch from 45eb35d to 3eeb1d2 Compare January 23, 2025 01:17
Update samples

Signed-off-by: Saul Paredes <saulparedes@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream/missing PRs that are yet to be upstreamed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant