Skip to content

Commit

Permalink
Fix kubectl apply timeout with slow network
Browse files Browse the repository at this point in the history
Cloning https://github.com/stolostron/multicloud-operators-foundation.git
during `kubectl apply --kustomize` can fail with a timeout when using
slow network:

    $ kubectl apply -k test/addons/ocm-controller --context hub error: accumulating resources:
    accumulation err='accumulating resources from
    'https://github.com/stolostron/multicloud-operators-foundation.git/deploy/foundation/hub/overlays/ocm-controller?ref=main':
    URL is a git repository': hit 27s timeout running '/usr/bin/git fetch --depth=1
    https://github.com/stolostron/multicloud-operators-foundation.git main'

Turns out that the way to increase the timeout is to add a `timeout`
query parameter[1]. Use 300 seconds to avoid random failures when using
poor network.

[1] kubernetes-sigs/kustomize#3742

Signed-off-by: Nir Soffer <nsoffer@redhat.com>
  • Loading branch information
nirs committed Oct 4, 2023
1 parent 83a20bb commit 502ddf4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/addons/ocm-controller/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- https://github.com/stolostron/multicloud-operators-foundation.git/deploy/foundation/hub/overlays/ocm-controller?ref=main
# Default timeout (27 seconds) is too short for blr lab.
- https://github.com/stolostron/multicloud-operators-foundation.git/deploy/foundation/hub/overlays/ocm-controller?ref=main&timeout=300s
images:
- name: quay.io/stolostron/multicloud-manager
newTag: latest
Expand Down

0 comments on commit 502ddf4

Please sign in to comment.