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

Ingest new policy types #58

Merged
merged 3 commits into from
Apr 20, 2022
Merged

Ingest new policy types #58

merged 3 commits into from
Apr 20, 2022

Conversation

zaharidichev
Copy link
Contributor

@zaharidichev zaharidichev commented Mar 25, 2022

This PR enables the ingestion of the new Linkerd policy types that are outlined in linkerd/linkerd2#7709

Signed-off-by: Zahari Dichev zaharidichev@gmail.com

@zaharidichev zaharidichev self-assigned this Mar 25, 2022
Signed-off-by: Zahari Dichev <zaharidichev@gmail.com>
@zaharidichev zaharidichev force-pushed the zd/ingest-new-policy-types branch from 6852737 to 7ef110b Compare April 19, 2022 10:23
@klingerf klingerf self-requested a review April 19, 2022 18:48
Copy link
Contributor

@klingerf klingerf left a comment

Choose a reason for hiding this comment

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

⭐ Sweet, this is working for me locally! Thanks for putting it together. Just had a few tiny nits.

GET https://10.43.0.1:443/api/v1/namespaces/linkerd/configmaps/linkerd-identity-trust-roots 200 OK in 12 milliseconds
GET https://10.43.0.1:443/apis/policy.linkerd.io/v1beta1 200 OK in 1 milliseconds
GET https://10.43.0.1:443/apis/policy.linkerd.io/v1beta1/servers 200 OK in 7 milliseconds
GET https://10.43.0.1:443/apis/policy.linkerd.io/v1beta1 200 OK in 2 milliseconds
GET https://10.43.0.1:443/apis/policy.linkerd.io/v1beta1/serverauthorizations 200 OK in 5 milliseconds
GET https://10.43.0.1:443/apis/policy.linkerd.io/v1alpha1 200 OK in 2 milliseconds
GET https://10.43.0.1:443/apis/policy.linkerd.io/v1alpha1/authorizationpolicies 200 OK in 4 milliseconds
GET https://10.43.0.1:443/apis/policy.linkerd.io/v1alpha1 200 OK in 1 milliseconds
GET https://10.43.0.1:443/apis/policy.linkerd.io/v1alpha1/meshtlsauthentications 200 OK in 5 milliseconds
GET https://10.43.0.1:443/apis/policy.linkerd.io/v1alpha1 200 OK in 2 milliseconds
GET https://10.43.0.1:443/apis/policy.linkerd.io/v1alpha1/networkauthentications 200 OK in 6 milliseconds
GET https://10.43.0.1:443/apis/multicluster.linkerd.io/v1alpha1 200 OK in 1 milliseconds
GET https://10.43.0.1:443/apis/multicluster.linkerd.io/v1alpha1/links 200 OK in 3 milliseconds
GET https://10.43.0.1:443/apis/linkerd.io/v1alpha2 200 OK in 1 milliseconds
GET https://10.43.0.1:443/apis/linkerd.io/v1alpha2/serviceprofiles 200 OK in 3 milliseconds
GET https://10.43.0.1:443/apis/split.smi-spec.io/v1alpha1 200 OK in 1 milliseconds
GET https://10.43.0.1:443/apis/split.smi-spec.io/v1alpha1/trafficsplits 200 OK in 4 milliseconds

case "MeshTLSAuthentication":
l5dObjects = append(l5dObjects, obj)
case "NetworkAuthentication":
l5dObjects = append(l5dObjects, obj)
Copy link
Contributor

Choose a reason for hiding this comment

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

TIOLI you could use multiple values in one case to shorten this up a bit. Something like:

		switch obj.GetObjectKind().GroupVersionKind().Kind {
		case "ServiceProfile", "ServerAuthorization", "Server", "AuthorizationPolicy",
			"MeshTLSAuthentication", "NetworkAuthentication", "Link":
			l5dObjects = append(l5dObjects, obj)
		case "TrafficSplit":
			tsObjs = append(tsObjs, obj)
		default:
			objs = append(objs, obj)
		}

message AuthPolicyInfo {
repeated Server servers = 1;
repeated ServerAuthorization server_authorizations = 2;
repeated AuthorizationPolicy authorization_policies = 3;
repeated MeshTLSAuthentication mesh_tls_authenticatios = 4;
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo here -- mesh_tls_authenticatios => mesh_tls_authentications

Servers: servers,
ServerAuthorizations: serverAuths,
AuthorizationPolicies: authPolicies,
MeshTlsAuthenticatios: meshTlsAuthentications,
Copy link
Contributor

Choose a reason for hiding this comment

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

Once you update the protobuf, this should be MeshTlsAuthentications

Signed-off-by: Zahari Dichev <zaharidichev@gmail.com>
Signed-off-by: Zahari Dichev <zaharidichev@gmail.com>
@zaharidichev zaharidichev merged commit 6488061 into main Apr 20, 2022
@zaharidichev zaharidichev deleted the zd/ingest-new-policy-types branch April 20, 2022 07:43
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.

2 participants