Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ishustava committed Oct 13, 2023
1 parent ba931cb commit 99d1869
Show file tree
Hide file tree
Showing 5 changed files with 171 additions and 195 deletions.
3 changes: 3 additions & 0 deletions internal/mesh/internal/types/errors.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1

package types

import (
Expand Down
17 changes: 4 additions & 13 deletions internal/mesh/internal/types/proxy_configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@
package types

import (
"github.com/hashicorp/go-multierror"

"github.com/hashicorp/consul/internal/catalog"
"math"

"github.com/hashicorp/go-multierror"

"github.com/hashicorp/consul/internal/catalog"

"github.com/hashicorp/consul/internal/resource"
pbmesh "github.com/hashicorp/consul/proto-public/pbmesh/v2beta1"
"github.com/hashicorp/consul/proto-public/pbresource"
Expand All @@ -20,9 +18,9 @@ import (

func RegisterProxyConfiguration(r resource.Registry) {
r.Register(resource.Registration{
Type: pbmesh.ProxyConfigurationType,
Proto: &pbmesh.ProxyConfiguration{},
Scope: resource.ScopeNamespace,
Type: pbmesh.ProxyConfigurationType,
Proto: &pbmesh.ProxyConfiguration{},
Scope: resource.ScopeNamespace,
Mutate: MutateProxyConfiguration,
Validate: ValidateProxyConfiguration,
})
Expand Down Expand Up @@ -127,13 +125,6 @@ func validateDynamicProxyConfiguration(cfg *pbmesh.DynamicConfig) error {
})
}

if cfg.GetEnvoyExtensions() != nil {
err = multierror.Append(err, resource.ErrInvalidField{
Name: "envoy_extensions",
Wrapped: resource.ErrUnsupported,
})
}

if cfg.GetPublicListenerJson() != "" {
err = multierror.Append(err, resource.ErrInvalidField{
Name: "public_listener_json",
Expand Down
3 changes: 1 addition & 2 deletions internal/mesh/internal/types/proxy_configuration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ func TestValidateProxyConfiguration_AllFieldsInvalid(t *testing.T) {
MutualTlsMode: pbmesh.MutualTLSMode_MUTUAL_TLS_MODE_PERMISSIVE,
MeshGatewayMode: pbmesh.MeshGatewayMode_MESH_GATEWAY_MODE_LOCAL,
AccessLogs: &pbmesh.AccessLogsConfig{},
EnvoyExtensions: []*pbmesh.EnvoyExtension{{Name: "foo"}},
PublicListenerJson: "listener-json",
ListenerTracingJson: "tracing-json",
LocalClusterJson: "cluster-json",
Expand Down Expand Up @@ -157,7 +156,6 @@ func TestValidateProxyConfiguration_AllFieldsInvalid(t *testing.T) {
"mutual_tls_mode",
"mesh_gateway_mode",
"access_logs",
"envoy_extensions",
"public_listener_json",
"listener_tracing_json",
"local_cluster_json",
Expand Down Expand Up @@ -338,6 +336,7 @@ func TestValidateProxyConfiguration_WorkloadSelector(t *testing.T) {
Names: []string{"blah"},
Filter: "metadata.foo == bar",
},
DynamicConfig: &pbmesh.DynamicConfig{},
},
},
}
Expand Down
Loading

0 comments on commit 99d1869

Please sign in to comment.