Repository: kedacore/http-add-on
Pull request #43 (2021-02-04 19:49:47)

Beginning to write tests
This PR begins to structure and write tests. It's not intended to build all of them.

### Checklist

- [x] #47 (and https://github.com/khaosdoctor/http-add-on/pull/1 before it) is merged (this PR is required because it has a refactor we need to improve test quality)
- [x] Commits are signed with Developer Certificate of Origin (DCO)

Ref #13



Patch:
diff --git a/Makefile b/Makefile
index 6fb8d86..482c185 100644
--- a/Makefile
+++ b/Makefile
@@ -4,6 +4,10 @@ INTERCEPTOR_DOCKER_IMG?=arschles/keda-http-interceptor:${GIT_TAG}
 OPERATOR_DOCKER_IMG?=arschles/keda-http-operator:${GIT_TAG}
 NAMESPACE?=kedahttp
 
+#####
+# scaler targets
+#####
+
 .PHONY: gen-scaler
 gen-scaler:
 	protoc \
@@ -17,6 +21,10 @@ gen-scaler:
 build-scaler:
 	go build -o bin/scaler ./scaler
 
+.PHONY: test-scaler
+test-scaler:
+	go test ./scaler/...
+
 .PHONY: docker-build-scaler
 docker-build-scaler:
 	docker build -t ${SCALER_DOCKER_IMG} -f scaler/Dockerfile .
@@ -25,10 +33,18 @@ docker-build-scaler:
 docker-push-scaler: docker-build-scaler
 	docker push ${SCALER_DOCKER_IMG}
 
+#####
+# Interceptor targets
+#####
+
 .PHONY: build-interceptor
 build-interceptor:
 	go build -o bin/interceptor ./interceptor
 
+.PHONY: test-interceptor
+test-interceptor:
+	go test ./interceptor/...
+
 .PHONY: docker-build-interceptor
 docker-build-interceptor:
 	docker build -t ${INTERCEPTOR_DOCKER_IMG} -f interceptor/Dockerfile .
@@ -37,14 +53,18 @@ docker-build-interceptor:
 docker-push-interceptor: docker-build-interceptor
 	docker push ${INTERCEPTOR_DOCKER_IMG}
 
-# .PHONY: build-operator
-# build-operator-cli:
-# 	cargo build --bin operator
+#####
+# operator targets
+#####
 
 .PHONY: build-operator
 build-operator:
 	go build -o bin/operator ./operator
 
+.PHONY: test-operator
+test-operator:
+	go test ./operator/...
+
 .PHONY: docker-build-operator
 docker-build-operator:
 	docker build -t ${OPERATOR_DOCKER_IMG} -f operator/Dockerfile .
@@ -67,9 +87,16 @@ helm-upgrade-operator:
 helm-delete-operator:
 	helm delete -n ${NAMESPACE} kedahttp
 
+#####
+# universal targets
+#####
+
 .PHONY: build-all
 build-all: build-scaler build-interceptor build-operator
 
+.PHONY: test-all
+test-all: test-scaler test-interceptor test-operator
+
 .PHONY: docker-build-all
 docker-build-all: docker-build-scaler docker-build-interceptor docker-build-operator
 
