Skip to content
45 changes: 22 additions & 23 deletions depot/containerstore/proxy_config_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,13 @@ import (
envoy_discovery "github.com/envoyproxy/go-control-plane/envoy/service/discovery/v3"
envoy_matcher "github.com/envoyproxy/go-control-plane/envoy/type/matcher/v3"
ghodss_yaml "github.com/ghodss/yaml"
"github.com/golang/protobuf/ptypes/any"
"github.com/golang/protobuf/ptypes/duration"
pstruct "github.com/golang/protobuf/ptypes/struct"
"github.com/golang/protobuf/ptypes/wrappers"
"github.com/tedsuo/ifrit"
"google.golang.org/protobuf/encoding/protojson"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/types/known/anypb"
"google.golang.org/protobuf/types/known/durationpb"
"google.golang.org/protobuf/types/known/structpb"
"google.golang.org/protobuf/types/known/wrapperspb"
)

const (
Expand Down Expand Up @@ -354,7 +353,7 @@ func generateProxyConfig(
clusters = append(clusters, &envoy_cluster.Cluster{
Name: clusterName,
ClusterDiscoveryType: &envoy_cluster.Cluster_Type{Type: envoy_cluster.Cluster_STATIC},
ConnectTimeout: &duration.Duration{Nanos: TimeOut},
ConnectTimeout: &durationpb.Duration{Nanos: TimeOut},
LoadAssignment: &envoy_endpoint.ClusterLoadAssignment{
ClusterName: clusterName,
Endpoints: []*envoy_endpoint.LocalityLbEndpoints{{
Expand All @@ -369,9 +368,9 @@ func generateProxyConfig(
},
CircuitBreakers: &envoy_cluster.CircuitBreakers{
Thresholds: []*envoy_cluster.CircuitBreakers_Thresholds{
{MaxConnections: &wrappers.UInt32Value{Value: math.MaxUint32}},
{MaxPendingRequests: &wrappers.UInt32Value{Value: math.MaxUint32}},
{MaxRequests: &wrappers.UInt32Value{Value: math.MaxUint32}},
{MaxConnections: &wrapperspb.UInt32Value{Value: math.MaxUint32}},
{MaxPendingRequests: &wrapperspb.UInt32Value{Value: math.MaxUint32}},
{MaxRequests: &wrapperspb.UInt32Value{Value: math.MaxUint32}},
}},
})
}
Expand Down Expand Up @@ -405,18 +404,18 @@ func generateProxyConfig(
{
Name: "static-layer",
LayerSpecifier: &envoy_bootstrap.RuntimeLayer_StaticLayer{
StaticLayer: &pstruct.Struct{
Fields: map[string]*pstruct.Value{
"envoy": &pstruct.Value{
Kind: &pstruct.Value_StructValue{
StructValue: &pstruct.Struct{
Fields: map[string]*pstruct.Value{
"reloadable_features": &pstruct.Value{
Kind: &pstruct.Value_StructValue{
StructValue: &pstruct.Struct{
Fields: map[string]*pstruct.Value{
"new_tcp_connection_pool": &pstruct.Value{
Kind: &pstruct.Value_BoolValue{
StaticLayer: &structpb.Struct{
Fields: map[string]*structpb.Value{
"envoy": &structpb.Value{
Kind: &structpb.Value_StructValue{
StructValue: &structpb.Struct{
Fields: map[string]*structpb.Value{
"reloadable_features": &structpb.Value{
Kind: &structpb.Value_StructValue{
StructValue: &structpb.Struct{
Fields: map[string]*structpb.Value{
"new_tcp_connection_pool": &structpb.Value{
Kind: &structpb.Value_BoolValue{
BoolValue: false,
},
},
Expand Down Expand Up @@ -455,7 +454,7 @@ func generateProxyConfig(
clusters = append(clusters, &envoy_cluster.Cluster{
Name: AdsClusterName,
ClusterDiscoveryType: &envoy_cluster.Cluster_Type{Type: envoy_cluster.Cluster_STATIC},
ConnectTimeout: &duration.Duration{Nanos: TimeOut},
ConnectTimeout: &durationpb.Duration{Nanos: TimeOut},
LoadAssignment: &envoy_endpoint.ClusterLoadAssignment{
ClusterName: AdsClusterName,
Endpoints: []*envoy_endpoint.LocalityLbEndpoints{{
Expand Down Expand Up @@ -567,7 +566,7 @@ func generateListeners(container executor.Container, requireClientCerts, http2En
}

if requireClientCerts && portMap.ContainerTLSProxyPort != C2CTLSPort {
tlsContext.RequireClientCertificate = &wrappers.BoolValue{Value: requireClientCerts}
tlsContext.RequireClientCertificate = &wrapperspb.BoolValue{Value: requireClientCerts}
tlsContext.CommonTlsContext.ValidationContextType = &envoy_tls.CommonTlsContext_ValidationContextSdsSecretConfig{
ValidationContextSdsSecretConfig: &envoy_tls.SdsSecretConfig{
Name: "id-validation-context",
Expand Down Expand Up @@ -669,7 +668,7 @@ func writeDiscoveryResponseYAML(resourceMsg proto.Message, outPath string) error
}
dr := &envoy_discovery.DiscoveryResponse{
VersionInfo: "0",
Resources: []*any.Any{
Resources: []*anypb.Any{
resourceAny,
},
}
Expand Down
14 changes: 7 additions & 7 deletions depot/containerstore/proxy_config_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ import (
envoy_matcher "github.com/envoyproxy/go-control-plane/envoy/type/matcher/v3"
"github.com/fsnotify/fsnotify"
ghodss_yaml "github.com/ghodss/yaml"
"github.com/golang/protobuf/ptypes/duration"
"github.com/golang/protobuf/ptypes/wrappers"
uuid "github.com/nu7hatch/gouuid"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"google.golang.org/protobuf/encoding/protojson"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/types/known/anypb"
"google.golang.org/protobuf/types/known/durationpb"
"google.golang.org/protobuf/types/known/wrapperspb"
)

var _ = Describe("ProxyConfigHandler", func() {
Expand Down Expand Up @@ -1089,7 +1089,7 @@ func createListener(config expectedListener) *envoy_listener.Listener {
},
}
if config.requireClientCertificate {
tlsContext.RequireClientCertificate = &wrappers.BoolValue{Value: true}
tlsContext.RequireClientCertificate = &wrapperspb.BoolValue{Value: true}
tlsContext.CommonTlsContext.ValidationContextType = &envoy_tls.CommonTlsContext_ValidationContextSdsSecretConfig{
ValidationContextSdsSecretConfig: &envoy_tls.SdsSecretConfig{
Name: "id-validation-context",
Expand Down Expand Up @@ -1146,7 +1146,7 @@ func createCluster(config expectedCluster) *envoy_cluster.Cluster {
}
cluster := &envoy_cluster.Cluster{
Name: config.name,
ConnectTimeout: &duration.Duration{Nanos: 250000000},
ConnectTimeout: &durationpb.Duration{Nanos: 250000000},
ClusterDiscoveryType: &envoy_cluster.Cluster_Type{Type: envoy_cluster.Cluster_STATIC},
LbPolicy: envoy_cluster.Cluster_ROUND_ROBIN,
LoadAssignment: &envoy_endpoint.ClusterLoadAssignment{
Expand All @@ -1160,9 +1160,9 @@ func createCluster(config expectedCluster) *envoy_cluster.Cluster {
if config.maxConnections > 0 {
cluster.CircuitBreakers = &envoy_cluster.CircuitBreakers{
Thresholds: []*envoy_cluster.CircuitBreakers_Thresholds{
{MaxConnections: &wrappers.UInt32Value{Value: math.MaxUint32}},
{MaxPendingRequests: &wrappers.UInt32Value{Value: math.MaxUint32}},
{MaxRequests: &wrappers.UInt32Value{Value: math.MaxUint32}},
{MaxConnections: &wrapperspb.UInt32Value{Value: math.MaxUint32}},
{MaxPendingRequests: &wrapperspb.UInt32Value{Value: math.MaxUint32}},
{MaxRequests: &wrapperspb.UInt32Value{Value: math.MaxUint32}},
}}
}
return cluster
Expand Down
2 changes: 1 addition & 1 deletion depot/steps/run_step.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func (step *runStep) Run(signals <-chan os.Signal, ready chan<- struct{}) error

var nofile *uint64
if step.model.ResourceLimits != nil {
nofile = step.model.ResourceLimits.GetNofilePtr()
nofile = step.model.ResourceLimits.GetNofile()
}

var processIO garden.ProcessIO
Expand Down
5 changes: 3 additions & 2 deletions depot/steps/run_step_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ var _ = Describe("RunAction", func() {
sidecar = steps.Sidecar{}

rl := models.ResourceLimits{}
rl.SetNofile(fileDescriptorLimit)
rl.SetNproc(processesLimit)
rl.SetNofile(&fileDescriptorLimit)
//lint:ignore SA1019 - testing deprecated logic
rl.SetNproc(&processesLimit)

runAction = models.RunAction{
Path: "sudo",
Expand Down
2 changes: 1 addition & 1 deletion depot/transformer/transformer.go
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ func (t *transformer) createCheck(
}

rl := models.ResourceLimits{}
rl.SetNofile(nofiles)
rl.SetNofile(&nofiles)
runAction := models.RunAction{
LogSource: sourceName,
ResourceLimits: &rl,
Expand Down
2 changes: 1 addition & 1 deletion depot/transformer/transformer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ import (
"code.cloudfoundry.org/lager/v3"
"code.cloudfoundry.org/lager/v3/lagertest"
"code.cloudfoundry.org/workpool"
"github.com/gogo/protobuf/proto"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/onsi/gomega/gbytes"
"github.com/tedsuo/ifrit"
ginkgomon "github.com/tedsuo/ifrit/ginkgomon_v2"
"google.golang.org/protobuf/proto"
)

var _ = Describe("Transformer", func() {
Expand Down