Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Commit

Permalink
Merge pull request #522 from hashicorp/release-0.5.2-staging
Browse files Browse the repository at this point in the history
Release 0.5.2 Staging
  • Loading branch information
Andrew Stucki authored Feb 28, 2023
2 parents 50fb333 + 79d544f commit 0f4bb5d
Show file tree
Hide file tree
Showing 241 changed files with 1,638 additions and 1,017 deletions.
3 changes: 3 additions & 0 deletions .changelog/470.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
Add initial set of copyright headers to applicable files
```
3 changes: 3 additions & 0 deletions .changelog/474.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
go: build with Go v1.19.4
```
3 changes: 3 additions & 0 deletions .changelog/483.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
consul: fix Consul Enterprise gateway sync issue with Kubernetes namespace mirroring disabled and the Consul destination namespace set to "default"
```
3 changes: 3 additions & 0 deletions .changelog/505.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
Fix `cross-namespace-policy` not being applied to namespaces created by the controller.
```
3 changes: 3 additions & 0 deletions .changelog/521.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
Bump the default envoy image for consul 1.15 compatability when the image is not specified in a GatewayClassConfig
```
16 changes: 16 additions & 0 deletions .copywrite.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
schema_version = 1

project {
license = "MPL-2.0"
copyright_year = 2021

# (OPTIONAL) A list of globs that should not have copyright or license headers .
# Supports doublestar glob patterns for more flexibility in defining which
# files or folders should be ignored
# Default: []
header_ignore = [
"config/rbac/role.yaml",
"config/crd/bases/*.yaml",
"**/testdata/**.golden.yaml"
]
}
3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

blank_issues_enabled: false
contact_links:
- name: Consul Discuss Forum
Expand Down
3 changes: 3 additions & 0 deletions .github/actions/goenv/action.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

name: "Setup Go Environment"
description: "Setup a go environment with caching"
inputs:
Expand Down
3 changes: 3 additions & 0 deletions .github/actions/setup-eks/action.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

name: "Setup EKS"
description: "Installs eksctl, configures AWS credentials in the workflow's environment and sets up an EKS cluster."
inputs:
Expand Down
3 changes: 3 additions & 0 deletions .github/actions/setup-eks/cluster.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

variable "cluster_name" {
type = string
nullable = false
Expand Down
3 changes: 3 additions & 0 deletions .github/actions/setup-kind/action.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

name: "Setup Kind"
description: "Setup a Kind cluster with MetalLB for ingress"
inputs:
Expand Down
3 changes: 3 additions & 0 deletions .github/actions/teardown-eks/action.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

name: "Tear down EKS"
description: "Tears down an EKS cluster. Requires eksctl and credentials in the workflow's environment from the setup-eks action."
inputs:
Expand Down
3 changes: 3 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

version: 2
updates:
- package-ecosystem: gomod
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
matrix:
goos: ["linux"]
goarch: ["arm", "arm64", "386", "amd64"]
go: ["1.19.2"]
go: ["1.19.4"]
fail-fast: true

name: Go ${{ matrix.go }} ${{ matrix.goos }} ${{ matrix.goarch }} build
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,15 @@ jobs:
tar xvzf kustomize_v4.4.0_linux_amd64.tar.gz
mv kustomize /usr/local/bin/kustomize
rm kustomize_v4.4.0_linux_amd64.tar.gz
docker version
- uses: ./.github/actions/goenv
with:
go-version: ${{ env.GO_VERSION }}

- name: Test
env:
DOCKER_HOST_ROUTE: 172.17.0.1
DOCKER_API_VERSION: 1.41
E2E_APIGW_CONSUL_IMAGE: ${{ matrix.consul-image }}
run: |
mkdir -p $TEST_RESULTS_DIR/json
Expand Down
18 changes: 11 additions & 7 deletions .github/workflows/conformance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,25 @@ jobs:
consul-image: "hashicorp/consul:1.12"
envoy-image: "envoyproxy/envoy:v1.22-latest"
consul-k8s-version: "v0.49.1"
envoy-field: "global.imageEnvoy"
- name: "consul@v1.13 + consul-k8s@v0.49.1"
api-gateway-image: "hashicorppreview/consul-api-gateway:0.5-dev"
consul-image: "hashicorp/consul:1.13"
envoy-image: "envoyproxy/envoy:v1.22-latest"
consul-k8s-version: "v0.49.1"
- name: "consul@v1.14-dev + consul-k8s@v1.0.0"
envoy-field: "global.imageEnvoy"
- name: "consul@v1.14 + consul-k8s@v1.0.1"
api-gateway-image: "hashicorppreview/consul-api-gateway:0.5-dev"
consul-image: "hashicorp/consul:1.14"
envoy-image: "envoyproxy/envoy:v1.22-latest"
consul-k8s-version: "main"
- name: "consul@v1.15-dev + consul-k8s@v1.0.0"
envoy-image: "envoyproxy/envoy:v1.24-latest"
consul-k8s-version: "v1.0.1"
envoy-field: "apiGateway.imageEnvoy"
- name: "consul@v1.15-dev + consul-k8s@v1.0.1"
api-gateway-image: "hashicorppreview/consul-api-gateway:0.5-dev"
consul-image: "hashicorppreview/consul:1.15-dev"
envoy-image: "envoyproxy/envoy:v1.22-latest"
consul-k8s-version: "main"
envoy-image: "envoyproxy/envoy:v1.24-latest"
consul-k8s-version: "v1.0.1"
envoy-field: "apiGateway.imageEnvoy"
fail-fast: false
name: "${{ matrix.cluster-type }} - ${{ matrix.config.name }}"
concurrency:
Expand Down Expand Up @@ -106,7 +110,7 @@ jobs:
- name: Install Consul
working-directory: "consul-api-gateway/internal/testing/conformance"
run: |
helm install --values ./consul-config.yaml consul $GITHUB_WORKSPACE/consul-k8s/charts/consul --set global.image=${{ matrix.config.consul-image }} --set global.imageEnvoy=${{ matrix.config.envoy-image }} --set apiGateway.image=${{ matrix.config.api-gateway-image }} --create-namespace --namespace=consul
helm install --values ./consul-config.yaml consul $GITHUB_WORKSPACE/consul-k8s/charts/consul --set global.image=${{ matrix.config.consul-image }} --set ${{ matrix.config.envoy-field }}=${{ matrix.config.envoy-image }} --set apiGateway.image=${{ matrix.config.api-gateway-image }} --create-namespace --namespace=consul
kubectl wait --for=condition=Ready --timeout=120s --namespace=consul pods --all
- name: Patch testing resources
Expand Down
18 changes: 11 additions & 7 deletions .github/workflows/conformance_with_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,25 @@ jobs:
consul-image: "hashicorp/consul:1.12"
envoy-image: "envoyproxy/envoy:v1.22-latest"
consul-k8s-version: "v0.49.1"
envoy-field: "global.imageEnvoy"
- name: "consul@v1.13 + consul-k8s@v0.49.1"
api-gateway-image: "consul-api-gateway:local-build"
consul-image: "hashicorp/consul:1.13"
envoy-image: "envoyproxy/envoy:v1.22-latest"
consul-k8s-version: "v0.49.1"
- name: "consul@v1.14 + consul-k8s@v1.0.0"
envoy-field: "global.imageEnvoy"
- name: "consul@v1.14 + consul-k8s@v1.0.1"
api-gateway-image: "consul-api-gateway:local-build"
consul-image: "hashicorp/consul:1.14"
envoy-image: "envoyproxy/envoy:v1.22-latest"
consul-k8s-version: "main"
- name: "consul@v1.15-dev + consul-k8s@v1.0.0"
envoy-image: "envoyproxy/envoy:v1.24-latest"
consul-k8s-version: "v1.0.1"
envoy-field: "apiGateway.imageEnvoy"
- name: "consul@v1.15-dev + consul-k8s@v1.0.1"
api-gateway-image: "consul-api-gateway:local-build"
consul-image: "hashicorppreview/consul:1.15-dev"
envoy-image: "envoyproxy/envoy:v1.22-latest"
consul-k8s-version: "main"
envoy-image: "envoyproxy/envoy:v1.24-latest"
consul-k8s-version: "v1.0.1"
envoy-field: "apiGateway.imageEnvoy"
fail-fast: false
name: "${{ matrix.config.name }}"

Expand Down Expand Up @@ -119,7 +123,7 @@ jobs:
- name: Install Consul
working-directory: "consul-api-gateway/internal/testing/conformance"
run: |
helm install --values ./consul-config.yaml consul $GITHUB_WORKSPACE/consul-k8s/charts/consul --set global.image=${{ matrix.config.consul-image }} --set global.imageEnvoy=${{ matrix.config.envoy-image }} --set apiGateway.image=${{ matrix.config.api-gateway-image }} --create-namespace --namespace=consul
helm install --values ./consul-config.yaml consul $GITHUB_WORKSPACE/consul-k8s/charts/consul --set global.image=${{ matrix.config.consul-image }} --set ${{ matrix.config.envoy-field }}=${{ matrix.config.envoy-image }} --set apiGateway.image=${{ matrix.config.api-gateway-image }} --create-namespace --namespace=consul
kubectl wait --for=condition=Ready --timeout=60s --namespace=consul pods --all
- name: Patch testing resources
Expand Down
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

linters:
disable-all: true
enable:
Expand Down
3 changes: 3 additions & 0 deletions .release/ci.hcl
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

schema = "1"

project "consul-api-gateway" {
Expand Down
3 changes: 3 additions & 0 deletions .release/release-metadata.hcl
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

url_docker_registry_dockerhub = "https://hub.docker.com/r/hashicorp/consul-api-gateway"
url_license = "https://github.com/hashicorp/consul-api-gateway/blob/main/LICENSE"
url_project_website = "https://developer.hashicorp.com/consul/docs/api-gateway"
Expand Down
3 changes: 3 additions & 0 deletions .release/security-scan.hcl
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

container {
dependencies = true
alpine_secdb = true
Expand Down
13 changes: 11 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
FROM golang:1.19.1-alpine as go-discover
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

FROM golang:1.19.4-alpine as go-discover
RUN CGO_ENABLED=0 go install github.com/hashicorp/go-discover/cmd/discover@49f60c093101c9c5f6b04d5b1c80164251a761a6

# ===================================
Expand All @@ -7,10 +10,16 @@ RUN CGO_ENABLED=0 go install github.com/hashicorp/go-discover/cmd/discover@49f60
#
# ===================================

# devdeps installs deps so we don't need to do it each time
FROM golang:latest as devdeps
ARG BIN_NAME
WORKDIR /build
COPY go.mod go.sum ./
RUN go mod download

# devbuild compiles the binary
# -----------------------------------
FROM golang:latest AS devbuild
FROM devdeps AS devbuild
ARG BIN_NAME
# Escape the GOPATH
WORKDIR /build
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.local
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.19.1-alpine as go-discover
FROM golang:1.19.4-alpine as go-discover
RUN CGO_ENABLED=0 go install github.com/hashicorp/go-discover/cmd/discover@49f60c093101c9c5f6b04d5b1c80164251a761a6

FROM alpine:latest
Expand Down
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ GOIMPORTS=$(shell which goimports)

.PHONY: fmt
fmt: goimports
@for d in $$(go list -f {{.Dir}} ./...); do ${GOIMPORTS} --local github.com/hashicorp --local github.com/hashicorp/consul-api-gateway -w -l $$d/*.go; done
@for d in $$(go list -f {{.Dir}} ./...); do ${GOIMPORTS} --local github.com/hashicorp/consul-api-gateway,github.com/hashicorp -w -l $$d/*.go; done

.PHONY: lint
lint:
Expand All @@ -50,13 +50,19 @@ endif
test:
go test ./...

# Run e2e tests, takes an optional variable `consul_image` which specifies the consul image to test against
.PHONY: e2e
e2e:
E2E_APIGW_CONSUL_IMAGE=$(consul_image) ./scripts/e2e_local.sh


generate-golden-files:
GENERATE=true go test ./internal/adapters/consul
GENERATE=true go test ./internal/envoy
GENERATE=true go test ./internal/k8s/builder

.PHONY: gen
gen: generate-golden-files ctrl-generate ctrl-manifests
gen: generate-golden-files ctrl-generate ctrl-manifests fmt
ifeq (, $(shell which mockgen))
@go install github.com/golang/mock/mockgen
endif
Expand Down
3 changes: 3 additions & 0 deletions config/base/gateway-class-config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

---
apiVersion: api-gateway.consul.hashicorp.com/v1alpha1
kind: GatewayClassConfig
Expand Down
3 changes: 3 additions & 0 deletions config/base/gateway-class.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

---
apiVersion: gateway.networking.k8s.io/v1alpha2
kind: GatewayClass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.10.0
controller-gen.kubebuilder.io/version: v0.11.3
creationTimestamp: null
name: gatewayclassconfigs.api-gateway.consul.hashicorp.com
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.10.0
controller-gen.kubebuilder.io/version: v0.11.3
creationTimestamp: null
name: meshservices.api-gateway.consul.hashicorp.com
spec:
Expand Down
3 changes: 3 additions & 0 deletions config/crd/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

Expand Down
3 changes: 3 additions & 0 deletions config/deployment/clusterrolebinding.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
Expand Down
3 changes: 3 additions & 0 deletions config/deployment/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

---
apiVersion: apps/v1
kind: Deployment
Expand Down
3 changes: 3 additions & 0 deletions config/deployment/service.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

---
apiVersion: v1
kind: Service
Expand Down
3 changes: 3 additions & 0 deletions config/deployment/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

---
apiVersion: v1
kind: ServiceAccount
Expand Down
3 changes: 3 additions & 0 deletions config/example/certificates.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

---
apiVersion: v1
kind: Secret
Expand Down
3 changes: 3 additions & 0 deletions config/example/external-dns.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

---
apiVersion: v1
kind: ServiceAccount
Expand Down
3 changes: 3 additions & 0 deletions config/example/gateway.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

---
apiVersion: gateway.networking.k8s.io/v1alpha2
kind: Gateway
Expand Down
3 changes: 3 additions & 0 deletions config/example/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

Expand Down
3 changes: 3 additions & 0 deletions config/example/route.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

---
apiVersion: gateway.networking.k8s.io/v1alpha2
kind: HTTPRoute
Expand Down
3 changes: 3 additions & 0 deletions config/example/service.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

---
apiVersion: consul.hashicorp.com/v1alpha1
kind: ServiceDefaults
Expand Down
3 changes: 3 additions & 0 deletions config/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

Expand Down
Loading

0 comments on commit 0f4bb5d

Please sign in to comment.