diff --git a/go.mod b/go.mod
index ac57a24..29b67b4 100644
--- a/go.mod
+++ b/go.mod
@@ -9,6 +9,7 @@ require (
 	github.com/onsi/ginkgo v1.14.1
 	github.com/onsi/gomega v1.10.2
 	github.com/pkg/errors v0.9.1
+	github.com/stretchr/testify v1.6.1
 	google.golang.org/grpc v1.33.2
 	google.golang.org/protobuf v1.25.0
 	k8s.io/api v0.20.2
diff --git a/go.sum b/go.sum
index 6a0ee3d..47e1421 100644
--- a/go.sum
+++ b/go.sum
@@ -79,7 +79,6 @@ github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfc
 github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
 github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
 github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
-github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
 github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
 github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@@ -97,7 +96,6 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF
 github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
 github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
 github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
-github.com/evanphx/json-patch v4.5.0+incompatible h1:ouOWdg56aJriqS0huScTkVXPC5IcNrDCXZ6OoTAWu7M=
 github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
 github.com/evanphx/json-patch v4.9.0+incompatible h1:kLcOMZeuLAJvL2BPWLMIj5oaZQobrkAqrL+WFZwQses=
 github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
@@ -115,7 +113,6 @@ github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2
 github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
 github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
 github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
-github.com/go-logr/logr v0.1.0 h1:M1Tv3VzNlEHg6uyACnRdtrploV2P7wZqH8BoQMtz0cg=
 github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas=
 github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU=
 github.com/go-logr/logr v0.3.0 h1:q4c+kbcR0d5rSurhBR8dIgieOaYpXtsdTYfx22Cu6rs=
@@ -166,11 +163,9 @@ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5a
 github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
 github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
 github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/go-cmp v0.5.0 h1:/QaMHBdZ26BB3SSst0Iwl10Epc+xhTquomWX0oZEB6w=
 github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
 github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM=
 github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw=
 github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
 github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g=
 github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
@@ -213,7 +208,6 @@ github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/b
 github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
 github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90=
 github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
-github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU=
 github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
 github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc=
 github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
@@ -222,7 +216,6 @@ github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO
 github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ=
 github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I=
 github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc=
-github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
 github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
 github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
 github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
@@ -260,19 +253,16 @@ github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN
 github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
 github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs=
 github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
-github.com/mattn/go-colorable v0.1.2 h1:/bC9yWikZXAL9uJdulbSfyVNIR3n3trXl+v8+1sx8mU=
 github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
 github.com/mattn/go-colorable v0.1.7 h1:bQGKb3vps/j0E9GfJQ03JyhRuxsvdAanXlT9BTw3mdw=
 github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
 github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
 github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
 github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
-github.com/mattn/go-isatty v0.0.9 h1:d5US/mDsogSGW37IV293h//ZFaeajb69h+EHFsv2xGg=
 github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ=
 github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
 github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
 github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
-github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
 github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
 github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI=
 github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
@@ -302,7 +292,6 @@ github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn
 github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
 github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
 github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
-github.com/onsi/ginkgo v1.11.0 h1:JAKSXpt1YjtLA7YpPiqO9ss6sNXEsPfSGdwN0UHqzrw=
 github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
 github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
 github.com/onsi/ginkgo v1.14.1 h1:jMU0WaQrP0a/YAEq8eJmJKjBoMs+pClEr1vDMlM/Do4=
@@ -317,7 +306,6 @@ github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FI
 github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
 github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
 github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
-github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
 github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
 github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
 github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
@@ -327,25 +315,21 @@ github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndr
 github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA=
 github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
 github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso=
-github.com/prometheus/client_golang v1.0.0 h1:vrDKnkGzuGvhNAL56c7DBz29ZL+KxnoR0x7enabFceM=
 github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
 github.com/prometheus/client_golang v1.7.1 h1:NTGy1Ja9pByO+xAeH/qiWnLrKtr3hJPNjaVUwnjpdpA=
 github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
 github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
 github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
-github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 h1:gQz4mCbXsO+nc9n1hCxHcGA3Zx3Eo+UHZoInFGUIXNM=
 github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
 github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M=
 github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
 github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
 github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
-github.com/prometheus/common v0.4.1 h1:K0MGApIoQvMw27RTdJkPbr3JZ7DNbtxQNyi5STVM6Kw=
 github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
 github.com/prometheus/common v0.10.0 h1:RyRA7RzGXQZiW+tGMr7sxa85G1z0yOpM1qq5c8lNawc=
 github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
 github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
 github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
-github.com/prometheus/procfs v0.0.2 h1:6LJUbpNm42llc4HRCuvApCSWB/WfhuNo9K98Q9sNGfs=
 github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
 github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
 github.com/prometheus/procfs v0.2.0 h1:wH4vA7pcjKuZzjF7lM8awk4fnuJO6idemZXoKnULUx4=
@@ -382,7 +366,6 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
 github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
 github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
 github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
-github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
 github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
 github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
 github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
@@ -406,34 +389,29 @@ go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
 go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
 go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
 go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
-go.uber.org/atomic v1.3.2 h1:2Oa65PReHzfn29GpvgsYwloV9AVFHPDk8tYxt2c2tr4=
 go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
 go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
 go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk=
 go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
 go.uber.org/goleak v1.1.10 h1:z+mqJhf6ss6BSfSM671tgKyZBFPTTJM+HLxnhPC3wu0=
 go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A=
-go.uber.org/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI=
 go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
 go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A=
 go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU=
 go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4=
 go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA=
 go.uber.org/zap v1.8.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
-go.uber.org/zap v1.10.0 h1:ORx85nbTijNz8ljznvCMR1ZBIPKFn3jQrag10X2AsuM=
 go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
 go.uber.org/zap v1.15.0 h1:ZZCA22JRF2gQE5FoNmhmrf7jeJJ2uhqDUNRYKm8dvmM=
 go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc=
 golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
 golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
-golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M=
 golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
 golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
 golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
 golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
 golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
 golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
-golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a h1:vclmkQCjlDX5OydZ9wv8rBCcS0QyQY66Mpf/7BZbInM=
 golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
 golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0 h1:hb9wdF1z5waM+dSIICn1l0DkLVDT3hqhhQsDNUmHPRE=
 golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
@@ -478,7 +456,6 @@ golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73r
 golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628=
 golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
 golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
 golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
@@ -497,13 +474,11 @@ golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLL
 golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
 golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
 golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
-golang.org/x/net v0.0.0-20200822124328-c89045814202 h1:VvcQYSHwXgi7W+TpUR6A9g6Up98WAHf3f/ulnJ62IyA=
 golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
 golang.org/x/net v0.0.0-20201110031124-69a78807bb2b h1:uwuIcX0g4Yl1NC5XAz37xsr2lTtcqevgzYNVt49waME=
 golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
 golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
 golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
-golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0=
 golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
 golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
 golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw=
@@ -551,23 +526,19 @@ golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7w
 golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6 h1:DvY3Zkh7KabQE/kfzMvYvKirSiguP9Q/veMtkYyf0o8=
 golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20201112073958-5cba982894dd h1:5CtCZbICpIOFdgO940moixOPjc0178IU44m4EjOO5IY=
 golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
-golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
 golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
-golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k=
 golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
 golang.org/x/text v0.3.4 h1:0YWbFKbhXG/wIiuHDSKpS0Iy7FSA+u45VtBMfQcFTTc=
 golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
 golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
-golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZenJ2O330aBsf7JfSUXmQ=
 golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e h1:EHBhcS0mlXEAVwNyO2dLfjToGsyY4j24pTs2ScHnX7s=
@@ -616,7 +587,6 @@ golang.org/x/tools v0.0.0-20200616133436-c1934b75d054 h1:HHeAlu5H9b71C+Fx0K+1dGg
 golang.org/x/tools v0.0.0-20200616133436-c1934b75d054/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
 golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
 golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
 golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
@@ -657,7 +627,6 @@ google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4
 google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
 google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
 google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY=
 google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
 google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a h1:pOwg4OoaRYScjmR4LlLgdtnyoHYTSAVhhqe5uPdpII8=
 google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
@@ -683,14 +652,12 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj
 google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c=
 google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
 gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
-gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
 gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
 gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
 gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
 gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
 gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
-gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=
 gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
 gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
 gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
@@ -702,9 +669,7 @@ gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkep
 gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
 gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
 gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
-gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
 gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
-gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I=
 gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
 gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
 gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
@@ -757,7 +722,6 @@ sigs.k8s.io/controller-runtime v0.8.1 h1:O0K2CJ2JavK8/Tf4LfcpAwRxOFBhv8DjyrbmE6Q
 sigs.k8s.io/controller-runtime v0.8.1/go.mod h1:U/l+DUopBc1ecfRZ5aviA9JDmGFQKvLf5YkZNx2e0sU=
 sigs.k8s.io/structured-merge-diff/v4 v4.0.2 h1:YHQV7Dajm86OuqnIR6zAelnDWBRjo+YhYV9PmGrh1s8=
 sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw=
-sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs=
 sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
 sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q=
 sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=
diff --git a/pkg/k8s/deployment.go b/pkg/k8s/deployment.go
index 07c60ad..510d100 100644
--- a/pkg/k8s/deployment.go
+++ b/pkg/k8s/deployment.go
@@ -2,6 +2,7 @@ package k8s
 
 import (
 	"context"
+
 	"sigs.k8s.io/controller-runtime/pkg/client"
 
 	appsv1 "k8s.io/api/apps/v1"
@@ -10,11 +11,11 @@ import (
 )
 
 // DeleteDeployment deletes the deployment given using the client given
-func DeleteDeployment(ctx context.Context, metaInfo NameNamespaceInfo, cl client.Client) error {
+func DeleteDeployment(ctx context.Context, namespace, name string, cl client.Client) error {
 	deployment := &appsv1.Deployment{
 		ObjectMeta: metav1.ObjectMeta{
-			Name: metaInfo.Name,
-			Namespace: metaInfo.Namespace,
+			Name:      name,
+			Namespace: namespace,
 		},
 	}
 	if err := cl.Delete(ctx, deployment, &client.DeleteOptions{}); err != nil {
diff --git a/pkg/k8s/meta.go b/pkg/k8s/meta.go
index 9091786..5a14c41 100644
--- a/pkg/k8s/meta.go
+++ b/pkg/k8s/meta.go
@@ -2,11 +2,6 @@ package k8s
 
 import "fmt"
 
-type NameNamespaceInfo struct {
-	Name string
-	Namespace string
-}
-
 func Labels(name string) map[string]string {
 	return map[string]string{
 		"name": name,
diff --git a/pkg/k8s/scaledobject.go b/pkg/k8s/scaledobject.go
index ad15858..4488d3e 100644
--- a/pkg/k8s/scaledobject.go
+++ b/pkg/k8s/scaledobject.go
@@ -2,10 +2,10 @@ package k8s
 
 import (
 	"context"
-	"sigs.k8s.io/controller-runtime/pkg/client"
 
 	unstructured "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
 	"k8s.io/apimachinery/pkg/runtime/schema"
+	"sigs.k8s.io/controller-runtime/pkg/client"
 )
 
 func kedaGVR() schema.GroupVersionResource {
@@ -42,6 +42,15 @@ func NewScaledObject(
 ) *unstructured.Unstructured {
 	// https://keda.sh/docs/1.5/faq/
 	// https://github.com/kedacore/keda/blob/aa0ea79450a1c7549133aab46f5b916efa2364ab/api/v1alpha1/scaledobject_types.go
+	//
+	// unstructured.Unstructured only supports specific types in it. see here for the list:
+	// https://github.com/kubernetes/apimachinery/blob/v0.17.12/pkg/runtime/converter.go#L449-L476
+	typedLabels := Labels(name)
+	labels := map[string]interface{}{}
+	for k, v := range typedLabels {
+		var vIface interface{} = v
+		labels[k] = vIface
+	}
 	return &unstructured.Unstructured{
 		Object: map[string]interface{}{
 			"apiVersion": "keda.sh/v1alpha1",
@@ -49,13 +58,13 @@ func NewScaledObject(
 			"metadata": map[string]interface{}{
 				"namespace": namespace,
 				"name":      name,
-				"labels":    Labels(name),
+				"labels":    labels,
 			},
 			"spec": map[string]interface{}{
-				"minReplicaCount": 0,
-				"maxReplicaCount": 1000,
-				"pollingInterval": 250,
-				"scaleTargetRef": map[string]string{
+				"minReplicaCount": int64(0),
+				"maxReplicaCount": int64(1000),
+				"pollingInterval": int64(250),
+				"scaleTargetRef": map[string]interface{}{
 					"name": deploymentName,
 					// "apiVersion": "apps/v1",
 					"kind": "Deployment",
@@ -63,7 +72,7 @@ func NewScaledObject(
 				"triggers": []interface{}{
 					map[string]interface{}{
 						"type": "external",
-						"metadata": map[string]string{
+						"metadata": map[string]interface{}{
 							"scalerAddress": scalerAddress,
 						},
 					},


Test patch:
diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml
new file mode 100644
index 0000000..66d2b90
--- /dev/null
+++ b/.github/workflows/tests.yaml
@@ -0,0 +1,20 @@
+name: Run tests
+on:
+  push:
+    branches: [main]
+  pull_request:
+    branches: [main]
+
+jobs:
+  run_tests:
+
+    runs-on: ubuntu-20.04
+
+    steps:
+    - uses: actions/checkout@v2
+    - name: Install Go
+      uses: actions/setup-go@v2
+      with:
+        go-version: 1.15.x
+    - name: Test
+      run: go test ./...
diff --git a/interceptor/admin_handlers_test.go b/interceptor/admin_handlers_test.go
new file mode 100644
index 0000000..81d89c8
--- /dev/null
+++ b/interceptor/admin_handlers_test.go
@@ -0,0 +1,41 @@
+package main
+
+import (
+	"encoding/json"
+	"errors"
+)
+
+func (i *InterceptorSuite) TestQueueSizeHandlerSuccess() {
+	reader := &fakeQueueCountReader{
+		current: 123,
+		err:     nil,
+	}
+
+	handler := newQueueSizeHandler(reader)
+	_, echoCtx, rec := newTestCtx("GET", "/queue")
+	err := handler(echoCtx)
+	i.NoError(err)
+	i.Equal(200, rec.Code, "response code")
+	respMap := map[string]int{}
+	decodeErr := json.NewDecoder(rec.Body).Decode(&respMap)
+	i.NoError(decodeErr)
+	i.Equalf(1, len(respMap), "response JSON length was not 1")
+	sizeVal, ok := respMap["current_size"]
+	i.Truef(ok, "'current_size' entry not available in return JSON")
+	i.Equalf(reader.current, sizeVal, "returned JSON queue size was wrong")
+	reader.err = errors.New("test error")
+	i.Error(handler(echoCtx))
+}
+
+func (i *InterceptorSuite) TestQueueSizeHandlerFail() {
+	reader := &fakeQueueCountReader{
+		current: 0,
+		err:     errors.New("test error"),
+	}
+
+	handler := newQueueSizeHandler(reader)
+	_, echoCtx, rec := newTestCtx("GET", "/queue")
+	err := handler(echoCtx)
+	i.Error(err)
+	i.Equal(500, rec.Code, "response code")
+}
diff --git a/interceptor/interceptor_suite_test.go b/interceptor/interceptor_suite_test.go
new file mode 100644
index 0000000..95c8339
--- /dev/null
+++ b/interceptor/interceptor_suite_test.go
@@ -0,0 +1,46 @@
+package main
+
+import (
+	"net/http/httptest"
+	"testing"
+
+	echo "github.com/labstack/echo/v4"
+	"github.com/stretchr/testify/suite"
+)
+
+type InterceptorSuite struct {
+	suite.Suite
+}
+
+func TestInterceptor(t *testing.T) {
+	suite.Run(t, new(InterceptorSuite))
+}
+
+func newTestCtx(method, path string) (*echo.Echo, echo.Context, *httptest.ResponseRecorder) {
+	req := httptest.NewRequest(method, path, nil)
+	rec := httptest.NewRecorder()
+	e := echo.New()
+	return e, e.NewContext(req, rec), rec
+}
+
+type fakeQueueCounter struct {
+	resizedCh chan int
+}
+
+func (f *fakeQueueCounter) Resize(i int) error {
+	f.resizedCh <- i
+	return nil
+}
+
+func (f *fakeQueueCounter) Current() (int, error) {
+	return 0, nil
+}
+
+type fakeQueueCountReader struct {
+	current int
+	err     error
+}
+
+func (f *fakeQueueCountReader) Current() (int, error) {
+	return f.current, f.err
+}
diff --git a/interceptor/middleware_test.go b/interceptor/middleware_test.go
new file mode 100644
index 0000000..f59bae4
--- /dev/null
+++ b/interceptor/middleware_test.go
@@ -0,0 +1,53 @@
+package main
+
+import (
+	"math"
+	"sync"
+	"time"
+
+	echo "github.com/labstack/echo/v4"
+)
+
+func (i *InterceptorSuite) TestCountMiddleware() {
+	queueCounter := &fakeQueueCounter{}
+	middleware := countMiddleware(queueCounter)
+	var wg sync.WaitGroup
+	wg.Add(1)
+	handler := middleware(func(c echo.Context) error {
+		wg.Done()
+		return c.String(200, "OK")
+	})
+	_, echoCtx, _ := newTestCtx("GET", "/something")
+	go func() {
+		i.NoError(handler(echoCtx))
+	}()
+
+	// after the handler was called, first wait for it to complete.
+	// then check to make sure the pending queue size was increased and decreased.
+	//
+	// the increase and decrease operations happen in goroutines, so the ordering
+	// isn't guaranteed
+	wg.Wait()
+	timer := time.NewTimer(200 * time.Millisecond)
+	defer timer.Stop()
+	resizes := []int{}
+	done := false
+	for i := 0; i < 2; i++ {
+		if len(resizes) == 2 || done {
+			break
+		}
+		select {
+		case i := <-queueCounter.resizedCh:
+			resizes = append(resizes, i)
+		case <-timer.C:
+			done = true
+			break
+		}
+	}
+	agg := 0
+	for _, delta := range resizes {
+		i.Equal(1, math.Abs(float64(delta)))
+		agg += delta
+	}
+	i.Equal(0, agg, "sum of all the resize operations")
+}
diff --git a/interceptor/proxy_handlers_test.go b/interceptor/proxy_handlers_test.go
new file mode 100644
index 0000000..82d1112
--- /dev/null
+++ b/interceptor/proxy_handlers_test.go
@@ -0,0 +1,28 @@
+package main
+
+import (
+	"net/http"
+	"net/http/httptest"
+	"net/url"
+)
+
+func (i *InterceptorSuite) TestForwardingHandler() {
+	const originReturn = "hello test"
+	forwardedRequests := []*http.Request{}
+	testServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+		forwardedRequests = append(forwardedRequests, r)
+		w.Write([]byte(originReturn))
+	}))
+	defer testServer.Close()
+
+	forwardURL, err := url.Parse(testServer.URL)
+	i.NoError(err)
+	handler := newForwardingHandler(forwardURL)
+	const path = "/testfwd"
+	_, echoCtx, rec := newTestCtx("GET", path)
+	i.NoError(handler(echoCtx))
+	i.Equal(1, len(forwardedRequests), "number of requests that were forwarded")
+	forwardedRequest := forwardedRequests[0]
+	i.Equal(path, forwardedRequest.URL.Path)
+	i.Equal(originReturn, string(rec.Body.Bytes()))
+}
diff --git a/operator/controllers/external_scaler_test.go b/operator/controllers/external_scaler_test.go
new file mode 100644
index 0000000..05234f6
--- /dev/null
+++ b/operator/controllers/external_scaler_test.go
@@ -0,0 +1,76 @@
+package controllers
+
+import (
+	"context"
+	"time"
+
+	logrtest "github.com/go-logr/logr/testing"
+	"github.com/kedacore/http-add-on/operator/api/v1alpha1"
+	"github.com/kedacore/http-add-on/operator/controllers/config"
+	. "github.com/onsi/ginkgo"
+	. "github.com/onsi/gomega"
+	appsv1 "k8s.io/api/apps/v1"
+	corev1 "k8s.io/api/core/v1"
+	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+	"sigs.k8s.io/controller-runtime/pkg/client"
+	"sigs.k8s.io/controller-runtime/pkg/client/fake"
+)
+
+var _ = Describe("ExternalScaler", func() {
+	Context("Creating the external scaler", func() {
+		It("Should properly create the Deployment and Service", func() {
+			const name = "testapp"
+			const namespace = "testns"
+			ctx := context.Background()
+			cl := fake.NewFakeClient()
+			cfg := config.AppInfo{
+				Name:      name,
+				Port:      8081,
+				Image:     "arschles/testimg",
+				Namespace: namespace,
+			}
+			logger := logrtest.NullLogger{}
+			httpso := &v1alpha1.HTTPScaledObject{
+				ObjectMeta: metav1.ObjectMeta{
+					Namespace: namespace,
+					Name:      name,
+				},
+				Spec: v1alpha1.HTTPScaledObjectSpec{
+					AppName: name,
+					Image:   "arschles/testapp",
+					Port:    8081,
+				},
+			}
+			err := createExternalScaler(ctx, cfg, cl, logger, httpso)
+			Expect(err).To(BeNil())
+
+			// // make sure that httpso has the right conditions on it
+			Expect(len(httpso.Status.Conditions)).To(Equal(1))
+			cond1 := httpso.Status.Conditions[0]
+			cond1ts, err := time.Parse(time.RFC3339, cond1.Timestamp)
+			Expect(err).To(BeNil())
+			Expect(time.Now().Sub(cond1ts) >= 0).To(BeTrue())
+			Expect(cond1.Type).To(Equal(v1alpha1.Created))
+			Expect(cond1.Status).To(Equal(metav1.ConditionTrue))
+			Expect(cond1.Reason).To(Equal(v1alpha1.CreatedExternalScaler))
+
+			// check that the external scaler deployment was created
+			deployment := new(appsv1.Deployment)
+			err = cl.Get(ctx, client.ObjectKey{
+				Name:      cfg.ExternalScalerDeploymentName(),
+				Namespace: cfg.Namespace,
+			}, deployment)
+			Expect(err).To(BeNil())
+
+			// check that the external scaler service was created
+			service := new(corev1.Service)
+			err = cl.Get(ctx, client.ObjectKey{
+				Name:      cfg.ExternalScalerServiceName(),
+				Namespace: cfg.Namespace,
+			}, service)
+			Expect(err).To(BeNil())
+
+		})
+	})
+
+})
diff --git a/operator/controllers/scaled_object_test.go b/operator/controllers/scaled_object_test.go
new file mode 100644
index 0000000..1c09f3f
--- /dev/null
+++ b/operator/controllers/scaled_object_test.go
@@ -0,0 +1,82 @@
+package controllers
+
+import (
+	"context"
+	"time"
+
+	logrtest "github.com/go-logr/logr/testing"
+	"github.com/kedacore/http-add-on/operator/api/v1alpha1"
+	"github.com/kedacore/http-add-on/operator/controllers/config"
+	. "github.com/onsi/ginkgo"
+	. "github.com/onsi/gomega"
+	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+	"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
+	"k8s.io/apimachinery/pkg/runtime/schema"
+	"sigs.k8s.io/controller-runtime/pkg/client"
+	"sigs.k8s.io/controller-runtime/pkg/client/fake"
+)
+
+var _ = Describe("UserApp", func() {
+	Context("Creating a ScaledObject", func() {
+		It("Should properly create the ScaledObject for the user app", func() {
+			const name = "testapp"
+			const namespace = "testns"
+			ctx := context.Background()
+			cl := fake.NewFakeClient()
+			cfg := config.AppInfo{
+				Name:      name,
+				Port:      8081,
+				Image:     "arschles/testimg",
+				Namespace: namespace,
+			}
+			logger := logrtest.NullLogger{}
+			httpso := &v1alpha1.HTTPScaledObject{
+				ObjectMeta: metav1.ObjectMeta{
+					Namespace: namespace,
+					Name:      name,
+				},
+				Spec: v1alpha1.HTTPScaledObjectSpec{
+					AppName: name,
+					Image:   "arschles/testapp",
+					Port:    8081,
+				},
+			}
+			err := createScaledObject(ctx, cfg, cl, logger, httpso)
+			Expect(err).To(BeNil())
+			// make sure that httpso has the right conditions on it
+			Expect(len(httpso.Status.Conditions)).To(Equal(1))
+
+			cond1 := httpso.Status.Conditions[0]
+			cond1ts, err := time.Parse(time.RFC3339, cond1.Timestamp)
+			Expect(err).To(BeNil())
+			Expect(time.Now().Sub(cond1ts) >= 0).To(BeTrue())
+			Expect(cond1.Type).To(Equal(v1alpha1.Created))
+			Expect(cond1.Status).To(Equal(metav1.ConditionTrue))
+			Expect(cond1.Reason).To(Equal(v1alpha1.ScaledObjectCreated))
+
+			// check that the ScaledObject was created
+			u := &unstructured.Unstructured{}
+			u.SetGroupVersionKind(schema.GroupVersionKind{
+				Group:   "keda.sh",
+				Kind:    "ScaledObject",
+				Version: "v1alpha1",
+			})
+			err = cl.Get(ctx, client.ObjectKey{
+				Namespace: cfg.Namespace,
+				Name:      cfg.ScaledObjectName(),
+			}, u)
+			Expect(err).To(BeNil())
+			metadataIface, found := u.Object["metadata"]
+			metadata, ok := metadataIface.(map[string]interface{})
+			Expect(found).To(BeTrue())
+			Expect(ok).To(BeTrue())
+			Expect(metadata["namespace"]).To(Equal(namespace))
+			Expect(metadata["name"]).To(Equal(cfg.ScaledObjectName()))
+			specIFace, found := u.Object["spec"]
+			_, ok = specIFace.(map[string]interface{})
+			Expect(found).To(BeTrue())
+			Expect(ok).To(BeTrue())
+
+		})
+	})
+})
diff --git a/operator/controllers/suite_test.go b/operator/controllers/suite_test.go
index 8351297..8e49de6 100644
--- a/operator/controllers/suite_test.go
+++ b/operator/controllers/suite_test.go
@@ -15,66 +15,69 @@
 
 package controllers
 
-// import (
-// 	"path/filepath"
-// 	"testing"
-
-// 	. "github.com/onsi/ginkgo"
-// 	. "github.com/onsi/gomega"
-// 	"k8s.io/client-go/kubernetes/scheme"
-// 	"k8s.io/client-go/rest"
-// 	"sigs.k8s.io/controller-runtime/pkg/client"
-// 	"sigs.k8s.io/controller-runtime/pkg/envtest"
-// 	"sigs.k8s.io/controller-runtime/pkg/envtest/printer"
-// 	logf "sigs.k8s.io/controller-runtime/pkg/log"
-// 	"sigs.k8s.io/controller-runtime/pkg/log/zap"
-
-// 	httpv1alpha1 "github.com/kedacore/http-add-on/operator/api/v1alpha1"
-// 	// +kubebuilder:scaffold:imports
-// )
-
-// // These tests use Ginkgo (BDD-style Go testing framework). Refer to
-// // http://onsi.github.io/ginkgo/ to learn more about Ginkgo.
+import (
+	"testing"
 
-// var cfg *rest.Config
-// var k8sClient client.Client
-// var testEnv *envtest.Environment
-
-// func TestAPIs(t *testing.T) {
-// 	RegisterFailHandler(Fail)
-
-// 	RunSpecsWithDefaultAndCustomReporters(t,
-// 		"Controller Suite",
-// 		[]Reporter{printer.NewlineReporter{}})
-// }
-
-// var _ = BeforeSuite(func(done Done) {
-// 	logf.SetLogger(zap.LoggerTo(GinkgoWriter, true))
+	. "github.com/onsi/ginkgo"
+	. "github.com/onsi/gomega"
+	"k8s.io/client-go/kubernetes/scheme"
+	"sigs.k8s.io/controller-runtime/pkg/envtest/printer"
+	logf "sigs.k8s.io/controller-runtime/pkg/log"
+	"sigs.k8s.io/controller-runtime/pkg/log/zap"
 
-// 	By("bootstrapping test environment")
-// 	testEnv = &envtest.Environment{
-// 		CRDDirectoryPaths: []string{filepath.Join("..", "config", "crd", "bases")},
-// 	}
+	httpv1alpha1 "github.com/kedacore/http-add-on/operator/api/v1alpha1"
+	// +kubebuilder:scaffold:imports
+)
 
-// 	var err error
-// 	cfg, err = testEnv.Start()
-// 	Expect(err).ToNot(HaveOccurred())
-// 	Expect(cfg).ToNot(BeNil())
+// These tests use Ginkgo (BDD-style Go testing framework). Refer to
+// http://onsi.github.io/ginkgo/ to learn more about Ginkgo.
 
-// 	err = httpv1alpha1.AddToScheme(scheme.Scheme)
-// 	Expect(err).NotTo(HaveOccurred())
-
-// 	// +kubebuilder:scaffold:scheme
-
-// 	k8sClient, err = client.New(cfg, client.Options{Scheme: scheme.Scheme})
-// 	Expect(err).ToNot(HaveOccurred())
-// 	Expect(k8sClient).ToNot(BeNil())
-
-// 	close(done)
-// }, 60)
+// var cfg *rest.Config
+// var k8sClient client.Client
+// var testEnv *envtest.Environment
 
-// var _ = AfterSuite(func() {
-// 	By("tearing down the test environment")
-// 	err := testEnv.Stop()
-// 	Expect(err).ToNot(HaveOccurred())
-// })
+func TestAPIs(t *testing.T) {
+	RegisterFailHandler(Fail)
+
+	RunSpecsWithDefaultAndCustomReporters(t,
+		"Controller Suite",
+		[]Reporter{printer.NewlineReporter{}})
+}
+
+var _ = BeforeSuite(func(done Done) {
+	// The commented code in this function connects to a test Kubernetes cluster.
+	// We don't currently have tests that exercise functionality that needs a cluster,
+	// so we're keeping it commented.
+	logf.SetLogger(zap.New(func(opts *zap.Options) {
+		opts.DestWriter = GinkgoWriter
+	}))
+
+	// By("bootstrapping test environment")
+	// useExistingCluster := true
+	// testEnv = &envtest.Environment{
+	// 	CRDDirectoryPaths:  []string{filepath.Join("..", "config", "crd", "bases")},
+	// 	UseExistingCluster: &useExistingCluster,
+	// }
+
+	var err error
+	// cfg, err = testEnv.Start()
+	// Expect(err).ToNot(HaveOccurred())
+	// Expect(cfg).ToNot(BeNil())
+
+	err = httpv1alpha1.AddToScheme(scheme.Scheme)
+	Expect(err).NotTo(HaveOccurred())
+
+	// +kubebuilder:scaffold:scheme
+
+	// k8sClient, err = client.New(cfg, client.Options{Scheme: scheme.Scheme})
+	// Expect(err).ToNot(HaveOccurred())
+	// Expect(k8sClient).ToNot(BeNil())
+
+	close(done)
+}, 60)
+
+var _ = AfterSuite(func() {
+	By("tearing down the test environment")
+	// err := testEnv.Stop()
+	// Expect(err).ToNot(HaveOccurred())
+})
diff --git a/operator/controllers/user_app_test.go b/operator/controllers/user_app_test.go
new file mode 100644
index 0000000..8a7b52d
--- /dev/null
+++ b/operator/controllers/user_app_test.go
@@ -0,0 +1,90 @@
+package controllers
+
+import (
+	"context"
+	"time"
+
+	logrtest "github.com/go-logr/logr/testing"
+	"github.com/kedacore/http-add-on/operator/api/v1alpha1"
+	"github.com/kedacore/http-add-on/operator/controllers/config"
+	. "github.com/onsi/ginkgo"
+	. "github.com/onsi/gomega"
+	appsv1 "k8s.io/api/apps/v1"
+	corev1 "k8s.io/api/core/v1"
+	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+	"k8s.io/apimachinery/pkg/util/intstr"
+	"sigs.k8s.io/controller-runtime/pkg/client"
+	"sigs.k8s.io/controller-runtime/pkg/client/fake"
+)
+
+var _ = Describe("UserApp", func() {
+	Context("Creating a user app", func() {
+		It("Should properly create a deployment and a service", func() {
+			ctx := context.Background()
+			cl := fake.NewFakeClient()
+			cfg := config.AppInfo{
+				Name:      "testapp",
+				Port:      8081,
+				Image:     "arschles/testimg",
+				Namespace: "testns",
+			}
+			logger := logrtest.NullLogger{}
+			httpso := &v1alpha1.HTTPScaledObject{
+				ObjectMeta: metav1.ObjectMeta{
+					Namespace: "testns",
+					Name:      "testapp",
+				},
+				Spec: v1alpha1.HTTPScaledObjectSpec{
+					AppName: "testname",
+					Image:   "arschles/testapp",
+					Port:    8081,
+				},
+			}
+			err := createUserApp(ctx, cfg, cl, logger, httpso)
+			Expect(err).To(BeNil())
+			// make sure that httpso has the right conditions on it
+			Expect(len(httpso.Status.Conditions)).To(Equal(2))
+
+			cond1 := httpso.Status.Conditions[0]
+			cond1ts, err := time.Parse(time.RFC3339, cond1.Timestamp)
+			Expect(err).To(BeNil())
+			Expect(time.Now().Sub(cond1ts) >= 0).To(BeTrue())
+			Expect(cond1.Type).To(Equal(v1alpha1.Created))
+			Expect(cond1.Status).To(Equal(metav1.ConditionTrue))
+			Expect(cond1.Reason).To(Equal(v1alpha1.AppDeploymentCreated))
+
+			cond2 := httpso.Status.Conditions[1]
+			cond2ts, err := time.Parse(time.RFC3339, cond2.Timestamp)
+			Expect(err).To(BeNil())
+			Expect(time.Now().Sub(cond2ts) >= 0).To(BeTrue())
+			Expect(cond2.Type).To(Equal(v1alpha1.Created))
+			Expect(cond2.Status).To(Equal(metav1.ConditionTrue))
+			Expect(cond2.Reason).To(Equal(v1alpha1.AppServiceCreated))
+
+			// check the deployment that was created
+			deployment := &appsv1.Deployment{}
+			err = cl.Get(ctx, client.ObjectKey{
+				Name:      cfg.Name,
+				Namespace: cfg.Namespace,
+			}, deployment)
+			Expect(err).To(BeNil())
+			Expect(deployment.Name).To(Equal(cfg.Name))
+			Expect(len(deployment.Spec.Template.Spec.Containers)).To(Equal(1))
+			Expect(deployment.Spec.Template.Spec.Containers[0].Image).To(Equal(cfg.Image))
+
+			// check the service that was created
+			svc := &corev1.Service{}
+			err = cl.Get(ctx, client.ObjectKey{
+				Name:      cfg.Name,
+				Namespace: cfg.Namespace,
+			}, svc)
+			Expect(err).To(BeNil())
+			Expect(svc.Name).To(Equal(cfg.Name))
+			Expect(len(svc.Spec.Ports)).To(Equal(1))
+			Expect(svc.Spec.Ports[0].Protocol).To(Equal(corev1.ProtocolTCP))
+			Expect(svc.Spec.Ports[0].TargetPort.IntVal).To(Equal(cfg.Port))
+			Expect(svc.Spec.Ports[0].TargetPort.Type).To(Equal(intstr.Int))
+			Expect(svc.Spec.Ports[0].Port).To(Equal(int32(8080)))
+		})
+	})
+})