feat: add more context for warning about not having an autoscaling config

This commit is contained in:
Jose Diaz-Gonzalez
2025-07-23 20:15:08 -04:00
parent e7964ee99d
commit 78bde7f817
2 changed files with 64 additions and 1 deletions

View File

@@ -576,7 +576,7 @@ func getAutoscaling(input GetAutoscalingInput) (ProcessAutoscaling, error) {
}
if !ok {
common.LogWarn(fmt.Sprintf("No autoscaling config found for %s", input.AppName))
common.LogWarn(fmt.Sprintf("No autoscaling config found for %s:%s", input.AppName, input.ProcessType))
return ProcessAutoscaling{}, nil
}

View File

@@ -0,0 +1,63 @@
#!/usr/bin/env bats
load test_helper
TEST_APP="rdmtestapp"
setup() {
uninstall_k3s || true
global_setup
dokku nginx:stop
export KUBECONFIG="/etc/rancher/k3s/k3s.yaml"
}
teardown_() {
global_teardown
dokku nginx:start
uninstall_k3s || true
}
@test "(scheduler-k3s) kustomize" {
if [[ -z "$DOCKERHUB_USERNAME" ]] || [[ -z "$DOCKERHUB_TOKEN" ]]; then
skip "skipping due to missing docker.io credentials DOCKERHUB_USERNAME:DOCKERHUB_TOKEN"
fi
INGRESS_CLASS=nginx install_k3s
run /bin/bash -c "dokku apps:create $TEST_APP"
echo "output: $output"
echo "status: $status"
assert_success
run deploy_app python dokku@$DOKKU_DOMAIN:$TEST_APP convert_to_dockerfile
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "kubectl get deployment $TEST_APP-web -o json | jq -r '.spec.replicas'"
echo "output: $output"
echo "status: $status"
assert_success
assert_output "3"
}
inject_kustomization_yaml() {
local APP="$1"
local APP_REPO_DIR="$2"
[[ -z "$APP" ]] && local APP="$TEST_APP"
mkdir -p "$APP_REPO_DIR/config/kustomize"
touch "$APP_REPO_DIR/config/kustomize/kustomization.yaml"
cat <<EOF >"$APP_REPO_DIR/config/kustomize/kustomization.yaml"
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
patches:
- patch: |-
- op: replace
path: /spec/replicas
value: 3
target:
group: apps
version: v1
kind: Deployment
EOF
}