diff --git a/api/aperture/common/config/v1/config_properties_wrapper.proto b/api/aperture/common/config/v1/config_properties_wrapper.proto index 8e60feb45a..85196c3b6c 100644 --- a/api/aperture/common/config/v1/config_properties_wrapper.proto +++ b/api/aperture/common/config/v1/config_properties_wrapper.proto @@ -18,10 +18,6 @@ message PolicyWrapper { message FluxMeterWrapper { // Flux Meter policy.language.v1.FluxMeter flux_meter = 1; - // Name of the Policy. - string policy_name = 2; - // Hash of the entire Policy spec. - string policy_hash = 3; // Name of fluxmeter metric. string fluxmeter_name = 4; } diff --git a/api/aperture/flowcontrol/v1/flowcontrol.proto b/api/aperture/flowcontrol/v1/flowcontrol.proto index 99cff97b4c..ea53d5bea7 100644 --- a/api/aperture/flowcontrol/v1/flowcontrol.proto +++ b/api/aperture/flowcontrol/v1/flowcontrol.proto @@ -81,7 +81,5 @@ message LimiterDecision { // FluxMeter describes detail for each FluxMeter. message FluxMeter { - string policy_name = 1; - string policy_hash = 2; - string flux_meter_name = 3; + string flux_meter_name = 1; } diff --git a/api/gen/openapiv2/aperture.swagger.yaml b/api/gen/openapiv2/aperture.swagger.yaml index 672d24fc1c..47fbcd8bfd 100644 --- a/api/gen/openapiv2/aperture.swagger.yaml +++ b/api/gen/openapiv2/aperture.swagger.yaml @@ -258,10 +258,6 @@ definitions: properties: flux_meter_name: type: string - policy_hash: - type: string - policy_name: - type: string description: FluxMeter describes detail for each FluxMeter. googlerpcStatus: type: object diff --git a/api/gen/proto/go/aperture/common/config/v1/config_properties_wrapper.pb.go b/api/gen/proto/go/aperture/common/config/v1/config_properties_wrapper.pb.go index 6cfc2e6c30..3f99df30b7 100644 --- a/api/gen/proto/go/aperture/common/config/v1/config_properties_wrapper.pb.go +++ b/api/gen/proto/go/aperture/common/config/v1/config_properties_wrapper.pb.go @@ -95,10 +95,6 @@ type FluxMeterWrapper struct { // Flux Meter FluxMeter *v1.FluxMeter `protobuf:"bytes,1,opt,name=flux_meter,json=fluxMeter,proto3" json:"flux_meter,omitempty"` - // Name of the Policy. - PolicyName string `protobuf:"bytes,2,opt,name=policy_name,json=policyName,proto3" json:"policy_name,omitempty"` - // Hash of the entire Policy spec. - PolicyHash string `protobuf:"bytes,3,opt,name=policy_hash,json=policyHash,proto3" json:"policy_hash,omitempty"` // Name of fluxmeter metric. FluxmeterName string `protobuf:"bytes,4,opt,name=fluxmeter_name,json=fluxmeterName,proto3" json:"fluxmeter_name,omitempty"` } @@ -142,20 +138,6 @@ func (x *FluxMeterWrapper) GetFluxMeter() *v1.FluxMeter { return nil } -func (x *FluxMeterWrapper) GetPolicyName() string { - if x != nil { - return x.PolicyName - } - return "" -} - -func (x *FluxMeterWrapper) GetPolicyHash() string { - if x != nil { - return x.PolicyHash - } - return "" -} - func (x *FluxMeterWrapper) GetFluxmeterName() string { if x != nil { return x.FluxmeterName @@ -563,108 +545,104 @@ var file_aperture_common_config_v1_config_properties_wrapper_proto_rawDesc = []b 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x48, 0x61, 0x73, 0x68, 0x22, 0xc2, 0x01, 0x0a, + 0x52, 0x0a, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x48, 0x61, 0x73, 0x68, 0x22, 0x80, 0x01, 0x0a, 0x10, 0x46, 0x6c, 0x75, 0x78, 0x4d, 0x65, 0x74, 0x65, 0x72, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x12, 0x45, 0x0a, 0x0a, 0x66, 0x6c, 0x75, 0x78, 0x5f, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x61, 0x70, 0x65, 0x72, 0x74, 0x75, 0x72, 0x65, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x6c, 0x75, 0x78, 0x4d, 0x65, 0x74, 0x65, 0x72, 0x52, 0x09, 0x66, - 0x6c, 0x75, 0x78, 0x4d, 0x65, 0x74, 0x65, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x6f, 0x6c, 0x69, - 0x63, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, + 0x6c, 0x75, 0x78, 0x4d, 0x65, 0x74, 0x65, 0x72, 0x12, 0x25, 0x0a, 0x0e, 0x66, 0x6c, 0x75, 0x78, + 0x6d, 0x65, 0x74, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0d, 0x66, 0x6c, 0x75, 0x78, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x22, + 0xe8, 0x01, 0x0a, 0x19, 0x43, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x4c, + 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x12, 0x60, 0x0a, + 0x13, 0x63, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x5f, 0x6c, 0x69, 0x6d, + 0x69, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x61, 0x70, 0x65, + 0x72, 0x74, 0x75, 0x72, 0x65, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x6c, 0x61, 0x6e, + 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, + 0x65, 0x6e, 0x63, 0x79, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x52, 0x12, 0x63, 0x6f, 0x6e, + 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x12, + 0x27, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x6e, 0x64, + 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, + 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x6f, 0x6c, 0x69, + 0x63, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x6f, 0x6c, - 0x69, 0x63, 0x79, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, - 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x48, 0x61, 0x73, 0x68, 0x12, 0x25, 0x0a, 0x0e, 0x66, 0x6c, - 0x75, 0x78, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0d, 0x66, 0x6c, 0x75, 0x78, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, - 0x65, 0x22, 0xe8, 0x01, 0x0a, 0x19, 0x43, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, - 0x79, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x12, - 0x60, 0x0a, 0x13, 0x63, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x5f, 0x6c, - 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x61, - 0x70, 0x65, 0x72, 0x74, 0x75, 0x72, 0x65, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x6c, - 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x63, 0x75, - 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x52, 0x12, 0x63, - 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, - 0x72, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x5f, 0x69, - 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x70, - 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x6f, - 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0a, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x70, - 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x48, 0x61, 0x73, 0x68, 0x22, 0xcc, 0x01, 0x0a, - 0x12, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x57, 0x72, 0x61, 0x70, - 0x70, 0x65, 0x72, 0x12, 0x4b, 0x0a, 0x0c, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, - 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x61, 0x70, 0x65, 0x72, - 0x74, 0x75, 0x72, 0x65, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x6c, 0x61, 0x6e, 0x67, - 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, - 0x74, 0x65, 0x72, 0x52, 0x0b, 0x72, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, + 0x69, 0x63, 0x79, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, + 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x48, 0x61, 0x73, 0x68, 0x22, 0xcc, 0x01, 0x0a, 0x12, 0x52, + 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, + 0x72, 0x12, 0x4b, 0x0a, 0x0c, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, + 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x61, 0x70, 0x65, 0x72, 0x74, 0x75, + 0x72, 0x65, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, + 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, + 0x72, 0x52, 0x0b, 0x72, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x12, 0x27, + 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65, + 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, + 0x6e, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x6f, 0x6c, 0x69, 0x63, + 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x6f, + 0x6c, 0x69, 0x63, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x6f, 0x6c, 0x69, + 0x63, 0x79, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, + 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x48, 0x61, 0x73, 0x68, 0x22, 0xe3, 0x01, 0x0a, 0x18, 0x4c, 0x6f, + 0x61, 0x64, 0x53, 0x68, 0x65, 0x64, 0x44, 0x65, 0x63, 0x73, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x57, + 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x12, 0x5c, 0x0a, 0x12, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x73, + 0x68, 0x65, 0x64, 0x5f, 0x64, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x61, 0x70, 0x65, 0x72, 0x74, 0x75, 0x72, 0x65, 0x2e, 0x70, 0x6f, + 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x64, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x76, + 0x31, 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x53, 0x68, 0x65, 0x64, 0x44, 0x65, 0x63, 0x69, 0x73, 0x69, + 0x6f, 0x6e, 0x52, 0x10, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x68, 0x65, 0x64, 0x44, 0x65, 0x63, 0x69, + 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, + 0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x63, + 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1f, 0x0a, + 0x0b, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0a, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1f, + 0x0a, 0x0b, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x48, 0x61, 0x73, 0x68, 0x22, + 0xd9, 0x01, 0x0a, 0x15, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x44, 0x65, 0x63, 0x69, 0x73, 0x69, + 0x6f, 0x6e, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x12, 0x55, 0x0a, 0x0f, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x73, 0x5f, 0x64, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x61, 0x70, 0x65, 0x72, 0x74, 0x75, 0x72, 0x65, 0x2e, 0x70, 0x6f, + 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x64, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x76, + 0x31, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x44, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, + 0x52, 0x0e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x44, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0a, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x48, 0x61, 0x73, 0x68, 0x22, 0xe3, 0x01, 0x0a, 0x18, - 0x4c, 0x6f, 0x61, 0x64, 0x53, 0x68, 0x65, 0x64, 0x44, 0x65, 0x63, 0x73, 0x69, 0x73, 0x69, 0x6f, - 0x6e, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x12, 0x5c, 0x0a, 0x12, 0x6c, 0x6f, 0x61, 0x64, - 0x5f, 0x73, 0x68, 0x65, 0x64, 0x5f, 0x64, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x61, 0x70, 0x65, 0x72, 0x74, 0x75, 0x72, 0x65, 0x2e, - 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x64, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, - 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x53, 0x68, 0x65, 0x64, 0x44, 0x65, 0x63, 0x69, - 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x10, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x68, 0x65, 0x64, 0x44, 0x65, - 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, - 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x0e, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, - 0x1f, 0x0a, 0x0b, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x4e, 0x61, 0x6d, 0x65, - 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x48, 0x61, 0x73, - 0x68, 0x22, 0xd9, 0x01, 0x0a, 0x15, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x44, 0x65, 0x63, 0x69, - 0x73, 0x69, 0x6f, 0x6e, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x12, 0x55, 0x0a, 0x0f, 0x74, - 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x5f, 0x64, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x61, 0x70, 0x65, 0x72, 0x74, 0x75, 0x72, 0x65, 0x2e, - 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x64, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, - 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x44, 0x65, 0x63, 0x69, 0x73, 0x69, - 0x6f, 0x6e, 0x52, 0x0e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x44, 0x65, 0x63, 0x69, 0x73, 0x69, - 0x6f, 0x6e, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x5f, - 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x63, 0x6f, 0x6d, - 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1f, 0x0a, 0x0b, 0x70, - 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, - 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0a, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x48, 0x61, 0x73, 0x68, 0x22, 0xee, 0x01, - 0x0a, 0x1a, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x44, 0x65, 0x63, - 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x12, 0x65, 0x0a, 0x15, - 0x72, 0x61, 0x74, 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x5f, 0x64, 0x65, 0x63, - 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x61, 0x70, - 0x65, 0x72, 0x74, 0x75, 0x72, 0x65, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x64, 0x65, - 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x61, 0x74, 0x65, 0x4c, - 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x44, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x13, - 0x72, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x44, 0x65, 0x63, 0x69, 0x73, - 0x69, 0x6f, 0x6e, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, - 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x63, 0x6f, - 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1f, 0x0a, 0x0b, - 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0a, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, - 0x0b, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0a, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x48, 0x61, 0x73, 0x68, 0x42, 0x97, - 0x02, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x65, 0x72, 0x74, 0x75, 0x72, 0x65, 0x2e, - 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x76, 0x31, - 0x42, 0x1c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, - 0x65, 0x73, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, - 0x5a, 0x51, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x6c, 0x75, - 0x78, 0x6e, 0x69, 0x6e, 0x6a, 0x61, 0x2f, 0x61, 0x70, 0x65, 0x72, 0x74, 0x75, 0x72, 0x65, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, - 0x2f, 0x61, 0x70, 0x65, 0x72, 0x74, 0x75, 0x72, 0x65, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, - 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x41, 0x43, 0x43, 0xaa, 0x02, 0x19, 0x41, 0x70, 0x65, 0x72, - 0x74, 0x75, 0x72, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x19, 0x41, 0x70, 0x65, 0x72, 0x74, 0x75, 0x72, 0x65, - 0x5c, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5c, 0x56, - 0x31, 0xe2, 0x02, 0x25, 0x41, 0x70, 0x65, 0x72, 0x74, 0x75, 0x72, 0x65, 0x5c, 0x43, 0x6f, 0x6d, - 0x6d, 0x6f, 0x6e, 0x5c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, - 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1c, 0x41, 0x70, 0x65, 0x72, - 0x74, 0x75, 0x72, 0x65, 0x3a, 0x3a, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x3a, 0x3a, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x0a, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x48, 0x61, 0x73, 0x68, 0x22, 0xee, 0x01, 0x0a, 0x1a, + 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x44, 0x65, 0x63, 0x69, 0x73, + 0x69, 0x6f, 0x6e, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x12, 0x65, 0x0a, 0x15, 0x72, 0x61, + 0x74, 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x5f, 0x64, 0x65, 0x63, 0x69, 0x73, + 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x61, 0x70, 0x65, 0x72, + 0x74, 0x75, 0x72, 0x65, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x64, 0x65, 0x63, 0x69, + 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, + 0x69, 0x74, 0x65, 0x72, 0x44, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x72, 0x61, + 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x44, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, + 0x6e, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x5f, 0x69, + 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x70, + 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x6f, + 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0a, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x70, + 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0a, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x48, 0x61, 0x73, 0x68, 0x42, 0x97, 0x02, 0x0a, + 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x65, 0x72, 0x74, 0x75, 0x72, 0x65, 0x2e, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x76, 0x31, 0x42, 0x1c, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, + 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x51, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x6c, 0x75, 0x78, 0x6e, + 0x69, 0x6e, 0x6a, 0x61, 0x2f, 0x61, 0x70, 0x65, 0x72, 0x74, 0x75, 0x72, 0x65, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x61, + 0x70, 0x65, 0x72, 0x74, 0x75, 0x72, 0x65, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x76, + 0x31, 0xa2, 0x02, 0x03, 0x41, 0x43, 0x43, 0xaa, 0x02, 0x19, 0x41, 0x70, 0x65, 0x72, 0x74, 0x75, + 0x72, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x2e, 0x56, 0x31, 0xca, 0x02, 0x19, 0x41, 0x70, 0x65, 0x72, 0x74, 0x75, 0x72, 0x65, 0x5c, 0x43, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5c, 0x56, 0x31, 0xe2, + 0x02, 0x25, 0x41, 0x70, 0x65, 0x72, 0x74, 0x75, 0x72, 0x65, 0x5c, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x5c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1c, 0x41, 0x70, 0x65, 0x72, 0x74, 0x75, + 0x72, 0x65, 0x3a, 0x3a, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x3a, 0x3a, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/gen/proto/go/aperture/flowcontrol/v1/flowcontrol.pb.go b/api/gen/proto/go/aperture/flowcontrol/v1/flowcontrol.pb.go index 19c5cc7dce..96f1356a8e 100644 --- a/api/gen/proto/go/aperture/flowcontrol/v1/flowcontrol.pb.go +++ b/api/gen/proto/go/aperture/flowcontrol/v1/flowcontrol.pb.go @@ -531,9 +531,7 @@ type FluxMeter struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - PolicyName string `protobuf:"bytes,1,opt,name=policy_name,json=policyName,proto3" json:"policy_name,omitempty"` - PolicyHash string `protobuf:"bytes,2,opt,name=policy_hash,json=policyHash,proto3" json:"policy_hash,omitempty"` - FluxMeterName string `protobuf:"bytes,3,opt,name=flux_meter_name,json=fluxMeterName,proto3" json:"flux_meter_name,omitempty"` + FluxMeterName string `protobuf:"bytes,1,opt,name=flux_meter_name,json=fluxMeterName,proto3" json:"flux_meter_name,omitempty"` } func (x *FluxMeter) Reset() { @@ -568,20 +566,6 @@ func (*FluxMeter) Descriptor() ([]byte, []int) { return file_aperture_flowcontrol_v1_flowcontrol_proto_rawDescGZIP(), []int{4} } -func (x *FluxMeter) GetPolicyName() string { - if x != nil { - return x.PolicyName - } - return "" -} - -func (x *FluxMeter) GetPolicyHash() string { - if x != nil { - return x.PolicyHash - } - return "" -} - func (x *FluxMeter) GetFluxMeterName() string { if x != nil { return x.FluxMeterName @@ -805,45 +789,41 @@ var file_aperture_flowcontrol_v1_flowcontrol_proto_rawDesc = []byte{ 0x53, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x20, 0x0a, 0x1c, 0x4c, 0x49, 0x4d, 0x49, 0x54, 0x45, 0x52, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x4b, 0x45, 0x59, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, - 0x44, 0x10, 0x01, 0x42, 0x09, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x75, - 0x0a, 0x09, 0x46, 0x6c, 0x75, 0x78, 0x4d, 0x65, 0x74, 0x65, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x70, - 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, - 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0a, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x48, 0x61, 0x73, 0x68, 0x12, 0x26, 0x0a, - 0x0f, 0x66, 0x6c, 0x75, 0x78, 0x5f, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x66, 0x6c, 0x75, 0x78, 0x4d, 0x65, 0x74, 0x65, - 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x2a, 0x65, 0x0a, 0x0c, 0x44, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, - 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x19, 0x44, 0x45, 0x43, 0x49, 0x53, 0x49, 0x4f, - 0x4e, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, - 0x45, 0x44, 0x10, 0x00, 0x12, 0x1a, 0x0a, 0x16, 0x44, 0x45, 0x43, 0x49, 0x53, 0x49, 0x4f, 0x4e, - 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x41, 0x43, 0x43, 0x45, 0x50, 0x54, 0x45, 0x44, 0x10, 0x01, - 0x12, 0x1a, 0x0a, 0x16, 0x44, 0x45, 0x43, 0x49, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x54, 0x59, 0x50, - 0x45, 0x5f, 0x52, 0x45, 0x4a, 0x45, 0x43, 0x54, 0x45, 0x44, 0x10, 0x02, 0x32, 0x6e, 0x0a, 0x12, - 0x46, 0x6c, 0x6f, 0x77, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x12, 0x58, 0x0a, 0x05, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x25, 0x2e, 0x61, 0x70, - 0x65, 0x72, 0x74, 0x75, 0x72, 0x65, 0x2e, 0x66, 0x6c, 0x6f, 0x77, 0x63, 0x6f, 0x6e, 0x74, 0x72, - 0x6f, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x61, 0x70, 0x65, 0x72, 0x74, 0x75, 0x72, 0x65, 0x2e, 0x66, 0x6c, - 0x6f, 0x77, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, - 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x83, 0x02, 0x0a, - 0x1b, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x65, 0x72, 0x74, 0x75, 0x72, 0x65, 0x2e, 0x66, 0x6c, - 0x6f, 0x77, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x76, 0x31, 0x42, 0x10, 0x46, 0x6c, - 0x6f, 0x77, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, - 0x5a, 0x54, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x6c, 0x75, - 0x78, 0x6e, 0x69, 0x6e, 0x6a, 0x61, 0x2f, 0x61, 0x70, 0x65, 0x72, 0x74, 0x75, 0x72, 0x65, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, - 0x2f, 0x61, 0x70, 0x65, 0x72, 0x74, 0x75, 0x72, 0x65, 0x2f, 0x66, 0x6c, 0x6f, 0x77, 0x63, 0x6f, - 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2f, 0x76, 0x31, 0x3b, 0x66, 0x6c, 0x6f, 0x77, 0x63, 0x6f, 0x6e, - 0x74, 0x72, 0x6f, 0x6c, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x41, 0x46, 0x58, 0xaa, 0x02, 0x17, 0x41, - 0x70, 0x65, 0x72, 0x74, 0x75, 0x72, 0x65, 0x2e, 0x46, 0x6c, 0x6f, 0x77, 0x63, 0x6f, 0x6e, 0x74, - 0x72, 0x6f, 0x6c, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x17, 0x41, 0x70, 0x65, 0x72, 0x74, 0x75, 0x72, - 0x65, 0x5c, 0x46, 0x6c, 0x6f, 0x77, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x5c, 0x56, 0x31, - 0xe2, 0x02, 0x23, 0x41, 0x70, 0x65, 0x72, 0x74, 0x75, 0x72, 0x65, 0x5c, 0x46, 0x6c, 0x6f, 0x77, - 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x19, 0x41, 0x70, 0x65, 0x72, 0x74, 0x75, 0x72, - 0x65, 0x3a, 0x3a, 0x46, 0x6c, 0x6f, 0x77, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x3a, 0x3a, - 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x44, 0x10, 0x01, 0x42, 0x09, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x33, + 0x0a, 0x09, 0x46, 0x6c, 0x75, 0x78, 0x4d, 0x65, 0x74, 0x65, 0x72, 0x12, 0x26, 0x0a, 0x0f, 0x66, + 0x6c, 0x75, 0x78, 0x5f, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x66, 0x6c, 0x75, 0x78, 0x4d, 0x65, 0x74, 0x65, 0x72, 0x4e, + 0x61, 0x6d, 0x65, 0x2a, 0x65, 0x0a, 0x0c, 0x44, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x19, 0x44, 0x45, 0x43, 0x49, 0x53, 0x49, 0x4f, 0x4e, 0x5f, + 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, + 0x10, 0x00, 0x12, 0x1a, 0x0a, 0x16, 0x44, 0x45, 0x43, 0x49, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x54, + 0x59, 0x50, 0x45, 0x5f, 0x41, 0x43, 0x43, 0x45, 0x50, 0x54, 0x45, 0x44, 0x10, 0x01, 0x12, 0x1a, + 0x0a, 0x16, 0x44, 0x45, 0x43, 0x49, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, + 0x52, 0x45, 0x4a, 0x45, 0x43, 0x54, 0x45, 0x44, 0x10, 0x02, 0x32, 0x6e, 0x0a, 0x12, 0x46, 0x6c, + 0x6f, 0x77, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x12, 0x58, 0x0a, 0x05, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x25, 0x2e, 0x61, 0x70, 0x65, 0x72, + 0x74, 0x75, 0x72, 0x65, 0x2e, 0x66, 0x6c, 0x6f, 0x77, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x26, 0x2e, 0x61, 0x70, 0x65, 0x72, 0x74, 0x75, 0x72, 0x65, 0x2e, 0x66, 0x6c, 0x6f, 0x77, + 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x83, 0x02, 0x0a, 0x1b, 0x63, + 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x65, 0x72, 0x74, 0x75, 0x72, 0x65, 0x2e, 0x66, 0x6c, 0x6f, 0x77, + 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x76, 0x31, 0x42, 0x10, 0x46, 0x6c, 0x6f, 0x77, + 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x54, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x6c, 0x75, 0x78, 0x6e, + 0x69, 0x6e, 0x6a, 0x61, 0x2f, 0x61, 0x70, 0x65, 0x72, 0x74, 0x75, 0x72, 0x65, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x61, + 0x70, 0x65, 0x72, 0x74, 0x75, 0x72, 0x65, 0x2f, 0x66, 0x6c, 0x6f, 0x77, 0x63, 0x6f, 0x6e, 0x74, + 0x72, 0x6f, 0x6c, 0x2f, 0x76, 0x31, 0x3b, 0x66, 0x6c, 0x6f, 0x77, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x6f, 0x6c, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x41, 0x46, 0x58, 0xaa, 0x02, 0x17, 0x41, 0x70, 0x65, + 0x72, 0x74, 0x75, 0x72, 0x65, 0x2e, 0x46, 0x6c, 0x6f, 0x77, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, + 0x6c, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x17, 0x41, 0x70, 0x65, 0x72, 0x74, 0x75, 0x72, 0x65, 0x5c, + 0x46, 0x6c, 0x6f, 0x77, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x5c, 0x56, 0x31, 0xe2, 0x02, + 0x23, 0x41, 0x70, 0x65, 0x72, 0x74, 0x75, 0x72, 0x65, 0x5c, 0x46, 0x6c, 0x6f, 0x77, 0x63, 0x6f, + 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x19, 0x41, 0x70, 0x65, 0x72, 0x74, 0x75, 0x72, 0x65, 0x3a, + 0x3a, 0x46, 0x6c, 0x6f, 0x77, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x3a, 0x3a, 0x56, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/libsonnet/Makefile b/libsonnet/Makefile index 679f33a3a0..e49ced937a 100644 --- a/libsonnet/Makefile +++ b/libsonnet/Makefile @@ -1,7 +1,7 @@ gen-lib: @echo Generating library - @rm -rfd 1.0/_gen/* - @rm 1.0/*.libsonnet + @rm -rfd 1.0/_gen/* || true + @rm 1.0/*.libsonnet || true @python scripts/jsonnet-lib-gen.py --output-dir 1.0/ ../docs/gen/policies/gen.yaml @tk fmt 1.0/ @git add 1.0/* diff --git a/pkg/otelcollector/metricsprocessor/processor.go b/pkg/otelcollector/metricsprocessor/processor.go index cb07450892..199704d59d 100644 --- a/pkg/otelcollector/metricsprocessor/processor.go +++ b/pkg/otelcollector/metricsprocessor/processor.go @@ -177,7 +177,6 @@ func (p *metricsProcessor) addCheckResponseBasedLabels(attributes pcommon.Map, c } for _, fluxMeter := range checkResponse.FluxMeters { rawValue := []string{ - fmt.Sprintf("%s:%v", metrics.PolicyNameLabel, fluxMeter.GetPolicyName()), fmt.Sprintf("%s:%v", metrics.FluxMeterNameLabel, fluxMeter.GetFluxMeterName()), } value := strings.Join(rawValue, ",") @@ -266,14 +265,12 @@ func (p *metricsProcessor) updateMetricsForFluxMeters( latency float64, ) { fluxmeterHistogram := p.cfg.engine.GetFluxMeterHist( - fluxMeter.GetPolicyName(), fluxMeter.GetFluxMeterName(), statusCode, decisionType, ) if fluxmeterHistogram == nil { - log.Debug().Str(metrics.PolicyNameLabel, fluxMeter.GetPolicyName()). - Str(metrics.FluxMeterNameLabel, fluxMeter.GetFluxMeterName()). + log.Debug().Str(metrics.FluxMeterNameLabel, fluxMeter.GetFluxMeterName()). Str(metrics.DecisionTypeLabel, decisionType.String()). Str(metrics.StatusCodeLabel, statusCode). Msg("Fluxmeter not found") diff --git a/pkg/otelcollector/metricsprocessor/processor_test.go b/pkg/otelcollector/metricsprocessor/processor_test.go index 3af9197aa0..95a562fc76 100644 --- a/pkg/otelcollector/metricsprocessor/processor_test.go +++ b/pkg/otelcollector/metricsprocessor/processor_test.go @@ -97,8 +97,6 @@ var _ = Describe("Metrics Processor", func() { }, FluxMeters: []*flowcontrolv1.FluxMeter{ { - PolicyName: "foo", - PolicyHash: "foo-hash", FluxMeterName: "bar", }, }, @@ -121,7 +119,7 @@ var _ = Describe("Metrics Processor", func() { otelcollector.DecisionTypeLabel: "DECISION_TYPE_REJECTED", otelcollector.DecisionErrorReasonLabel: "", otelcollector.DecisionRejectReasonLabel: "", - otelcollector.FluxMetersLabel: []interface{}{"policy_name:foo,flux_meter_name:bar"}, + otelcollector.FluxMetersLabel: []interface{}{"flux_meter_name:bar"}, otelcollector.RateLimitersLabel: []interface{}{}, otelcollector.DroppingRateLimitersLabel: []interface{}{}, otelcollector.ConcurrencyLimitersLabel: []interface{}{"policy_name:foo,component_index:1,workload_index:0,policy_hash:foo-hash"}, @@ -317,8 +315,6 @@ var _ = Describe("Metrics Processor", func() { }, FluxMeters: []*flowcontrolv1.FluxMeter{ { - PolicyName: "foo", - PolicyHash: "foo-hash", FluxMeterName: "bar", }, }, @@ -337,7 +333,7 @@ var _ = Describe("Metrics Processor", func() { otelcollector.DecisionTypeLabel: "DECISION_TYPE_REJECTED", otelcollector.DecisionErrorReasonLabel: "", otelcollector.DecisionRejectReasonLabel: "", - otelcollector.FluxMetersLabel: []interface{}{"policy_name:foo,flux_meter_name:bar"}, + otelcollector.FluxMetersLabel: []interface{}{"flux_meter_name:bar"}, otelcollector.RateLimitersLabel: []interface{}{}, otelcollector.DroppingRateLimitersLabel: []interface{}{}, otelcollector.ConcurrencyLimitersLabel: []interface{}{"policy_name:foo,component_index:1,workload_index:0,policy_hash:foo-hash"}, @@ -587,7 +583,7 @@ func expectEngineCalls(engine *mocks.MockEngine, checkResponse *flowcontrolv1.Ch expectedCalls := make([]*gomock.Call, len(checkResponse.FluxMeters)) for i, fm := range checkResponse.FluxMeters { // TODO actually return some Histogram - expectedCalls[i] = engine.EXPECT().GetFluxMeterHist(fm.GetPolicyName(), fm.GetFluxMeterName(), "201", flowcontrolv1.DecisionType_DECISION_TYPE_REJECTED).Return(nil) + expectedCalls[i] = engine.EXPECT().GetFluxMeterHist(fm.GetFluxMeterName(), "201", flowcontrolv1.DecisionType_DECISION_TYPE_REJECTED).Return(nil) } gomock.InOrder(expectedCalls...) } diff --git a/pkg/paths/paths.go b/pkg/paths/paths.go index 3129ecfecf..1947b90570 100644 --- a/pkg/paths/paths.go +++ b/pkg/paths/paths.go @@ -44,8 +44,8 @@ func DataplaneComponentKey(agentGroupName, policyName string, componentIndex int } // FluxMeterKey returns the identifier for FluxMeter in etcd. -func FluxMeterKey(agentGroupName, policyName, fluxMeterName string) string { - return PolicyPrefix(agentGroupName, policyName) + "-flux_meter-" + fluxMeterName +func FluxMeterKey(agentGroupName, fluxMeterName string) string { + return AgentGroupPrefix(agentGroupName) + "-flux_meter-" + fluxMeterName } // ClassifierKey returns the identifier for a Classifier in etcd. diff --git a/pkg/policies/controlplane/resources/fluxmeter/flux-meter.go b/pkg/policies/controlplane/resources/fluxmeter/flux-meter.go index afb952c40a..e6f576d851 100644 --- a/pkg/policies/controlplane/resources/fluxmeter/flux-meter.go +++ b/pkg/policies/controlplane/resources/fluxmeter/flux-meter.go @@ -39,7 +39,7 @@ func NewFluxMeterOptions( agentGroup := selectorProto.GetAgentGroup() etcdPath := path.Join(paths.FluxMeterConfigPath, - paths.FluxMeterKey(agentGroup, policyBaseAPI.GetPolicyName(), name)) + paths.FluxMeterKey(agentGroup, name)) configSync := &fluxMeterConfigSync{ fluxMeterProto: fluxMeterProto, policyBaseAPI: policyBaseAPI, @@ -61,8 +61,6 @@ func (configSync *fluxMeterConfigSync) doSync(etcdClient *etcdclient.Client, lif wrapper := &configv1.FluxMeterWrapper{ FluxmeterName: configSync.fluxmeterName, FluxMeter: configSync.fluxMeterProto, - PolicyName: configSync.policyBaseAPI.GetPolicyName(), - PolicyHash: configSync.policyBaseAPI.GetPolicyHash(), } dat, err := proto.Marshal(wrapper) if err != nil { diff --git a/pkg/policies/dataplane/engine.go b/pkg/policies/dataplane/engine.go index b0108d9d00..c5ade086ef 100644 --- a/pkg/policies/dataplane/engine.go +++ b/pkg/policies/dataplane/engine.go @@ -10,7 +10,6 @@ import ( selectorv1 "github.com/fluxninja/aperture/api/gen/proto/go/aperture/common/selector/v1" flowcontrolv1 "github.com/fluxninja/aperture/api/gen/proto/go/aperture/flowcontrol/v1" - "github.com/fluxninja/aperture/pkg/log" "github.com/fluxninja/aperture/pkg/multimatcher" "github.com/fluxninja/aperture/pkg/panichandler" "github.com/fluxninja/aperture/pkg/policies/dataplane/iface" @@ -71,8 +70,6 @@ func (e *Engine) ProcessRequest(controlPoint selectors.ControlPoint, serviceIDs fluxMeterProtos := make([]*flowcontrolv1.FluxMeter, len(fluxMeters)) for i, fluxMeter := range fluxMeters { fluxMeterProtos[i] = &flowcontrolv1.FluxMeter{ - PolicyName: fluxMeter.GetPolicyName(), - PolicyHash: fluxMeter.GetPolicyHash(), FluxMeterName: fluxMeter.GetFluxMeterName(), } } @@ -169,7 +166,7 @@ func (e *Engine) UnregisterConcurrencyLimiter(cl iface.Limiter) error { return e.unregister("ConcurrencyLimiter:"+cl.GetLimiterID().String(), selectorProto) } -// RegisterFluxMeter adds fluxmeter to histogram map. +// RegisterFluxMeter adds fluxmeter to histogram map and multimatcher. func (e *Engine) RegisterFluxMeter(fm iface.FluxMeter) error { // Save the histogram in fluxMeterHists indexed by metric id e.fluxMeterMapMutex.Lock() @@ -193,7 +190,7 @@ func (e *Engine) RegisterFluxMeter(fm iface.FluxMeter) error { return e.register("FluxMeter:"+fm.GetFluxMeterID().String(), selectorProto, fluxMeterMatchedCB) } -// UnregisterFluxMeter removes fluxmeter from histogram map. +// UnregisterFluxMeter removes fluxmeter from histogram map and multimatcher. func (e *Engine) UnregisterFluxMeter(fm iface.FluxMeter) error { // Remove the histogram from fluxMeterHists indexed by metric id e.fluxMeterMapMutex.Lock() @@ -206,11 +203,10 @@ func (e *Engine) UnregisterFluxMeter(fm iface.FluxMeter) error { } // GetFluxMeterHist Lookup function for getting histogram. -func (e *Engine) GetFluxMeterHist(policyName, fluxMeterName, statusCode string, decisionType flowcontrolv1.DecisionType) prometheus.Observer { +func (e *Engine) GetFluxMeterHist(fluxMeterName, statusCode string, decisionType flowcontrolv1.DecisionType) prometheus.Observer { e.fluxMeterMapMutex.RLock() defer e.fluxMeterMapMutex.RUnlock() fmID := iface.FluxMeterID{ - PolicyName: policyName, FluxMeterName: fluxMeterName, } fluxMeter := e.fluxMetersMap[fmID] @@ -279,7 +275,6 @@ func (e *Engine) register(key string, selectorProto *selectorv1.Selector, matche selector, err := selectors.FromProto(selectorProto) if err != nil { - log.Warn().Err(err).Msg("Failed to parse selector") return fmt.Errorf("failed to parse selector: %v", err) } @@ -302,15 +297,13 @@ func (e *Engine) unregister(key string, selectorProto *selectorv1.Selector) erro selector, err := selectors.FromProto(selectorProto) if err != nil { - log.Warn().Err(err).Msg("Failed to parse selector") return fmt.Errorf("failed to parse selector: %v", err) } // check if multi matcher exists for this control point id mm, ok := e.multiMatchers[selector.ControlPointID] if !ok { - log.Warn().Msg("Unable to unregister, multi matcher not found for control point id") - return nil + return fmt.Errorf("unable to unregister, multi matcher not found for control point id: %v", selector.ControlPointID) } err = mm.RemoveEntry(key) if err != nil { diff --git a/pkg/policies/dataplane/engine_test.go b/pkg/policies/dataplane/engine_test.go index 85c483097b..a2c9a35bd2 100644 --- a/pkg/policies/dataplane/engine_test.go +++ b/pkg/policies/dataplane/engine_test.go @@ -54,7 +54,6 @@ var _ = Describe("Dataplane Engine", func() { }, }) fluxMeterID = iface.FluxMeterID{ - PolicyName: "test", FluxMeterName: "test", } limiterID = iface.LimiterID{ @@ -85,7 +84,7 @@ var _ = Describe("Dataplane Engine", func() { It("Unregisters not registered scheduler actuator", func() { err := engine.UnregisterConcurrencyLimiter(mockLimiter) - Expect(err).NotTo(HaveOccurred()) + Expect(err).To(HaveOccurred()) }) It("Unregisters existing scheduler actuator", func() { @@ -98,9 +97,7 @@ var _ = Describe("Dataplane Engine", func() { Context("Flux meter", func() { BeforeEach(func() { - mockFluxmeter.EXPECT().GetPolicyName().Return("test").AnyTimes() mockFluxmeter.EXPECT().GetFluxMeterName().Return("test").AnyTimes() - mockFluxmeter.EXPECT().GetPolicyHash().Return("test").AnyTimes() mockFluxmeter.EXPECT().GetSelector().Return(selector).AnyTimes() mockFluxmeter.EXPECT().GetHistogram(flowcontrolv1.DecisionType_DECISION_TYPE_REJECTED, "200").Return(histogram).AnyTimes() mockFluxmeter.EXPECT().GetFluxMeterID().Return(fluxMeterID).AnyTimes() @@ -120,7 +117,7 @@ var _ = Describe("Dataplane Engine", func() { It("Unregisters not registered Flux meter", func() { err := engine.UnregisterFluxMeter(mockFluxmeter) - Expect(err).NotTo(HaveOccurred()) + Expect(err).To(HaveOccurred()) }) It("Unregisters existing Flux meter", func() { @@ -131,13 +128,13 @@ var _ = Describe("Dataplane Engine", func() { }) It("Tries to get unregistered fluxmeter hist", func() { - hist := engine.GetFluxMeterHist("test", "test", "200", flowcontrolv1.DecisionType_DECISION_TYPE_REJECTED) + hist := engine.GetFluxMeterHist("test", "200", flowcontrolv1.DecisionType_DECISION_TYPE_REJECTED) Expect(hist).To(BeNil()) }) It("Returns registered fluxmeter hist", func() { err := engine.RegisterFluxMeter(mockFluxmeter) - hist := engine.GetFluxMeterHist("test", "test", "200", flowcontrolv1.DecisionType_DECISION_TYPE_REJECTED) + hist := engine.GetFluxMeterHist("test", "200", flowcontrolv1.DecisionType_DECISION_TYPE_REJECTED) Expect(err).NotTo(HaveOccurred()) Expect(hist).To(Equal(histogram)) }) @@ -149,9 +146,7 @@ var _ = Describe("Dataplane Engine", func() { mockLimiter.EXPECT().GetSelector().Return(selector).AnyTimes() mockLimiter.EXPECT().GetLimiterID().Return(limiterID).AnyTimes() - mockFluxmeter.EXPECT().GetPolicyName().Return("test").AnyTimes() mockFluxmeter.EXPECT().GetFluxMeterName().Return("test").AnyTimes() - mockFluxmeter.EXPECT().GetPolicyHash().Return("test").AnyTimes() mockFluxmeter.EXPECT().GetSelector().Return(selector).AnyTimes() mockFluxmeter.EXPECT().GetHistogram(flowcontrolv1.DecisionType_DECISION_TYPE_REJECTED, "503").Return(histogram).AnyTimes() mockFluxmeter.EXPECT().GetFluxMeterID().Return(fluxMeterID).AnyTimes() diff --git a/pkg/policies/dataplane/iface/engine.go b/pkg/policies/dataplane/iface/engine.go index f3542705eb..622469af1a 100644 --- a/pkg/policies/dataplane/iface/engine.go +++ b/pkg/policies/dataplane/iface/engine.go @@ -20,7 +20,7 @@ type Engine interface { RegisterFluxMeter(fm FluxMeter) error UnregisterFluxMeter(fm FluxMeter) error - GetFluxMeterHist(policyName, fluxMeterName, statusCode string, decisionType flowcontrolv1.DecisionType) prometheus.Observer + GetFluxMeterHist(fluxMeterName, statusCode string, decisionType flowcontrolv1.DecisionType) prometheus.Observer RegisterRateLimiter(l RateLimiter) error UnregisterRateLimiter(l RateLimiter) error diff --git a/pkg/policies/dataplane/iface/flux-meter.go b/pkg/policies/dataplane/iface/flux-meter.go index 10bfaabb72..19128856f4 100644 --- a/pkg/policies/dataplane/iface/flux-meter.go +++ b/pkg/policies/dataplane/iface/flux-meter.go @@ -5,34 +5,25 @@ import ( selectorv1 "github.com/fluxninja/aperture/api/gen/proto/go/aperture/common/selector/v1" flowcontrolv1 "github.com/fluxninja/aperture/api/gen/proto/go/aperture/flowcontrol/v1" - policylangv1 "github.com/fluxninja/aperture/api/gen/proto/go/aperture/policy/language/v1" ) //go:generate mockgen -source=flux-meter.go -destination=../../mocks/mock_flux_meter.go -package=mocks // FluxMeterID is the ID of the FluxMeter. type FluxMeterID struct { - PolicyName string FluxMeterName string } // String function returns the FluxMeterID as a string. func (fmID FluxMeterID) String() string { - return "policy_name-" + fmID.PolicyName + "-flux_meter_name-" + fmID.FluxMeterName + return "flux_meter_name-" + fmID.FluxMeterName } // FluxMeter in an interface for interacting with fluxmeters. type FluxMeter interface { - // Policy - GetPolicyName() string - GetPolicyHash() string - // GetSelector returns the selector GetSelector() *selectorv1.Selector - // GetFluxMeterProto returns the flux meter proto - GetFluxMeterProto() *policylangv1.FluxMeter - // GetFluxMeterName returns the metric name GetFluxMeterName() string diff --git a/pkg/policies/dataplane/resources/fluxmeter/flux-meter.go b/pkg/policies/dataplane/resources/fluxmeter/flux-meter.go index e77d8dbd1c..0c3c9a827c 100644 --- a/pkg/policies/dataplane/resources/fluxmeter/flux-meter.go +++ b/pkg/policies/dataplane/resources/fluxmeter/flux-meter.go @@ -11,7 +11,6 @@ import ( configv1 "github.com/fluxninja/aperture/api/gen/proto/go/aperture/common/config/v1" selectorv1 "github.com/fluxninja/aperture/api/gen/proto/go/aperture/common/selector/v1" flowcontrolv1 "github.com/fluxninja/aperture/api/gen/proto/go/aperture/flowcontrol/v1" - policylangv1 "github.com/fluxninja/aperture/api/gen/proto/go/aperture/policy/language/v1" "github.com/fluxninja/aperture/pkg/agentinfo" "github.com/fluxninja/aperture/pkg/config" etcdclient "github.com/fluxninja/aperture/pkg/etcd/client" @@ -89,7 +88,6 @@ func setupFluxMeterModule( histMetric := prometheus.NewHistogramVec(prometheus.HistogramOpts{ Name: metrics.FluxMeterMetricName, }, []string{ - metrics.PolicyNameLabel, metrics.FluxMeterNameLabel, metrics.DecisionTypeLabel, metrics.StatusCodeLabel, @@ -135,13 +133,11 @@ func setupFluxMeterModule( return nil } -// FluxMeter describes single fluxmeter from policy. +// FluxMeter describes single fluxmeter. type FluxMeter struct { - iface.Policy - selector *selectorv1.Selector - fluxMeterProto *policylangv1.FluxMeter - fluxMeterName string - buckets []float64 + selector *selectorv1.Selector + fluxMeterName string + buckets []float64 } // NewFluxMeterOptions creates fluxmeter for usage in dataplane and also returns its fx options. @@ -162,11 +158,9 @@ func NewFluxMeterOptions( fluxMeterProto := wrapperMessage.FluxMeter fluxMeter := &FluxMeter{ - fluxMeterProto: fluxMeterProto, - Policy: wrapperMessage, - fluxMeterName: wrapperMessage.FluxmeterName, - selector: fluxMeterProto.GetSelector(), - buckets: fluxMeterProto.GetHistogramBuckets(), + fluxMeterName: wrapperMessage.FluxmeterName, + selector: fluxMeterProto.GetSelector(), + buckets: fluxMeterProto.GetHistogramBuckets(), } return fx.Options( @@ -177,7 +171,6 @@ func NewFluxMeterOptions( func (fluxMeter *FluxMeter) setup(lc fx.Lifecycle, prometheusRegistry *prometheus.Registry) { metricLabels := make(map[string]string) - metricLabels[metrics.PolicyNameLabel] = fluxMeter.GetPolicyName() metricLabels[metrics.FluxMeterNameLabel] = fluxMeter.GetFluxMeterName() lc.Append(fx.Hook{ @@ -185,7 +178,7 @@ func (fluxMeter *FluxMeter) setup(lc fx.Lifecycle, prometheusRegistry *prometheu // Register metric with PCA err := engineAPI.RegisterFluxMeter(fluxMeter) if err != nil { - log.Error().Err(err).Msgf("Failed to register FluxMeter %s with PolicyConfigAPI", fluxMeter.fluxMeterName) + log.Error().Err(err).Msgf("Failed to register FluxMeter %s with EngineAPI", fluxMeter.fluxMeterName) return err } return nil @@ -195,12 +188,12 @@ func (fluxMeter *FluxMeter) setup(lc fx.Lifecycle, prometheusRegistry *prometheu // Unregister metric with PCA err := engineAPI.UnregisterFluxMeter(fluxMeter) if err != nil { - log.Error().Err(err).Msgf("Failed to unregister FluxMeter %s with PolicyConfigAPI", fluxMeter.fluxMeterName) + log.Error().Err(err).Msgf("Failed to unregister FluxMeter %s with EngineAPI", fluxMeter.fluxMeterName) errMulti = multierr.Append(errMulti, err) } // Delete this specific fluxmeter from prometheus deleted := histogramVec.DeletePartialMatch(metricLabels) - log.Info().Msgf("Deleted %d metrics for fluxmeter: %+v in policy %s", deleted, fluxMeter.GetFluxMeterName(), fluxMeter.GetPolicyName()) + log.Info().Msgf("Deleted %d metrics for fluxmeter: %+v", deleted, fluxMeter.GetFluxMeterName()) return errMulti }, @@ -212,11 +205,6 @@ func (fluxMeter *FluxMeter) GetSelector() *selectorv1.Selector { return fluxMeter.selector } -// GetFluxMeterProto returns the flux meter proto. -func (fluxMeter *FluxMeter) GetFluxMeterProto() *policylangv1.FluxMeter { - return fluxMeter.fluxMeterProto -} - // GetFluxMeterName returns the metric name. func (fluxMeter *FluxMeter) GetFluxMeterName() string { return fluxMeter.fluxMeterName @@ -225,7 +213,6 @@ func (fluxMeter *FluxMeter) GetFluxMeterName() string { // GetFluxMeterID returns the flux meter ID. func (fluxMeter *FluxMeter) GetFluxMeterID() iface.FluxMeterID { return iface.FluxMeterID{ - PolicyName: fluxMeter.GetPolicyName(), FluxMeterName: fluxMeter.GetFluxMeterName(), } } @@ -235,7 +222,6 @@ func (fluxMeter *FluxMeter) GetHistogram(decisionType flowcontrolv1.DecisionType labels := make(map[string]string) labels[metrics.DecisionTypeLabel] = decisionType.String() labels[metrics.StatusCodeLabel] = statusCode - labels[metrics.PolicyNameLabel] = fluxMeter.GetPolicyName() labels[metrics.FluxMeterNameLabel] = fluxMeter.GetFluxMeterName() fluxMeterHistogram, err := histogramVec.GetMetricWith(labels) diff --git a/pkg/policies/mocks/mock_engine.go b/pkg/policies/mocks/mock_engine.go index 120af1c39b..1077fec004 100644 --- a/pkg/policies/mocks/mock_engine.go +++ b/pkg/policies/mocks/mock_engine.go @@ -39,17 +39,17 @@ func (m *MockEngine) EXPECT() *MockEngineMockRecorder { } // GetFluxMeterHist mocks base method. -func (m *MockEngine) GetFluxMeterHist(policyName, fluxMeterName, statusCode string, decisionType flowcontrolv1.DecisionType) prometheus.Observer { +func (m *MockEngine) GetFluxMeterHist(fluxMeterName, statusCode string, decisionType flowcontrolv1.DecisionType) prometheus.Observer { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetFluxMeterHist", policyName, fluxMeterName, statusCode, decisionType) + ret := m.ctrl.Call(m, "GetFluxMeterHist", fluxMeterName, statusCode, decisionType) ret0, _ := ret[0].(prometheus.Observer) return ret0 } // GetFluxMeterHist indicates an expected call of GetFluxMeterHist. -func (mr *MockEngineMockRecorder) GetFluxMeterHist(policyName, fluxMeterName, statusCode, decisionType interface{}) *gomock.Call { +func (mr *MockEngineMockRecorder) GetFluxMeterHist(fluxMeterName, statusCode, decisionType interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetFluxMeterHist", reflect.TypeOf((*MockEngine)(nil).GetFluxMeterHist), policyName, fluxMeterName, statusCode, decisionType) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetFluxMeterHist", reflect.TypeOf((*MockEngine)(nil).GetFluxMeterHist), fluxMeterName, statusCode, decisionType) } // ProcessRequest mocks base method. diff --git a/pkg/policies/mocks/mock_flux_meter.go b/pkg/policies/mocks/mock_flux_meter.go index 5d01a4c9b3..dac387c12e 100644 --- a/pkg/policies/mocks/mock_flux_meter.go +++ b/pkg/policies/mocks/mock_flux_meter.go @@ -9,7 +9,6 @@ import ( selectorv1 "github.com/fluxninja/aperture/api/gen/proto/go/aperture/common/selector/v1" flowcontrolv1 "github.com/fluxninja/aperture/api/gen/proto/go/aperture/flowcontrol/v1" - languagev1 "github.com/fluxninja/aperture/api/gen/proto/go/aperture/policy/language/v1" iface "github.com/fluxninja/aperture/pkg/policies/dataplane/iface" gomock "github.com/golang/mock/gomock" prometheus "github.com/prometheus/client_golang/prometheus" @@ -80,20 +79,6 @@ func (mr *MockFluxMeterMockRecorder) GetFluxMeterName() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetFluxMeterName", reflect.TypeOf((*MockFluxMeter)(nil).GetFluxMeterName)) } -// GetFluxMeterProto mocks base method. -func (m *MockFluxMeter) GetFluxMeterProto() *languagev1.FluxMeter { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetFluxMeterProto") - ret0, _ := ret[0].(*languagev1.FluxMeter) - return ret0 -} - -// GetFluxMeterProto indicates an expected call of GetFluxMeterProto. -func (mr *MockFluxMeterMockRecorder) GetFluxMeterProto() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetFluxMeterProto", reflect.TypeOf((*MockFluxMeter)(nil).GetFluxMeterProto)) -} - // GetHistogram mocks base method. func (m *MockFluxMeter) GetHistogram(arg0 flowcontrolv1.DecisionType, arg1 string) prometheus.Observer { m.ctrl.T.Helper() @@ -108,34 +93,6 @@ func (mr *MockFluxMeterMockRecorder) GetHistogram(arg0, arg1 interface{}) *gomoc return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetHistogram", reflect.TypeOf((*MockFluxMeter)(nil).GetHistogram), arg0, arg1) } -// GetPolicyHash mocks base method. -func (m *MockFluxMeter) GetPolicyHash() string { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetPolicyHash") - ret0, _ := ret[0].(string) - return ret0 -} - -// GetPolicyHash indicates an expected call of GetPolicyHash. -func (mr *MockFluxMeterMockRecorder) GetPolicyHash() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPolicyHash", reflect.TypeOf((*MockFluxMeter)(nil).GetPolicyHash)) -} - -// GetPolicyName mocks base method. -func (m *MockFluxMeter) GetPolicyName() string { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetPolicyName") - ret0, _ := ret[0].(string) - return ret0 -} - -// GetPolicyName indicates an expected call of GetPolicyName. -func (mr *MockFluxMeterMockRecorder) GetPolicyName() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPolicyName", reflect.TypeOf((*MockFluxMeter)(nil).GetPolicyName)) -} - // GetSelector mocks base method. func (m *MockFluxMeter) GetSelector() *selectorv1.Selector { m.ctrl.T.Helper()