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 k8s resources types #199

Merged
merged 14 commits into from
Jan 13, 2023
Merged

Add k8s resources types #199

merged 14 commits into from
Jan 13, 2023

Conversation

kangyili
Copy link
Contributor

@kangyili kangyili commented Nov 28, 2022

Add k8s resources type so it can be used by both agent and backend side
Agent PR DataDog/datadog-agent#14557

@kangyili kangyili changed the title init Add k8s resources types Dec 1, 2022
Copy link
Contributor

@nammn nammn left a comment

Choose a reason for hiding this comment

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

You will either need to:

@kangyili kangyili requested a review from a team December 20, 2022 11:00
@kangyili kangyili marked this pull request as ready for review December 20, 2022 11:01
@kangyili kangyili requested a review from a team as a code owner December 20, 2022 11:01
@JLineaweaver
Copy link
Contributor

Nitpick but the indentation seems off. Also is there any reason they're all in caps?

Copy link
Contributor

@JLineaweaver JLineaweaver left a comment

Choose a reason for hiding this comment

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

Can still fix some styling but overall looks good to me.

Comment on lines 861 to 882
unsetNodeType = 0;
pod = 1;
replicaSet = 2;
service = 3;
node = 4;
cluster = 5;
job = 6;
cronJob = 7;
daemonSet = 8;
statefulSet = 9;
persistentVolume = 10;
persistentVolumeClaim = 11;
role = 12;
roleBinding = 13;
clusterRole = 14;
clusterRoleBinding = 15;
serviceAccount = 16;
ingress = 17;
deployment = 18;
namespace = 19;
crd = 20;
cr = 21;
Copy link
Member

@xlucas xlucas Jan 4, 2023

Choose a reason for hiding this comment

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

several thoughts:

  • it would make more sense to use the singular for that enum name i.e. K8sResource
  • we should use upper case format for values here as specified in https://developers.google.com/protocol-buffers/docs/style#enums
  • by convention the first value should have an UNSPECIFIED prefix like in K8S_RESOURCE_UNSPECIFIED, is it possible to rename this or is it annoying? unfortunately looks like we started using "unset" here and there for some reason 😕

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the feedback, I addressed in c440357

I don't add prefix in proto, such as K8SRESOURCE_POD, because in generated file we can have K8sResource_K8SRESOURCE_POD making me feel the name is too long

@kangyili kangyili requested a review from xlucas January 5, 2023 13:23
@kangyili kangyili merged commit 651a0b7 into master Jan 13, 2023
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.

4 participants