jenkinsci / jenkinsci/google-kubernetes-engine-plugin
Deploy verification prints out too much on each iteration of checking
- Dominant language
- Java
- Stars
- 36
- Forks
- 65
- PR merge metrics
- No merged PRs in 30d
Description
The full deployment JSON is being printed out during deployment validation. We should remove this and only add it back when we have a way to enable "debug" mode or log levels for this step.
Example log snippet here (it is 100x longer than this):
```
Cloning the remote Git repository
Cloning repository https://github.com/viglesiasce/sample-app
> git init /home/jenkins/workspace/gke-plugin-pipeline # timeout=10
Fetching upstream changes from https://github.com/viglesiasce/sample-app
> git --version # timeout=10
> git fetch --tags --force --progress https://github.com/viglesiasce/sample-app +refs/heads/*:refs/remotes/origin/* # timeout=10
Checking out Revision 8834988fcdc3d6878b5ca6a4fcee4688da7c7597 (refs/remotes/origin/master)
Commit message: "Simplify Jenkinsfile"
[Pipeline] container
> git config remote.origin.url https://github.com/viglesiasce/sample-app # timeout=10
> git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
> git config remote.origin.url https://github.com/viglesiasce/sample-app # timeout=10
Fetching upstream changes from https://github.com/viglesiasce/sample-app
> git fetch --tags --force --progress https://github.com/viglesiasce/sample-app +refs/heads/*:refs/remotes/origin/* # timeout=10
> git rev-parse refs/remotes/origin/master^{commit} # timeout=10
> git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
> git config core.sparsecheckout # timeout=10
> git checkout -f 8834988fcdc3d6878b5ca6a4fcee4688da7c7597 # timeout=10
> git branch -a -v --no-abbrev # timeout=10
> git checkout -b master 8834988fcdc3d6878b5ca6a4fcee4688da7c7597 # timeout=10
> git rev-list --no-walk 8834988fcdc3d6878b5ca6a4fcee4688da7c7597 # timeout=10
[Pipeline] {
[Pipeline] step
Executing shell script inside container [kubectl] of pod [default-jgrpt]
Executing command: "kubectl" "--kubeconfig" "/home/jenkins/workspace/gke-plugin-pipeline/.kube1437773298307485887config" "config" "use-context" "gke_vic-goog_us-west2-a_battleground"
exit
Switched to context "gke_vic-goog_us-west2-a_battleground".
Executing shell script inside container [kubectl] of pod [default-jgrpt]
Executing command: "kubectl" "--kubeconfig" "/home/jenkins/workspace/gke-plugin-pipeline/.kube1437773298307485887config" "get" "--namespace" "default" "namespace" "default" "-o" "json"
exit
{
"apiVersion": "v1",
"kind": "Namespace",
"metadata": {
"creationTimestamp": "2019-04-30T20:25:39Z",
"name": "default",
"resourceVersion": "27",
"selfLink": "/api/v1/namespaces/default",
"uid": "1ed7993b-6b86-11e9-9d9c-42010aa80079"
},
"spec": {
"finalizers": [
"kubernetes"
]
},
"status": {
"phase": "Active"
}
}
Executing shell script inside container [kubectl] of pod [default-jgrpt]
Executing command: "kubectl" "--kubeconfig" "/home/jenkins/workspace/gke-plugin-pipeline/.kube8595372679533270474config" "config" "use-context" "gke_vic-goog_us-west2-a_battleground"
exit
Switched to context "gke_vic-goog_us-west2-a_battleground".
Executing shell script inside container [kubectl] of pod [default-jgrpt]
Executing command: "kubectl" "--kubeconfig" "/home/jenkins/workspace/gke-plugin-pipeline/.kube8595372679533270474config" "apply" "--namespace" "default" "-f" "/home/jenkins/workspace/gke-plugin-pipeline/k8s/staging"
exit
deployment.extensions/gceme-backend-staging created
deployment.extensions/gceme-frontend-staging created
Verifying manifests: /home/jenkins/workspace/gke-plugin-pipeline/k8s/staging
Verifying 2 objects:
Verifying: extensions/v1beta1/Deployment: gceme-backend-staging
Executing shell script inside container [kubectl] of pod [default-jgrpt]
Executing command: "kubectl" "--kubeconfig" "/home/jenkins/workspace/gke-plugin-pipeline/.kube5019519250675376435config" "config" "use-context" "gke_vic-goog_us-west2-a_battleground"
exit
Switched to context "gke_vic-goog_us-west2-a_battleground".
Executing shell script inside container [kubectl] of pod [default-jgrpt]
Executing command: "kubectl" "--kubeconfig" "/home/jenkins/workspace/gke-plugin-pipeline/.kube5019519250675376435config" "get" "--namespace" "default" "deployment" "gceme-backend-staging" "-o" "json"
exit
{
"apiVersion": "extensions/v1beta1",
"kind": "Deployment",
"metadata": {
"annotations": {
"deployment.kubernetes.io/revision": "1",
"kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"extensions/v1beta1\",\"kind\":\"Deployment\",\"metadata\":{\"annotations\":{},\"labels\":{\"app.kubernetes.io/managed-by\":\"graphite-jenkins-gke\"},\"name\":\"gceme-backend-staging\",\"namespace\":\"default\"},\"spec\":{\"replicas\":1,\"template\":{\"metadata\":{\"labels\":{\"app\":\"gceme\",\"env\":\"staging\",\"role\":\"backend\"},\"name\":\"backend\"},\"spec\":{\"containers\":[{\"command\":[\"sh\",\"-c\",\"app -port=8080\"],\"image\":\"gcr.io/cloud-solutions-images/gceme:1.0.0\",\"imagePullPolicy\":\"Always\",\"name\":\"backend\",\"ports\":[{\"containerPort\":8080,\"name\":\"backend\"}],\"readinessProbe\":{\"httpGet\":{\"path\":\"/healthz\",\"port\":8080}},\"resources\":{\"limits\":{\"cpu\":\"100m\",\"memory\":\"500Mi\"}}}]}}}}\n"
},
"creationTimestamp": "2019-05-03T21:10:40Z",
"generation": 1,
"labels": {
"app.kubernetes.io/managed-by": "graphite-jenkins-gke"
},
"name": "gceme-backend-staging",
"namespace": "default",
"resourceVersion": "769147",
"selfLink": "/apis/extensions/v1beta1/namespaces/default/deployments/gceme-backend-staging",
"uid": "e7a7cbc4-6de7-11e9-9a1a-42010aa8002d"
},
"spec": {
"progressDeadlineSeconds": 2147483647,
"replicas": 1,
"revisionHistoryLimit": 10,
"selector": {
"matchLabels": {
"app": "gceme",
"env": "staging",
"role": "backend"
}
},
"strategy": {
"rollingUpdate": {
"maxSurge": 1,
"maxUnavailable": 1
},
"type": "RollingUpdate"
},
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"app": "gceme",
"env": "staging",
"role": "backend"
},
"name": "backend"
},
"spec": {
"containers": [
{
"command": [
"sh",
"-c",
"app -port=8080"
],
"image": "gcr.io/cloud-solutions-images/gceme:1.0.0",
"imagePullPolicy": "Always",
"name": "backend",
"ports": [
{
"containerPort": 8080,
"name": "backend",
"protocol": "TCP"
}
],
"readinessProbe": {
"failureThreshold": 3,
"httpGet": {
"path": "/healthz",
"port": 8080,
"scheme": "HTTP"
},
"periodSeconds": 10,
"successThreshold": 1,
"timeoutSeconds": 1
},
"resources": {
"limits": {
"cpu": "100m",
"memory": "500Mi"
}
},
"terminationMessagePath": "/dev/termination-log",
"terminationMessagePolicy": "File"
}
],
"dnsPolicy": "ClusterFirst",
"restartPolicy": "Always",
"schedulerName": "default-scheduler",
"securityContext": {},
"terminationGracePeriodSeconds": 30
}
}
},
"status": {
"conditions": [
{
"lastTransitionTime": "2019-05-03T21:10:40Z",
"lastUpdateTime": "2019-05-03T21:10:40Z",
"message": "Deployment has minimum availability.",
"reason": "MinimumReplicasAvailable",
"status": "True",
"type": "Available"
}
],
"observedGeneration": 1,
"replicas": 1,
"unavailableReplicas": 1,
"updatedReplicas": 1
}
}
Verifying: extensions/v1beta1/Deployment: gceme-frontend-staging
Executing shell script inside container [kubectl] of pod [default-jgrpt]
Executing command: "kubectl" "--kubeconfig" "/home/jenkins/workspace/gke-plugin-pipeline/.kube4621200451206075642config" "config" "use-context" "gke_vic-goog_us-west2-a_battleground"
exit
Switched to context "gke_vic-goog_us-west2-a_battleground".
Executing shell script inside container [kubectl] of pod [default-jgrpt]
Executing command: "kubectl" "--kubeconfig" "/home/jenkins/workspace/gke-plugin-pipeline/.kube4621200451206075642config" "get" "--namespace" "default" "deployment" "gceme-frontend-staging" "-o" "json"
exit
```
Contributor guide
Research direction
Search the Java sources for deployment validation or verification and identify the logging path that emits the fetched deployment JSON. Reproduce a validation run to confirm the excessive output, then verify that normal output no longer includes the full JSON while the verification result still appears; run any related tests found near that code.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- google-cloud, java, kubernetes
- Domain
- cloud, devops
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100