Skip to content

Commit

Permalink
try a different way
Browse files Browse the repository at this point in the history
  • Loading branch information
curtbushko committed Jun 16, 2023
1 parent ad60fd7 commit 696945b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
16 changes: 12 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ VERSION = $(shell ./control-plane/build-support/scripts/version.sh control-plane
CONSUL_IMAGE_VERSION = $(shell ./control-plane/build-support/scripts/consul-version.sh charts/consul/values.yaml)
CONSUL_ENTERPRISE_IMAGE_VERSION = $(shell ./control-plane/build-support/scripts/consul-enterprise-version.sh charts/consul/values.yaml)
CONSUL_DATAPLANE_IMAGE_VERSION = $(shell ./control-plane/build-support/scripts/consul-dataplane-version.sh charts/consul/values.yaml)
KIND_VERSION= $(shell ./control-plane/build-support/scripts/read-yaml-config.sh acceptance/ci-inputs/kind-inputs.yaml .kindVersion)
KIND_NODE_IMAGE= $(shell ./control-plane/build-support/scripts/read-yaml-config.sh acceptance/ci-inputs/kind-inputs.yaml .kindNodeImage)
KUBECTL_VERSION= $(shell ./control-plane/build-support/scripts/read-yaml-config.sh acceptance/ci-inputs/kind-inputs.yaml .kubectlVersion)

# ===========> Helm Targets

Expand Down Expand Up @@ -105,7 +108,6 @@ terraform-fmt:


# ===========> CLI Targets

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/
Expand All @@ -114,7 +116,6 @@ cli-fips-dev:
@echo "==> Installing consul-k8s CLI tool for ${GOOS}/${GOARCH}"
@cd cli; CGO_ENABLED=1 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 Expand Up @@ -187,8 +188,15 @@ consul-enterprise-version:
consul-dataplane-version:
@echo $(CONSUL_DATAPLANE_IMAGE_VERSION)

kind-config:
@./control-plane/build-support/scripts/read-yaml-config.sh acceptance/ci-inputs/kind-inputs.yaml
kind-version:
@echo $(KIND_VERSION)

kind-node-image:
@echo $(KIND_NODE_IMAGE)

kubectl-version:
@echo $(KUBECTL_VERSION)



# ===========> Release Targets
Expand Down
6 changes: 3 additions & 3 deletions acceptance/ci-inputs/kind-inputs.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
kind-version: v0.19.0
kind-node-image: kindest/node:v1.27.1
kubectl-version: v1.27.1
kindVersion: v0.19.0
kindNodeImage: kindest/node:v1.27.1
kubectlVersion: v1.27.1
6 changes: 3 additions & 3 deletions control-plane/build-support/scripts/read-yaml-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0
INPUT_FILE=$1
FIELD=$2

# Convert YAML content to JSON as it is easier to deal with
JSON_CONTENTS=$(yq eval '. | tojson' "${INPUT_FILE}")
VALUE=$(yq $FIELD $INPUT_FILE)

echo "${JSON_CONTENTS}"
echo "${VALUE}"

0 comments on commit 696945b

Please sign in to comment.