Skip to content

Commit 7c56354

Browse files
authored
Use SupportsDataplaneFeatures helper (#13)
1 parent b9976b1 commit 7c56354

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

pkg/consuldp/consul_dataplane.go

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,14 +108,9 @@ func (cdp *ConsulDataplane) Run(ctx context.Context) error {
108108
ServerWatchDisabled: cdp.cfg.Consul.ServerWatchDisabled,
109109
Credentials: creds,
110110
TLS: tls,
111-
ServerEvalFn: func(state discovery.State) bool {
112-
// We require support for generating Envoy bootstrap configuration at least.
113-
//
114-
// TODO: now that we consume Consul's protobufs as a Go module, should we
115-
// have the discovery package expose the protobuf enum type rather than the
116-
// string representation?
117-
return state.DataplaneFeatures[pbdataplane.DataplaneFeatures_DATAPLANE_FEATURES_ENVOY_BOOTSTRAP_CONFIGURATION.String()]
118-
},
111+
ServerEvalFn: discovery.SupportsDataplaneFeatures(
112+
pbdataplane.DataplaneFeatures_DATAPLANE_FEATURES_ENVOY_BOOTSTRAP_CONFIGURATION.String(),
113+
),
119114
}, cdp.logger.Named("server-connection-manager"))
120115
if err != nil {
121116
return err

0 commit comments

Comments
 (0)