Skip to content

Commit f8fa93d

Browse files
authored
Mount config and deployments dirs to smoke containers (nginx#5740)
1 parent 5c8e549 commit f8fa93d

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

.github/actions/smoke-tests/action.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ runs:
6262
--name test-runner-${{ github.run_id }} \
6363
--network=kind \
6464
-v ${{ github.workspace }}/tests:/workspace/tests \
65+
-v ${{ github.workspace }}/deployments:/workspace/deployments \
66+
-v ${{ github.workspace }}/config:/workspace/config \
6567
-v ~/.kube/kind/config:/root/.kube/config ${{ inputs.test-image }} \
6668
--context=kind-${{ github.run_id }} \
6769
--image=${{ inputs.image-name }}:${{ inputs.tag }} \

internal/k8s/controller.go

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -944,15 +944,18 @@ func (lbc *LoadBalancerController) updateNumberOfIngressControllerReplicas(contr
944944
}
945945

946946
// handle virtualservers
947-
resources = lbc.findVirtualServersUsingRatelimitScaling()
948-
resourceExes = lbc.createExtendedResources(resources)
949-
for _, vserver := range resourceExes.VirtualServerExes {
950-
found = true
951-
_, err := lbc.configurator.AddOrUpdateVirtualServer(vserver)
952-
if err != nil {
953-
glog.Errorf("Error updating ratelimit for VirtualServer %s/%s: %s", vserver.VirtualServer.Namespace, vserver.VirtualServer.Name, err)
947+
if lbc.areCustomResourcesEnabled {
948+
resources = lbc.findVirtualServersUsingRatelimitScaling()
949+
resourceExes = lbc.createExtendedResources(resources)
950+
for _, vserver := range resourceExes.VirtualServerExes {
951+
found = true
952+
_, err := lbc.configurator.AddOrUpdateVirtualServer(vserver)
953+
if err != nil {
954+
glog.Errorf("Error updating ratelimit for VirtualServer %s/%s: %s", vserver.VirtualServer.Namespace, vserver.VirtualServer.Name, err)
955+
}
954956
}
955957
}
958+
956959
}
957960
return found
958961
}

tests/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ run-tests-in-kind: ## Run tests in Kind
5555
docker run --network=kind --rm \
5656
-v $(KIND_KUBE_CONFIG_FOLDER):/root/.kube \
5757
-v $(ROOT_DIR)/tests:/workspace/tests \
58+
-v $(ROOT_DIR)/deployments:/workspace/deployments \
59+
-v $(ROOT_DIR)/config:/workspace/config \
5860
$(TEST_PREFIX):$(TEST_TAG) \
5961
--context=kind-$(strip $(K8S_CLUSTER_NAME)) \
6062
--image=$(BUILD_IMAGE) --image-pull-policy=$(PULL_POLICY) \

0 commit comments

Comments
 (0)