Skip to content

Commit

Permalink
Updating Makefile and cleaning up test code
Browse files Browse the repository at this point in the history
  • Loading branch information
dinofizz committed Jan 8, 2025
1 parent 779e5c7 commit 9c29a95
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
6 changes: 2 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Image URL to use all building/pushing image targets
IMG ?= ${ACC}.dkr.ecr.eu-west-1.amazonaws.com/monzo/docker-images-dev:manager-$(shell git rev-parse --short head)
# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
# CRD_OPTIONS ?= "crd:trivialVersions=true"
IMG ?= ${ACC}.dkr.ecr.eu-west-1.amazonaws.com/monzo/egress-operator:manager-$(shell git rev-parse --short head)

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
Expand Down Expand Up @@ -54,7 +52,7 @@ generate: controller-gen
$(CONTROLLER_GEN) object:headerFile=./hack/boilerplate.go.txt paths="./..."

# Build the docker image
docker-build: #test
docker-build: test
docker buildx build . -t ${IMG} --platform=linux/amd64 --provenance=false

# Push the docker image
Expand Down
12 changes: 3 additions & 9 deletions controllers/configmap_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package controllers

import (
bootstrap "github.com/envoyproxy/go-control-plane/envoy/config/bootstrap/v3"
"github.com/google/go-cmp/cmp"
"sigs.k8s.io/yaml"
"testing"

corev1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -292,15 +290,11 @@ staticResources:
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
tt.args.es.Spec.EnvoyClusterMaxConnections = tt.args.maxConns
got, _ := envoyConfig(tt.args.es)

var x bootstrap.Bootstrap
err := yaml.Unmarshal([]byte(got), &x)
got, err := envoyConfig(tt.args.es)
if err != nil {
t.Error()
t.Error(err)
}
if got, _ := envoyConfig(tt.args.es); got != tt.want {

if got != tt.want {
t.Errorf("envoyConfig() = %v, want %v", got, tt.want)
t.Error(cmp.Diff(got, tt.want))
}
Expand Down

0 comments on commit 9c29a95

Please sign in to comment.