Skip to content

Commit

Permalink
automated commit
Browse files Browse the repository at this point in the history
Signed-off-by: Public copy <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] committed Oct 22, 2024
1 parent 63cb7af commit 9910725
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 9 deletions.
6 changes: 5 additions & 1 deletion images/cilium/tests/cilium-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

set -o errexit -o errtrace -o pipefail -x -v

apk add cilium-cli
# Newer versions of the CLI requires some version symbols
# that our binary is missing. Temporarily use the 0.16.14
# version of the CLI to avoid this issue.
apk add cilium-cli~0.16.14

cilium status --wait --wait-duration 2m

QUAY_IMAGES=$(cilium status -o json | grep quay.io || true)
Expand Down
78 changes: 74 additions & 4 deletions images/cluster-proportional-autoscaler/tests/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,23 @@ module "cluster_harness" {
module "helm" {
source = "../../../tflib/imagetest/helm"

name = "cpa"
repo = "https://kubernetes-sigs.github.io/cluster-proportional-autoscaler"
chart = "cluster-proportional-autoscaler"
wait = true

values = {
options = {
target = "deployment/"
target = "deployment/nginx-autoscale-example"
logLevel = 2
}

config = {
linear = {
coresPerReplica = 2
nodesPerReplica = 1
min = 1
max = 100
max = 3
preventSinglePointFailure = true
includeUnschedulableNodes = true
}
Expand All @@ -59,13 +62,80 @@ resource "imagetest_feature" "basic" {
harness = module.cluster_harness.harness

steps = [
{
name = "Deploy nginx-autoscale-example"
cmd = <<EOF
kubectl create deployment nginx-autoscale-example --image=cgr.dev/chainguard/nginx --replicas=1
kubectl wait --for=condition=available deployment/nginx-autoscale-example
EOF
},
{
name = "Helm Install"
cmd = module.helm.install_cmd
}
},
{
name = "Check the replica count"
cmd = <<EOF
REPLICAS=$(kubectl get deployment nginx-autoscale-example -o jsonpath='{.spec.replicas}')
if [ "$REPLICAS" -eq 3 ]; then
echo "Replica count is 3!"
else
echo "Expected replica count is not 3. Actual: $REPLICAS"
exit 1
fi
EOF
retry = { attempts = 3, delay = "5s", factor = 3 }
},
{
name = "Check expected logs"
cmd = <<EOF
logs_to_expect="
Scaling Namespace: default, Target: deployment/nginx-autoscale-example
updating replicas from 1 to 3
"
logs=$(kubectl logs deployment/cpa-cluster-proportional-autoscaler)
echo "$logs_to_expect" | while IFS= read -r log; do
log=$(echo "$log" | xargs)
if [ -z "$log" ]; then
continue
fi
if ! echo "$logs" | grep -F -i "$log" > /dev/null; then
echo "Current logs: $logs"
echo "Expected log not found: $log"
exit 1
fi
done
EOF
},
{
name = "Check unexpected logs"
cmd = <<EOF
logs_to_not_expect="
Update failure
connection refused
unable to load
"
logs=$(kubectl logs deployment/cpa-cluster-proportional-autoscaler)
echo "$logs_to_not_expect" | while IFS= read -r log; do
log=$(echo "$log" | xargs)
if [ -z "$log" ]; then
continue
fi
if echo "$logs" | grep -F -i "$log"; then
echo "Current logs: $logs"
echo "Unexpected log found: $log"
exit 1
fi
done
EOF
},
]

labels = {
type = "k8s"
}
}
}
1 change: 1 addition & 0 deletions images/gitlab-pages/config/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ output "config" {
entrypoint = {
command = "/scripts/entrypoint.sh"
}
cmd = "/scripts/start-pages"
paths = [{
path = "/etc/gitlab-pages"
type = "directory"
Expand Down
2 changes: 1 addition & 1 deletion images/management-api-for-apache-cassandra/tests/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ module "helm_cert_manager" {
tag = "latest"
}
}
installCRDs = "true"
installCRDs = true
}
}

Expand Down
4 changes: 2 additions & 2 deletions images/mariadb/tests/02-runs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ set -o errexit -o nounset -o errtrace -o pipefail -x

# Start up the mariadb container in the background
name=mariadb-${RANDOM}
docker run -d --name $name -e MYSQL_ROOT_PASSWORD=secret "${IMAGE_NAME}"
docker run -d --name $name -e MARIADB_ROOT_PASSWORD=secret "${IMAGE_NAME}"
sleep 5

# Exec into the container and run the mysql command
docker exec $name mysql -u root -psecret -e "SHOW status;" | grep Uptime
docker exec $name mariadb -uroot -psecret -e "SHOW status;" | grep Uptime

docker kill $name
6 changes: 5 additions & 1 deletion images/php-fpm_exporter/tests/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -85,20 +85,24 @@ spec:
args: ["--phpfpm.scrape-uri=http://127.0.0.1:9000/status"]
ports:
- containerPort: 9103
- name: prometheus
image: cgr.dev/chainguard/prometheus:latest
args: ["--config.file=/etc/prometheus/prometheus.yml"]
volumeMounts:
- name: prometheus-config-volume
mountPath: /etc/prometheus/prometheus.yml
subPath: prometheus.yml
- name: data
mountPath: /data
ports:
- containerPort: 9090
volumes:
- name: prometheus-config-volume
configMap:
name: prometheus-config
- name: data
emptyDir:
sizeLimit: 200Mi
---
apiVersion: batch/v1
kind: Job
Expand Down

0 comments on commit 9910725

Please sign in to comment.