Skip to content

Commit

Permalink
hotfix: remove duplicate replicaset from k3d log collection
Browse files Browse the repository at this point in the history
  • Loading branch information
ppxl committed Jan 13, 2023
1 parent a57645a commit 151d4d8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
1 change: 0 additions & 1 deletion src/com/cloudogu/ces/cesbuildlib/K3d.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,6 @@ data:
"pod",
"configmap",
"persistentvolume",
"replicaset",
"ingress",
"ingressclass"
]
Expand Down
12 changes: 3 additions & 9 deletions test/com/cloudogu/ces/cesbuildlib/K3dTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ spec:
def scriptMock = new ScriptMock()
K3d sut = new K3d(scriptMock, workspaceDir, k3dWorkspaceDir, "path")

def relevantResources = ["persistentvolumeclaim","statefulset","replicaset","deployment","service","secret","pod","configmap","persistentvolume","replicaset","ingress","ingressclass"]
def relevantResources = ["persistentvolumeclaim","statefulset","replicaset","deployment","service","secret","pod","configmap","persistentvolume","ingress","ingressclass"]
for(def resource : relevantResources) {
scriptMock.expectedShRetValueForScript.put("sudo KUBECONFIG=leK3dWorkSpace/.k3d/.kube/config kubectl get ${resource} --show-kind --ignore-not-found -l app=ces -o yaml || true".toString(), "value for ${resource}")
scriptMock.expectedShRetValueForScript.put("sudo KUBECONFIG=leK3dWorkSpace/.k3d/.kube/config kubectl describe ${resource} -l app=ces || true".toString(), "value for ${resource}")
Expand Down Expand Up @@ -411,12 +411,6 @@ spec:
assertThat(scriptMock.allActualArgs[i++].trim()).contains("sudo KUBECONFIG=leK3dWorkSpace/.k3d/.kube/config kubectl describe persistentvolume -l app=ces || true")
assertThat(scriptMock.writeFileParams[fileCounter++]).isEqualTo(["file": "persistentvolume_description.yaml", "text": "value for persistentvolume"])

assertThat(scriptMock.allActualArgs[i++].trim()).contains("sudo KUBECONFIG=leK3dWorkSpace/.k3d/.kube/config kubectl get replicaset --show-kind --ignore-not-found -l app=ces -o yaml || true")
assertThat(scriptMock.writeFileParams[fileCounter++]).isEqualTo(["file": "replicaset.yaml", "text": "value for replicaset"])

assertThat(scriptMock.allActualArgs[i++].trim()).contains("sudo KUBECONFIG=leK3dWorkSpace/.k3d/.kube/config kubectl describe replicaset -l app=ces || true")
assertThat(scriptMock.writeFileParams[fileCounter++]).isEqualTo(["file": "replicaset_description.yaml", "text": "value for replicaset"])

assertThat(scriptMock.allActualArgs[i++].trim()).contains("sudo KUBECONFIG=leK3dWorkSpace/.k3d/.kube/config kubectl get ingress --show-kind --ignore-not-found -l app=ces -o yaml || true")
assertThat(scriptMock.writeFileParams[fileCounter++]).isEqualTo(["file": "ingress.yaml", "text": "value for ingress"])

Expand Down Expand Up @@ -445,8 +439,8 @@ spec:
assertThat(scriptMock.archivedArtifacts[0]).isEqualTo(["allowEmptyArchive":"true", "artifacts":"k8sLogs.zip"])

assertThat(scriptMock.allActualArgs.size()).isEqualTo(i)
assertThat(scriptMock.writeFileParams.size()).isEqualTo(27)
assertThat(fileCounter).isEqualTo(27)
assertThat(scriptMock.writeFileParams.size()).isEqualTo(25)
assertThat(fileCounter).isEqualTo(25)
}

void testK3d_applyDoguResource() {
Expand Down

0 comments on commit 151d4d8

Please sign in to comment.