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 a Metadata protobuf module #123

Merged
merged 8 commits into from
Jul 6, 2022
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ destination = ["http-types", "net", "prost-types", "tonic/codegen"]
http-types = ["http", "thiserror"]
identity = ["prost-types", "tonic/codegen"]
inbound = ["net", "prost-types", "tonic/codegen"]
meta = []
net = ["ipnet", "thiserror"]
tap = ["h2", "http-types", "net", "prost-types", "tonic/codegen"]

Expand Down
346 changes: 184 additions & 162 deletions go/inbound/inbound.pb.go

Large diffs are not rendered by default.

276 changes: 276 additions & 0 deletions go/meta/meta.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions proto/inbound.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package io.linkerd.proxy.inbound;
option go_package = "github.com/linkerd/linkerd2-proxy-api/go/inbound";

import "google/protobuf/duration.proto";
import "meta.proto";
import "net.proto";

/// An API exposed to the linkerd2-proxy to configure the inbound proxy with per-port configuration
Expand Down Expand Up @@ -108,7 +109,15 @@ message Authz {
//
// A control plane SHOULD return the same keys in all authorizations. That is,
// we do NOT want to return arbitrary pod labels in this field.
//
// `labels` should be considered deprecated. `metadata` is preferred. However,
// controllers should continue to set `labels` for compatibility with older
// proxies.
map<string, string> labels = 3;

// If set, describes an Authorization configuration. Replaces the free-from
// `labels` field.
io.linkerd.proxy.meta.Metadata metadata = 4;
}

// Describes a network of authorized clients.
Expand Down
27 changes: 27 additions & 0 deletions proto/meta.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
syntax = "proto3";

package io.linkerd.proxy.meta;

option go_package = "github.com/linkerd/linkerd2-proxy-api/go/meta";

// General metadata about a configuration object. Typically references either an
// implicit default configuration or a Kubernetes resource.
Comment on lines +7 to +8
Copy link
Contributor

Choose a reason for hiding this comment

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

the semantics of the default variant is not super clear from this...is it expected to be populated with a string? how is that string handled?

Copy link
Member

Choose a reason for hiding this comment

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

based on the current behavior of the policy-controller, I think this is supposed to describe what the default policy is (e.g. "all-authenticated"). But I agree, it's not clear.

message Metadata {
oneof kind {
// A name describing a default/implicit configuration.
//
// For example, a policy default name like `all-authenticated` describes an
// implicit controller-implemented policy that does not exist as a cluster
// resource.
string default = 1;

Resource resource = 2;
}
}

// References a (e.g., Kubernetes) resource.
message Resource {
string group = 1;
string kind = 2;
string name = 3;
}
8 changes: 8 additions & 0 deletions src/gen/io.linkerd.proxy.inbound.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions src/gen/io.linkerd.proxy.meta.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading