Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ademariag committed Sep 1, 2024
1 parent 5bd77f0 commit ae2db2e
Show file tree
Hide file tree
Showing 231 changed files with 277 additions and 239 deletions.
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
exclude: ^(examples/|tests/test_terraform_compiled/|tests/test_kubernetes_compiled/|tests/test_docker_compiled/|tests/test_resources/|tests/test_jsonnet/)
repos:
- repo: https://github.com/psf/black
rev: 24.8.0
Expand Down
2 changes: 1 addition & 1 deletion examples/docker/compiled/docker/jsonnet/Dockerfile.web
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM amazoncorretto:11
COPY target/blah.jar /app/blah.jar
EXPOSE ${PORT}
ENTRYPOINT ["java", "-jar", "/app/blah.jar"]
ENTRYPOINT ["java", "-jar", "/app/blah.jar"]
2 changes: 1 addition & 1 deletion examples/docker/compiled/docker/jsonnet/Dockerfile.worker
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM amazoncorretto:8
COPY target/blah.jar /app/blah.jar
ENTRYPOINT ["java", "-jar", "/app/blah.jar"]
ENTRYPOINT ["java", "-jar", "/app/blah.jar"]
2 changes: 1 addition & 1 deletion examples/docker/compiled/docker/kadet/Dockerfile.web
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM amazoncorretto:11
COPY target/blah.jar /app/blah.jar
EXPOSE ${PORT}
ENTRYPOINT ["java", "-jar", "/app/blah.jar"]
ENTRYPOINT ["java", "-jar", "/app/blah.jar"]
2 changes: 1 addition & 1 deletion examples/docker/compiled/docker/kadet/Dockerfile.worker
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM amazoncorretto:8
COPY target/blah.jar /app/blah.jar
ENTRYPOINT ["java", "-jar", "/app/blah.jar"]
ENTRYPOINT ["java", "-jar", "/app/blah.jar"]
5 changes: 2 additions & 3 deletions examples/docker/components/kadet/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import json
import os

from kapitan.inputs import kadet
import json
from kapitan.resources import jinja2_render_file
from kapitan.inputs import kadet

inventory = kadet.inventory()

Expand Down
2 changes: 1 addition & 1 deletion examples/kubernetes/charts/nginx-ingress/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This file documents all notable changes to [ingress-nginx](https://github.com/ku
* #7652 - Updated Helm chart to use the fullname for the electionID if not specified. by @FutureMatt in https://github.com/kubernetes/ingress-nginx/pull/9133
* Rename controller-wehbooks-networkpolicy.yaml. by @Gacko in https://github.com/kubernetes/ingress-nginx/pull/9123

### 4.3.0
### 4.3.0
- Support for Kubernetes v.1.25.0 was added and support for endpoint slices
- Support for Kubernetes v1.20.0 and v1.21.0 was removed
- [8890](https://github.com/kubernetes/ingress-nginx/pull/8890) migrate to endpointslices
Expand Down
1 change: 1 addition & 0 deletions examples/kubernetes/charts/nginx-ingress/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -494,3 +494,4 @@ Kubernetes: `>=1.20.0-0`
| serviceAccount.name | string | `""` | |
| tcp | object | `{}` | TCP service key-value pairs # Ref: https://github.com/kubernetes/ingress-nginx/blob/main/docs/user-guide/exposing-tcp-udp-services.md # |
| udp | object | `{}` | UDP service key-value pairs # Ref: https://github.com/kubernetes/ingress-nginx/blob/main/docs/user-guide/exposing-tcp-udp-services.md # |

Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ data:
{{- range $key, $value := .Values.controller.config }}
{{- $key | nindent 2 }}: {{ $value | quote }}
{{- end }}

Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,4 @@ spec:
{{- end }}
{{- end }}
{{- end }}

2 changes: 1 addition & 1 deletion examples/kubernetes/compiled/busybox/copy/copy_target
Original file line number Diff line number Diff line change
@@ -1 +1 @@
for_testing
for_testing
2 changes: 1 addition & 1 deletion examples/kubernetes/compiled/busybox/copy_target
Original file line number Diff line number Diff line change
@@ -1 +1 @@
for_testing
for_testing
2 changes: 1 addition & 1 deletion examples/kubernetes/compiled/labels/labels/service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ spec:
ports:
- port: 5432
targetPort: 5432
name: postgres
name: postgres
2 changes: 1 addition & 1 deletion examples/kubernetes/compiled/minikube-es/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ Deleting is easy (warning, this will remove _everything_):

```
$ scripts/kubectl.sh delete -f manifests/
```
```
2 changes: 1 addition & 1 deletion examples/kubernetes/compiled/minikube-es/copy/copy_target
Original file line number Diff line number Diff line change
@@ -1 +1 @@
for_testing
for_testing
2 changes: 1 addition & 1 deletion examples/kubernetes/compiled/minikube-es/copy_target
Original file line number Diff line number Diff line change
@@ -1 +1 @@
for_testing
for_testing
2 changes: 1 addition & 1 deletion examples/kubernetes/compiled/minikube-es/scripts/apply.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ for SECTION in pre-deploy manifests
do
echo "## run kubectl apply for ${SECTION}"
kapitan refs --reveal -f ${DIR}/../${SECTION}/ | ${DIR}/kubectl.sh apply -f - | column -t
done
done
2 changes: 1 addition & 1 deletion examples/kubernetes/compiled/minikube-es/scripts/delete.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@

DIR=$(dirname ${BASH_SOURCE[0]})

${DIR}/kubectl.sh delete -f ${DIR}/../manifests
${DIR}/kubectl.sh delete -f ${DIR}/../manifests
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@

KUBECTL="kubectl --context minikube-es --insecure-skip-tls-verify=False "

${KUBECTL} $@
${KUBECTL} $@
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ URL=https://storage.googleapis.com/minikube/releases/${MINIKUBE_VERSION}/${MINIK
echo Downloading minikube release ${MINIKUBE_VERSION} to /usr/local/bin/minikube
pause
sudo curl --progress-bar -o /usr/local/bin/minikube ${URL}
sudo chmod +x /usr/local/bin/minikube
sudo chmod +x /usr/local/bin/minikube
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@

eval $(minikube docker-env)
minikube start --insecure-registry https://quay.io --memory=4096 --cpus=4
minikube ssh "sudo ip link set docker0 promisc on"
minikube ssh "sudo ip link set docker0 promisc on"
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
# SPDX-FileCopyrightText: 2020 The Kapitan Authors <[email protected]>
#
# SPDX-License-Identifier: Apache-2.0



Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# SPDX-License-Identifier: Apache-2.0

kubectl config set-context minikube-es --cluster minikube --user minikube --namespace minikube-es
kubectl config use-context minikube-es
kubectl config use-context minikube-es
2 changes: 1 addition & 1 deletion examples/kubernetes/compiled/minikube-mysql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ Deleting is easy (warning, this will remove _everything_):

```
$ scripts/kubectl.sh delete -f manifests/
```
```
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ for SECTION in pre-deploy manifests
do
echo "## run kubectl apply for ${SECTION}"
kapitan refs --reveal -f ${DIR}/../${SECTION}/ | ${DIR}/kubectl.sh apply -f - | column -t
done
done
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@

DIR=$(dirname ${BASH_SOURCE[0]})

${DIR}/kubectl.sh delete -f ${DIR}/../manifests
${DIR}/kubectl.sh delete -f ${DIR}/../manifests
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@

KUBECTL="kubectl --context minikube-mysql --insecure-skip-tls-verify=False "

${KUBECTL} $@
${KUBECTL} $@
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ URL=https://storage.googleapis.com/minikube/releases/${MINIKUBE_VERSION}/${MINIK
echo Downloading minikube release ${MINIKUBE_VERSION} to /usr/local/bin/minikube
pause
sudo curl --progress-bar -o /usr/local/bin/minikube ${URL}
sudo chmod +x /usr/local/bin/minikube
sudo chmod +x /usr/local/bin/minikube
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@

eval $(minikube docker-env)
minikube start --insecure-registry https://quay.io --memory=4096 --cpus=4
minikube ssh "sudo ip link set docker0 promisc on"
minikube ssh "sudo ip link set docker0 promisc on"
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
# SPDX-FileCopyrightText: 2020 The Kapitan Authors <[email protected]>
#
# SPDX-License-Identifier: Apache-2.0



Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# SPDX-License-Identifier: Apache-2.0

kubectl config set-context minikube-mysql --cluster minikube --user minikube --namespace minikube-mysql
kubectl config use-context minikube-mysql
kubectl config use-context minikube-mysql
2 changes: 1 addition & 1 deletion examples/kubernetes/compiled/minikube-nginx-helm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
Target *minikube-nginx-helm* is running:

* 2 replicas of *nginx* running nginx image nginx:1:15.8
* on cluster minikube
* on cluster minikube
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ for SECTION in manifests
do
echo "## run kubectl apply for ${SECTION}"
${KUBECTL} apply -f ${DIR}/${SECTION}/ | column -t
done
done
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
Target *minikube-nginx-jsonnet* is running:

* 1 replicas of *nginx* running nginx image nginx:1:15.8
* on cluster minikube
* on cluster minikube
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ for SECTION in manifests
do
echo "## run kubectl apply for ${SECTION}"
${KUBECTL} apply -f ${DIR}/${SECTION}/ | column -t
done
done
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
Target *minikube-nginx-kadet* is running:

* 2 replicas of *nginx* running nginx image nginx:1:15.8
* on cluster minikube
* on cluster minikube
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ for SECTION in manifests
do
echo "## run kubectl apply for ${SECTION}"
${KUBECTL} apply -f ${DIR}/${SECTION}/ | column -t
done
done
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ local deployment = kube.Deployment("nginx") {

{
nginx_deployment: deployment
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ local svc = kube.Service("nginx") {

{
nginx_svc: svc
}
}
2 changes: 1 addition & 1 deletion examples/kubernetes/copy_target
Original file line number Diff line number Diff line change
@@ -1 +1 @@
for_testing
for_testing
2 changes: 1 addition & 1 deletion examples/kubernetes/inventory/classes/cluster/minikube.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ parameters:
minikube:
memory: 4096
cpus: 4
version: v0.31.0
version: v0.31.0

cluster:
type: minikube
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ parameters:
- input_type: copy
input_paths:
- copy_target
output_path: .
output_path: .
10 changes: 5 additions & 5 deletions examples/kubernetes/inventory/classes/component/mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ parameters:
input_type: jinja2
input_paths:
- docs/mysql/README.md
validate:
- type: kubernetes # mkdocs (1)!
output_paths: # mkdocs (2)!
validate:
- type: kubernetes # mkdocs (1)!
output_paths: # mkdocs (2)!
- manifests/mysql_secret.yml
kind: secret # temporarily replaced with 'deployment' during test # mkdocs (3)!
version: 1.14.0 # optional, defaults to 1.14.0 # mkdocs (4)!
kind: secret # temporarily replaced with 'deployment' during test # mkdocs (3)!
version: 1.14.0 # optional, defaults to 1.14.0 # mkdocs (4)!
- type: kubernetes
output_paths:
- manifests/mysql_service_jsonnet.yml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ parameters:
output_type: yml
input_paths:
- components/namespace/main.jsonnet

Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ parameters:
compile:
- output_path: . #(2)!
input_type: jinja2
input_paths: ${templates} #(3)!
input_paths: ${templates} #(3)!
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ parameters:
name: ${nginx:name}
helm_params:
name: ${nginx:name}
namespace: ${nginx:namespace}
namespace: ${nginx:namespace}
1 change: 1 addition & 0 deletions examples/kubernetes/inventory/targets/all-glob.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,4 @@ parameters:
input_paths:
- components/*/main.jsonnet
output_type: yml

2 changes: 1 addition & 1 deletion examples/kubernetes/inventory/targets/busybox.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
classes:
classes:
- common
- component.namespace
- component.busybox
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ classes:
parameters:
# These parameters are redundand because automatically set by `common`
## target_name: minikube-nginx-helm
## namespace: ${target_name}
## namespace: ${target_name}
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ parameters:
# These parameters are redundand because automatically set by `common`
## target_name: minikube-nginx-kadet
## namespace: ${target_name}

2 changes: 1 addition & 1 deletion examples/kubernetes/inventory/targets/removal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ parameters:
- input_type: remove
input_paths:
- compiled/${kapitan:vars:target}/copy_target
output_path: .
output_path: .
Binary file modified examples/kubernetes/refs/[email protected]
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/kubernetes/scripts/apply.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ for SECTION in pre-deploy manifests
do
echo "## run kubectl apply for ${SECTION}"
kapitan refs --reveal -f ${DIR}/../${SECTION}/ | ${DIR}/kubectl.sh apply -f - | column -t
done
done
2 changes: 1 addition & 1 deletion examples/kubernetes/scripts/delete.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
{% set i = inventory.parameters %}
DIR=$(dirname ${BASH_SOURCE[0]})

${DIR}/kubectl.sh delete -f ${DIR}/../manifests
${DIR}/kubectl.sh delete -f ${DIR}/../manifests
2 changes: 1 addition & 1 deletion examples/kubernetes/scripts/kubectl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@

KUBECTL="kubectl --context {{inventory.parameters.target_name}} --insecure-skip-tls-verify={{inventory.parameters.kubectl.insecure_skip_tls_verify}} "

${KUBECTL} $@
${KUBECTL} $@
2 changes: 1 addition & 1 deletion examples/kubernetes/scripts/minikube/install_minikube.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ URL=https://storage.googleapis.com/minikube/releases/${MINIKUBE_VERSION}/${MINIK
echo Downloading minikube release ${MINIKUBE_VERSION} to /usr/local/bin/minikube
pause
sudo curl --progress-bar -o /usr/local/bin/minikube ${URL}
sudo chmod +x /usr/local/bin/minikube
sudo chmod +x /usr/local/bin/minikube
2 changes: 1 addition & 1 deletion examples/kubernetes/scripts/minikube/start_minikube.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
{% set minikube = inventory.parameters.minikube %}
eval $(minikube docker-env)
minikube start --insecure-registry https://quay.io --memory={{minikube.memory}} --cpus={{minikube.cpus}}
minikube ssh "sudo ip link set docker0 promisc on"
minikube ssh "sudo ip link set docker0 promisc on"
2 changes: 1 addition & 1 deletion examples/kubernetes/scripts/setup_cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ kubectl config set-cluster {{cluster.id}} --server={{cluster.kubernetes.master.a

{% elif cluster.type == "minikube" %}

{% endif %}
{% endif %}
2 changes: 1 addition & 1 deletion examples/kubernetes/scripts/setup_context.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
{% set i = inventory.parameters %}
{% set cluster = i.cluster %}
kubectl config set-context {{i.target_name}} --cluster {{cluster.id}} --user {{cluster.user}} --namespace {{i.namespace}}
kubectl config use-context {{i.target_name}}
kubectl config use-context {{i.target_name}}
2 changes: 1 addition & 1 deletion examples/terraform/compiled/project1/scripts/apply.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ source "${DIR}"/common.sh
check_tf_initialized
"${TERRAFORM}" apply "$@"

"${DIR}"/update_output.sh
"${DIR}"/update_output.sh
Loading

0 comments on commit ae2db2e

Please sign in to comment.