-
Notifications
You must be signed in to change notification settings - Fork 0
[AE-1241] publish new version of deployer #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
370bf07
b5a1b2b
3f94034
21c3412
9a314ce
76775dc
5e25aed
ae0e77b
944313a
29153aa
6806f97
f8d70d8
82033e5
38c85be
e48cfd2
92ea390
924e7e4
67e846a
1f33f4a
272a0d6
1a83bf0
2091626
b9fbaa2
bb85b3a
4aee9b8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # Terraform files | ||
| *.tfvars | ||
| *.tfstate | ||
| *.tfstate.* | ||
| .terraform/ | ||
| .terraform.lock.hcl | ||
|
|
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -11,7 +11,7 @@ RUN apk add --no-cache yq && \ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| yq -i ".properties.stackgenPat.default = \"$GH_TOKEN\"" schema.yaml | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Stage 1: Preprocessing schema.yaml | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| FROM marketplace.gcr.io/google/debian10 AS build | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| FROM marketplace.gcr.io/google/debian11 AS build | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Install tools for envsubst | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RUN apt-get update && apt-get install -y --no-install-recommends gettext && rm -rf /var/lib/apt/lists/* | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -24,18 +24,61 @@ RUN envsubst < /workspace/schema.yaml > /workspace/schema.yaml.processed && \ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Stage 2: Deployer | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| FROM gcr.io/cloud-marketplace-tools/k8s/deployer_envsubst:latest | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ARG TERRAFORM_VERSION=1.5.3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ARG TERRAFORM_VERSION=1.13.4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ARG YQ_VERSION=4.44.6 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RUN apt-get update && apt-get install -y wget unzip git jq && \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Update base system and install security patches | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RUN apt-get update && \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| apt-get upgrade -y && \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| apt-get install -y --no-install-recommends \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ca-certificates \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| wget \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| unzip \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| git \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| jq \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| curl && \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Install Terraform | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| wget https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip && \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| unzip terraform_${TERRAFORM_VERSION}_linux_amd64.zip -d /usr/local/bin/ && \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| rm terraform_${TERRAFORM_VERSION}_linux_amd64.zip && \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| wget -O /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 && \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Install yq with specific version | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| wget -O /usr/local/bin/yq https://github.com/mikefarah/yq/releases/download/v${YQ_VERSION}/yq_linux_amd64 && \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| chmod +x /usr/local/bin/yq && \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
prashantrakh marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| apt-get remove -y wget unzip && apt-get autoremove -y && apt-get clean | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Install latest kubectl versions to fix CVE-2025-8959, CVE-2025-61729, and CVE-2025-22868 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # These vulnerabilities affect kubectl binaries built with vulnerable Go dependencies | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Installing latest kubectl versions that were built with fixed Go 1.22.6+ and updated dependencies | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| KUBECTL_VERSION=$(curl -L -s https://dl.k8s.io/release/stable.txt) && \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| mkdir -p /opt/kubectl/1.30 /opt/kubectl/1.31 && \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| curl -LO "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl" && \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| curl -LO "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl.sha256" && \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "$(cat kubectl.sha256) kubectl" | sha256sum --check && \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| chmod +x kubectl && \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cp kubectl /opt/kubectl/1.30/kubectl && \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cp kubectl /opt/kubectl/1.31/kubectl && \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cp kubectl /usr/local/bin/kubectl && \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| rm kubectl kubectl.sha256 && \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+47
to
+59
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🌐 Web query:
💡 Result: Short answer What to do
References
Would you like me to scan a specific binary/container image, repo, or list of tools for the vulnerable go-getter dependency? 🌐 Web query:
💡 Result: Short summary — what it is
Impact for kubectl
Affected versions / fix
What you should do
References
Sources: 🌐 Web query:
💡 Result: Summary
Relevance to kubectl
Recommended actions
References kubectl installation copies single binary to version-specific directories, and CVE claims in comment need clarification. The code downloads one "stable" version of kubectl but copies it to directories named The CVE claims in the comment are also overstated:
Either remove the unverified CVE claims or update the comment to reflect the actual conditions under which they apply. For the version-specific directory issue, if separate 1.30 and 1.31 binaries are genuinely needed, install each version explicitly: 🔧 Suggested fix for version-specific kubectl- # Install latest kubectl versions to fix CVE-2025-8959, CVE-2025-61729, and CVE-2025-22868
- # These vulnerabilities affect kubectl binaries built with vulnerable Go dependencies
- # Installing latest kubectl versions that were built with fixed Go 1.22.6+ and updated dependencies
- KUBECTL_VERSION=$(curl -L -s https://dl.k8s.io/release/stable.txt) && \
- mkdir -p /opt/kubectl/1.30 /opt/kubectl/1.31 && \
- curl -LO "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl" && \
- curl -LO "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl.sha256" && \
- echo "$(cat kubectl.sha256) kubectl" | sha256sum --check && \
- chmod +x kubectl && \
- cp kubectl /opt/kubectl/1.30/kubectl && \
- cp kubectl /opt/kubectl/1.31/kubectl && \
- cp kubectl /usr/local/bin/kubectl && \
- rm kubectl kubectl.sha256 && \
+ # Install version-specific kubectl binaries
+ mkdir -p /opt/kubectl/1.30 /opt/kubectl/1.31 && \
+ # Install kubectl 1.30 (latest patch)
+ KUBECTL_130=$(curl -L -s https://dl.k8s.io/release/stable-1.30.txt) && \
+ curl -LO "https://dl.k8s.io/release/${KUBECTL_130}/bin/linux/amd64/kubectl" && \
+ curl -LO "https://dl.k8s.io/release/${KUBECTL_130}/bin/linux/amd64/kubectl.sha256" && \
+ echo "$(cat kubectl.sha256) kubectl" | sha256sum --check && \
+ chmod +x kubectl && mv kubectl /opt/kubectl/1.30/kubectl && rm kubectl.sha256 && \
+ # Install kubectl 1.31 (latest patch)
+ KUBECTL_131=$(curl -L -s https://dl.k8s.io/release/stable-1.31.txt) && \
+ curl -LO "https://dl.k8s.io/release/${KUBECTL_131}/bin/linux/amd64/kubectl" && \
+ curl -LO "https://dl.k8s.io/release/${KUBECTL_131}/bin/linux/amd64/kubectl.sha256" && \
+ echo "$(cat kubectl.sha256) kubectl" | sha256sum --check && \
+ chmod +x kubectl && mv kubectl /opt/kubectl/1.31/kubectl && rm kubectl.sha256 && \
+ # Symlink default kubectl to 1.31
+ ln -s /opt/kubectl/1.31/kubectl /usr/local/bin/kubectl && \📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Upgrade pip to latest version to fix CVE-2024-35195 and CVE-2025-47273 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| python3 -m pip install --upgrade pip setuptools wheel --no-cache-dir && \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+60
to
+61
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🌐 Web query:
💡 Result: Summary
Affected versions
Impact
Mitigation and workarounds
References Would you like exact upgrade commands or a quick script to detect vulnerable requests versions across your environment? 🌐 Web query:
💡 Result: Summary — CVE-2025-47273
References Fix CVE attribution in the Dockerfile comment. CVE-2024-35195 is a Python Requests library vulnerability (TLS verification bypass), not a pip vulnerability. Upgrading pip does not address this CVE. CVE-2025-47273 is a legitimate setuptools vulnerability (path-traversal), so upgrading setuptools is appropriate, but the Dockerfile comment incorrectly attributes both CVEs to the pip upgrade. Revise the comment to either:
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Clean up | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| apt-get remove -y wget unzip curl && \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| apt-get autoremove -y && \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| apt-get clean && \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| rm -rf /var/lib/apt/lists/* | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| LABEL com.googleapis.cloudmarketplace.product.service.name=services/stackgen-enterprise-platform-k8s-v2.endpoints.stackgen-gcp-marketplace.cloud.goog | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Set timeout for Application readiness check (default is 300 seconds) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Increased to 600 seconds (10 minutes) to allow for longer deployment times | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ENV WAIT_FOR_READY_TIMEOUT=600 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Set timeout for the entire tester process (deploying, running tester pods, waiting for completion) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Increased to 900 seconds (15 minutes) to allow for longer deployment and testing times | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ENV TESTER_TIMEOUT=900 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Enable debug logging by default to help diagnose issues | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Set to "false" to disable verbose output and Terraform debug logs | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ENV DEBUG=true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
vishwajeetk1160 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Copy processed schema.yaml | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| COPY --from=build /workspace/schema.yaml /data/schema.yaml | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -51,4 +94,4 @@ RUN chmod +x /data/deploy.sh | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| COPY terraform/ /data/terraform/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Define entrypoint | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ENTRYPOINT ["/data/deploy.sh"] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ENTRYPOINT ["/data/deploy.sh"] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -4,18 +4,16 @@ MPDEV := $(BIN_DIR)/mpdev | |||||
| SCHEMA_FILE := marketplace/schema.yaml | ||||||
| MANIFEST_DIR := marketplace/manifests | ||||||
|
|
||||||
| # Semantic minor version (TRACK) and full release version | ||||||
| # TODO(sabith) read from tag | ||||||
| TRACK ?= 1.1 | ||||||
| RELEASE ?= ${TRACK}.0 | ||||||
| TRACK ?= 4.1 | ||||||
| RELEASE ?= ${TRACK}.2 | ||||||
|
|
||||||
| # Docker registry and image names | ||||||
| REGISTRY = gcr.io/stackgen-gcp-marketplace | ||||||
| APP_NAME = stackgen-deployer | ||||||
| DEPLOYER_IMAGE_RELEASE := $(REGISTRY)/$(APP_NAME)/deployer:$(RELEASE) | ||||||
| DEPLOYER_IMAGE_TRACK := $(REGISTRY)/$(APP_NAME)/deployer:$(TRACK) | ||||||
|
|
||||||
| .PHONY: all push setup doctor install verify validate clean help | ||||||
| .PHONY: all push setup doctor install install-crd verify validate clean help | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Declared phony targets The 🔧 Option 1: Remove undeclared targets from .PHONY-.PHONY: all push setup doctor install install-crd verify validate clean help
+.PHONY: all push setup doctor install verify clean helpAnd update the help text accordingly: @echo " verify - Verify an application using mpdev verify"
- @echo " validate - Validate the deployer schema.yaml file"
@echo " clean - Clean up local Docker images"🔧 Option 2: Add missing validate targetvalidate:
@echo "Validating schema file: $(SCHEMA_FILE)"
$(MPDEV) validate --schema=$(SCHEMA_FILE)📝 Committable suggestion
Suggested change
🧰 Tools🪛 checkmake (0.2.2)[warning] 16-16: Missing required phony target "test" (minphony) 🤖 Prompt for AI Agents |
||||||
|
|
||||||
| all: help | ||||||
|
|
||||||
|
|
@@ -52,7 +50,9 @@ install: | |||||
| $(MPDEV) install \ | ||||||
| --deployer=$(DEPLOYER_IMAGE_RELEASE) | ||||||
|
|
||||||
| verify: build | ||||||
|
|
||||||
|
|
||||||
| verify: | ||||||
| @echo "Verifying application with deployer: $(DEPLOYER_IMAGE_RELEASE)" | ||||||
| $(MPDEV) verify --deployer=$(DEPLOYER_IMAGE_RELEASE) | ||||||
|
|
||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,32 @@ | ||
| #!/bin/bash | ||
| set -e | ||
|
|
||
| # Enable debug mode if DEBUG environment variable is set | ||
| if [ "${DEBUG:-false}" = "true" ]; then | ||
| set -x | ||
| export TF_LOG=INFO | ||
| fi | ||
vishwajeetk1160 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| # Debug: Print script start time | ||
| echo "[INFO] Starting deployment at $(date)" | ||
| echo "[DEBUG] Working directory: $(pwd)" | ||
| echo "[DEBUG] Environment variables:" | ||
| echo " DEBUG=${DEBUG:-false}" | ||
| echo " WAIT_FOR_READY_TIMEOUT=${WAIT_FOR_READY_TIMEOUT:-300}" | ||
| echo " TESTER_TIMEOUT=${TESTER_TIMEOUT:-300}" | ||
| echo "[DEBUG] All environment variables containing TIMEOUT:" | ||
| env | grep -i timeout || echo " (none found)" | ||
| echo "[DEBUG] Process info:" | ||
| echo " PID: $$" | ||
| echo " Command: $0 $*" | ||
|
|
||
| VALUES_FILE="/data/values.yaml" | ||
| if [ ! -f "$VALUES_FILE" ]; then | ||
| echo "[ERROR] Values file not found: $VALUES_FILE" | ||
| ls -la /data/ || true | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Extract values from values.yaml using yq if environment variables are not already set | ||
| SUFFIX=${SUFFIX:-$(yq '.suffix' $VALUES_FILE)} | ||
| DOMAIN=${DOMAIN:-$(yq '.domain' $VALUES_FILE)} | ||
|
|
@@ -21,11 +44,20 @@ echo " GLOBAL_STATIC_IP_NAME: $GLOBAL_STATIC_IP_NAME" | |
|
|
||
| # Run Terraform | ||
| cd /data/terraform | ||
| echo "[DEBUG] Changed to Terraform directory: $(pwd)" | ||
| echo "[DEBUG] Terraform files present:" | ||
| ls -la || true | ||
|
|
||
| echo "[INFO] Initializing Terraform" | ||
| terraform init | ||
| terraform init -input=false | ||
|
|
||
| if [ $? -ne 0 ]; then | ||
| echo "[ERROR] Terraform initialization failed!" | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "[INFO] Applying Terraform configuration" | ||
| echo "[DEBUG] Terraform version: $(terraform version | head -1)" | ||
| terraform apply \ | ||
| -var "suffix=${SUFFIX}" \ | ||
| -var "domain=${DOMAIN}" \ | ||
|
|
@@ -34,9 +66,70 @@ terraform apply \ | |
| -var "global_static_ip_name=${GLOBAL_STATIC_IP_NAME}" \ | ||
| -auto-approve | ||
|
|
||
| if [ $? -eq 0 ]; then | ||
| echo "[INFO] Terraform apply complete!" | ||
| EXIT_CODE=$? | ||
| if [ $EXIT_CODE -eq 0 ]; then | ||
| echo "[INFO] Terraform apply complete at $(date)!" | ||
| echo "[INFO] Deployment completed successfully. Checking deployed resources..." | ||
|
|
||
| # Output pod statuses to stdout so they're captured in logs | ||
| # This helps diagnose why wait_for_ready.py might timeout | ||
| if command -v kubectl >/dev/null 2>&1; then | ||
| # Get namespace from service account if available | ||
| namespace="" | ||
| if [ -f /var/run/secrets/kubernetes.io/serviceaccount/namespace ]; then | ||
| namespace=$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace 2>/dev/null || echo "") | ||
| fi | ||
|
|
||
| echo "[INFO] ========== POST-DEPLOYMENT STATUS CHECK ==========" | ||
|
|
||
| # Check stackgen namespace pods | ||
| if kubectl get namespace stackgen >/dev/null 2>&1; then | ||
| echo "[INFO] --- Pods in stackgen namespace ---" | ||
| kubectl get pods -n stackgen -o wide 2>&1 | tee /dev/stderr || true | ||
|
|
||
| echo "[INFO] --- Pod status details ---" | ||
| for pod in $(kubectl get pods -n stackgen -o jsonpath='{.items[*].metadata.name}' 2>/dev/null || echo ""); do | ||
| if [ -n "$pod" ]; then | ||
| phase=$(kubectl get pod -n stackgen "$pod" -o jsonpath='{.status.phase}' 2>&1 || echo "Unknown") | ||
| ready=$(kubectl get pod -n stackgen "$pod" -o jsonpath='{.status.conditions[?(@.type=="Ready")].status}' 2>&1 || echo "Unknown") | ||
| echo "[INFO] Pod: $pod | Phase: $phase | Ready: $ready" | ||
|
|
||
| # If pod is not ready, show why | ||
| if [ "$ready" != "True" ] && [ "$phase" != "Running" ]; then | ||
| echo "[WARNING] Pod $pod is not ready. Showing details:" | ||
| kubectl describe pod -n stackgen "$pod" 2>&1 | grep -A 10 "Status:\|Events:" | tee /dev/stderr || true | ||
| echo "[WARNING] Last 30 lines of logs from $pod:" | ||
| kubectl logs -n stackgen "$pod" --tail=30 2>&1 | tee /dev/stderr || true | ||
| fi | ||
|
Comment on lines
+91
to
+103
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # First, check if the file exists and read the relevant lines
if [ -f "deployer-image/scripts/deploy.sh" ]; then
echo "File found. Reading lines 91-103:"
sed -n '91,103p' deployer-image/scripts/deploy.sh
else
echo "File not found at deployer-image/scripts/deploy.sh"
# Try to find it
find . -name "deploy.sh" -type f 2>/dev/null | head -20
fiRepository: appcd-dev/deployer Length of output: 1022 Change Proposed fix- if [ "$ready" != "True" ] && [ "$phase" != "Running" ]; then
+ if [ "$ready" != "True" ] || [ "$phase" != "Running" ]; then
echo "[WARNING] Pod $pod is not ready. Showing details:"
kubectl describe pod -n stackgen "$pod" 2>&1 | grep -A 10 "Status:\|Events:" | tee /dev/stderr || true
echo "[WARNING] Last 30 lines of logs from $pod:"
kubectl logs -n stackgen "$pod" --tail=30 2>&1 | tee /dev/stderr || true
fi🤖 Prompt for AI Agents |
||
| fi | ||
| done | ||
|
|
||
| # Show events | ||
| echo "[INFO] --- Recent events in stackgen namespace ---" | ||
| kubectl get events -n stackgen --sort-by='.lastTimestamp' 2>&1 | tail -20 | tee /dev/stderr || true | ||
| else | ||
| echo "[WARNING] stackgen namespace does not exist - this may indicate a deployment issue" | ||
| fi | ||
|
|
||
| # Show current namespace resources if available | ||
| if [ -n "$namespace" ]; then | ||
| echo "[INFO] --- Jobs in current namespace ($namespace) ---" | ||
| kubectl get jobs -n "$namespace" -o wide 2>&1 | tee /dev/stderr || true | ||
| fi | ||
|
|
||
| echo "[INFO] ========== END POST-DEPLOYMENT STATUS CHECK ==========" | ||
| else | ||
| echo "[WARNING] kubectl not available - skipping pod status check" | ||
| fi | ||
|
|
||
| echo "[INFO] Deployment script completed successfully at $(date)" | ||
| else | ||
| echo "[ERROR] Terraform apply failed!" | ||
| exit 1 | ||
| echo "[ERROR] ========== TERRAFORM APPLY FAILED ==========" | ||
| echo "[ERROR] Terraform apply failed with exit code $EXIT_CODE at $(date)!" | ||
| echo "[ERROR] Showing Terraform state for debugging:" | ||
| terraform show -no-color 2>&1 | tee /dev/stderr || true | ||
| echo "[ERROR] Showing Terraform plan output:" | ||
| terraform plan -detailed-exitcode -var "suffix=${SUFFIX}" -var "domain=${DOMAIN}" -var "STACKGEN_PAT=${STACKGEN_PAT}" -var "pre_shared_cert_name=${PRE_SHARED_CERT_NAME}" -var "global_static_ip_name=${GLOBAL_STATIC_IP_NAME}" 2>&1 | tee /dev/stderr || true | ||
| echo "[ERROR] ========== END ERROR OUTPUT ==========" | ||
| exit $EXIT_CODE | ||
| fi | ||
This file was deleted.
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is this file? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Answer: This is the zip of helm chart for appcd. |
Uh oh!
There was an error while loading. Please reload this page.