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

fix(policies): make options for policies simpler #4722

Merged
merged 2 commits into from
Aug 1, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
217 changes: 150 additions & 67 deletions api/mesh/options.pb.go

Large diffs are not rendered by default.

12 changes: 9 additions & 3 deletions api/mesh/options.proto
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ message KumaResourceOptions {
// Name of the resource's Go package.
string package = 4;

// Whether to generate a no-op validation function.
bool skip_validation = 5;

// Whether to skip type registration for this resource.
bool skip_registration = 6;

Expand Down Expand Up @@ -66,6 +63,15 @@ message KumaKdsOptions {
bool send_to_zone = 2;
}

message KumaPolicyOptions {
// Whether to skip type registration for this resource.
bool skip_registration = 1;
// An optional alternative plural form if this is unset default to a standard
// derivation of the name
string plural = 2;
}

extend google.protobuf.MessageOptions {
KumaResourceOptions resource = 43534533; // 'kuma'
KumaPolicyOptions policy = 43534534; // 'kuma'
}
214 changes: 107 additions & 107 deletions api/mesh/v1alpha1/dataplane_insight.pb.go

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion api/mesh/v1alpha1/dataplane_insight.proto
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ message DataplaneInsight {
option (kuma.mesh.resource).name = "DataplaneInsightResource";
option (kuma.mesh.resource).type = "DataplaneInsight";
option (kuma.mesh.resource).package = "mesh";
option (kuma.mesh.resource).skip_validation = true;
option (kuma.mesh.resource).kds.send_to_global = true;
option (kuma.mesh.resource).ws.name = "dataplane-insight";
option (kuma.mesh.resource).ws.read_only = true;
Expand Down
13 changes: 6 additions & 7 deletions api/mesh/v1alpha1/dataplane_overview.pb.go

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

1 change: 0 additions & 1 deletion api/mesh/v1alpha1/dataplane_overview.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ message DataplaneOverview {
option (kuma.mesh.resource).type = "DataplaneOverview";
option (kuma.mesh.resource).package = "mesh";
option (kuma.mesh.resource).skip_registration = true;
option (kuma.mesh.resource).skip_validation = true;
option (kuma.mesh.resource).skip_kubernetes_wrappers = true;

Dataplane dataplane = 1 [ (validate.rules).message.required = true ];
Expand Down
16 changes: 8 additions & 8 deletions api/mesh/v1alpha1/mesh_insight.pb.go

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

1 change: 0 additions & 1 deletion api/mesh/v1alpha1/mesh_insight.proto
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ message MeshInsight {
option (kuma.mesh.resource).type = "MeshInsight";
option (kuma.mesh.resource).global = true;
option (kuma.mesh.resource).package = "mesh";
option (kuma.mesh.resource).skip_validation = true;
option (kuma.mesh.resource).ws.name = "mesh-insight";
option (kuma.mesh.resource).ws.read_only = true;

Expand Down
31 changes: 15 additions & 16 deletions api/mesh/v1alpha1/service_insight.pb.go

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

2 changes: 0 additions & 2 deletions api/mesh/v1alpha1/service_insight.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ message ServiceInsight {
option (kuma.mesh.resource).name = "ServiceInsightResource";
option (kuma.mesh.resource).type = "ServiceInsight";
option (kuma.mesh.resource).package = "mesh";
option (kuma.mesh.resource).skip_validation = true;
option (kuma.mesh.resource).kds.send_to_zone = true;
option (kuma.mesh.resource).ws.name = "service-insight";
option (kuma.mesh.resource).ws.read_only = true;
Expand All @@ -23,7 +22,6 @@ message ServiceInsight {
option (kuma.mesh.resource).type = "ServiceOverview";
option (kuma.mesh.resource).package = "mesh";
option (kuma.mesh.resource).skip_registration = true;
option (kuma.mesh.resource).skip_validation = true;
option (kuma.mesh.resource).skip_kubernetes_wrappers = true;

enum Status {
Expand Down
20 changes: 10 additions & 10 deletions api/mesh/v1alpha1/zone_ingress_insight.pb.go

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

1 change: 0 additions & 1 deletion api/mesh/v1alpha1/zone_ingress_insight.proto
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ message ZoneIngressInsight {
option (kuma.mesh.resource).type = "ZoneIngressInsight";
option (kuma.mesh.resource).package = "mesh";
option (kuma.mesh.resource).global = true;
option (kuma.mesh.resource).skip_validation = true;
option (kuma.mesh.resource).kds.send_to_global = true;
option (kuma.mesh.resource).ws.name = "zone-ingress-insight";
option (kuma.mesh.resource).ws.read_only = true;
Expand Down
19 changes: 9 additions & 10 deletions api/mesh/v1alpha1/zoneegressinsight.pb.go

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

Loading