Compare commits

..

8 Commits

Author SHA1 Message Date
orianelou
2c9ec1e48c Delete apisix directory 2024-02-26 10:50:43 +02:00
orianelou
55b5973c15 Create docker-compose.yaml 2024-02-26 10:50:16 +02:00
orianelou
63b5a63ded Create apisix-standalone.yaml 2024-02-26 10:49:23 +02:00
orianelou
b08047cc33 Create apisix-standalone.yaml: 2024-02-25 11:41:04 +02:00
orianelou
328808c15f Create docker-compose.yaml 2024-02-25 11:40:12 +02:00
WrightNed
c255621cd6 Merge pull request #94 from bmbeverst/fix_tests
Fix new helm-unittest tests
2024-02-22 14:24:37 +02:00
Brooks Beverstock
aa8cfd1b2a fix: Set kind to Vanilla in ingress-nginx tests, so they pass. 2024-01-24 17:07:35 -05:00
Brooks Beverstock
5452d68f9b fix: Rename expected test name due to chart name change, from ingress-nginx to open-appsec-k8s-nginx-ingress. 2024-01-24 17:06:53 -05:00
14 changed files with 74 additions and 12 deletions

View File

@@ -0,0 +1,11 @@
# example local declarative configuration file for apisix in standalone mode
routes:
-
uri: /anything
upstream:
nodes:
"httpbin.org:80": 1
type: roundrobin
#END

View File

@@ -0,0 +1,46 @@
// Copyright (C) 2022 Check Point Software Technologies Ltd. All rights reserved.
// Licensed under the Apache License, Version 2.0 (the "License");
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
version: "3"
services:
apisix:
container_name: apisix
image: "ghcr.io/openappsec/apisix-attachment:latest"
ipc: host
restart: always
volumes:
- ./apisix-localconfig/apisix-standalone.yaml:/usr/local/apisix/conf/apisix.yaml:ro
environment:
- APISIX_STAND_ALONE=true
ports:
- "9180:9180/tcp"
- "9080:9080/tcp"
- "9091:9091/tcp"
- "9443:9443/tcp"
appsec-agent:
container_name: appsec-agent
image: 'ghcr.io/openappsec/agent:latest'
ipc: host
restart: unless-stopped
environment:
# adjust with your own email below
- user_email=user@email.com
- registered_server="APISIX Server"
volumes:
- ./appsec-config:/etc/cp/conf
- ./appsec-data:/etc/cp/data
- ./appsec-logs:/var/log/nano_agent
- ./appsec-localconfig:/ext/appsec
command: /cp-nano-agent --standalone

View File

@@ -21,7 +21,7 @@ tests:
of: ConfigMap
- equal:
path: metadata.name
value: RELEASE-NAME-ingress-nginx-custom-add-headers
value: RELEASE-NAME-open-appsec-k8s-nginx-ingress-custom-add-headers
- equal:
path: data.X-Another-Custom-Header
value: Value

View File

@@ -21,7 +21,7 @@ tests:
of: ConfigMap
- equal:
path: metadata.name
value: RELEASE-NAME-ingress-nginx-custom-proxy-headers
value: RELEASE-NAME-open-appsec-k8s-nginx-ingress-custom-proxy-headers
- equal:
path: data.X-Custom-Header
value: Value

View File

@@ -11,4 +11,4 @@ tests:
of: ConfigMap
- equal:
path: metadata.name
value: RELEASE-NAME-ingress-nginx-controller
value: RELEASE-NAME-open-appsec-k8s-nginx-ingress-controller

View File

@@ -6,6 +6,7 @@ tests:
- it: should create a DaemonSet if `controller.kind` is "DaemonSet"
set:
controller.kind: DaemonSet
kind: Vanilla
asserts:
- hasDocuments:
count: 1
@@ -13,4 +14,4 @@ tests:
of: DaemonSet
- equal:
path: metadata.name
value: RELEASE-NAME-ingress-nginx-controller
value: RELEASE-NAME-open-appsec-k8s-nginx-ingress-controller

View File

@@ -4,6 +4,8 @@ templates:
tests:
- it: should create a Deployment
set:
kind: Vanilla
asserts:
- hasDocuments:
count: 1
@@ -11,11 +13,12 @@ tests:
of: Deployment
- equal:
path: metadata.name
value: RELEASE-NAME-ingress-nginx-controller
value: RELEASE-NAME-open-appsec-k8s-nginx-ingress-controller
- it: should create a Deployment with 3 replicas if `controller.replicaCount` is 3
set:
controller.replicaCount: 3
kind: Vanilla
asserts:
- equal:
path: spec.replicas
@@ -25,6 +28,7 @@ tests:
set:
controller.resources.limits.cpu: 500m
controller.resources.limits.memory: 512Mi
kind: Vanilla
asserts:
- equal:
path: spec.template.spec.containers[0].resources.limits.cpu

View File

@@ -14,4 +14,4 @@ tests:
of: HorizontalPodAutoscaler
- equal:
path: metadata.name
value: RELEASE-NAME-ingress-nginx-controller
value: RELEASE-NAME-open-appsec-k8s-nginx-ingress-controller

View File

@@ -14,4 +14,4 @@ tests:
of: ScaledObject
- equal:
path: metadata.name
value: RELEASE-NAME-ingress-nginx-controller
value: RELEASE-NAME-open-appsec-k8s-nginx-ingress-controller

View File

@@ -20,4 +20,4 @@ tests:
of: NetworkPolicy
- equal:
path: metadata.name
value: RELEASE-NAME-ingress-nginx-controller
value: RELEASE-NAME-open-appsec-k8s-nginx-ingress-controller

View File

@@ -22,4 +22,4 @@ tests:
of: Service
- equal:
path: metadata.name
value: RELEASE-NAME-ingress-nginx-controller-internal
value: RELEASE-NAME-open-appsec-k8s-nginx-ingress-controller-internal

View File

@@ -20,4 +20,4 @@ tests:
of: Service
- equal:
path: metadata.name
value: RELEASE-NAME-ingress-nginx-controller-metrics
value: RELEASE-NAME-open-appsec-k8s-nginx-ingress-controller-metrics

View File

@@ -20,7 +20,7 @@ tests:
of: Service
- equal:
path: metadata.name
value: RELEASE-NAME-ingress-nginx-controller
value: RELEASE-NAME-open-appsec-k8s-nginx-ingress-controller
- it: should create a Service of type "NodePort" if `controller.service.external.enabled` is true and `controller.service.type` is "NodePort"
set:

View File

@@ -20,7 +20,7 @@ tests:
of: Service
- equal:
path: metadata.name
value: RELEASE-NAME-ingress-nginx-defaultbackend
value: RELEASE-NAME-open-appsec-k8s-nginx-ingress-defaultbackend
- it: should create a Service with port 80 if `defaultBackend.service.port` is 80
set: