Skip to content

Commit

Permalink
remove FIPS version check from connect-init
Browse files Browse the repository at this point in the history
  • Loading branch information
skpratt committed Jun 7, 2023
1 parent 9707e1a commit a4b3c5d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 18 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ cli-dev:
@echo "==> Installing consul-k8s CLI tool for ${GOOS}/${GOARCH}"
@cd cli; go build -o ./bin/consul-k8s; cp ./bin/consul-k8s ${GOPATH}/bin/

cli-fips-dev:
@echo "==> Installing consul-k8s CLI tool for ${GOOS}/${GOARCH}"
@cd cli; GOEXPERIMENT=boringcrypto go build -o ./bin/consul-k8s -tags "fips"; cp ./bin/consul-k8s ${GOPATH}/bin/


cli-lint: ## Run linter in the control-plane directory.
cd cli; golangci-lint run -c ../.golangci.yml
Expand Down
23 changes: 5 additions & 18 deletions control-plane/subcommand/connect-init/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,17 @@ import (
"time"

"github.com/cenkalti/backoff"
"github.com/hashicorp/consul-k8s/control-plane/connect-inject/constants"
"github.com/hashicorp/consul-k8s/control-plane/consul"
"github.com/hashicorp/consul-k8s/control-plane/namespaces"
"github.com/hashicorp/consul-k8s/control-plane/subcommand/common"
"github.com/hashicorp/consul-k8s/control-plane/subcommand/flags"
"github.com/hashicorp/consul-server-connection-manager/discovery"
"github.com/hashicorp/consul/api"
"github.com/hashicorp/consul/sdk/iptables"
"github.com/hashicorp/go-hclog"
"github.com/mitchellh/cli"
"github.com/mitchellh/mapstructure"

"github.com/hashicorp/consul-k8s/control-plane/connect-inject/constants"
"github.com/hashicorp/consul-k8s/control-plane/consul"
"github.com/hashicorp/consul-k8s/control-plane/namespaces"
"github.com/hashicorp/consul-k8s/control-plane/subcommand/common"
"github.com/hashicorp/consul-k8s/control-plane/subcommand/flags"
"github.com/hashicorp/consul-k8s/control-plane/version"
)

const (
Expand Down Expand Up @@ -163,17 +161,6 @@ func (c *Command) Run(args []string) int {
c.logger.Error("Unable to get client connection", "error", err)
return 1
}
if version.IsFIPS() {
// make sure we are also using FIPS Consul
var versionInfo map[string]interface{}
_, err := consulClient.Raw().Query("/v1/agent/version", versionInfo, nil)
if err != nil {
c.logger.Warn("This is a FIPS build of consul-k8s, which should be used with FIPS Consul. Unable to verify FIPS Consul while setting up Consul API client.")
}
if val, ok := versionInfo["FIPS"]; !ok || val == "" {
c.logger.Warn("This is a FIPS build of consul-k8s, which should be used with FIPS Consul. A non-FIPS version of Consul was detected.")
}
}
proxyService := &api.AgentService{}
if c.flagGatewayKind != "" {
err = backoff.Retry(c.getGatewayRegistration(consulClient), backoff.WithMaxRetries(backoff.NewConstantBackOff(1*time.Second), c.serviceRegistrationPollingAttempts))
Expand Down

0 comments on commit a4b3c5d

Please sign in to comment.