Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkg/provisioner/templates/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,15 @@ with_retry 10 30s kubectl --kubeconfig $KUBECONFIG version
# Install Calico
# based on https://docs.tigera.io/calico/latest/getting-started/kubernetes/quickstart
echo "Installing Calico ${CALICO_VERSION}..."
with_retry 3 10s kubectl --kubeconfig $KUBECONFIG create -f https://raw.githubusercontent.com/projectcalico/calico/${CALICO_VERSION}/manifests/tigera-operator.yaml
with_retry 3 10s kubectl get installation default -n tigera-operator || kubectl --kubeconfig $KUBECONFIG create -f https://raw.githubusercontent.com/projectcalico/calico/${CALICO_VERSION}/manifests/tigera-operator.yaml
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. The kubectl calls should be consistent. Here you have one kubectl call using the --kubeconfig and the other without the flag
  2. Moreover, the kubectl get installation call seems unnecessary here. The creation of the installation custom resource does not happen until L138, so this change should be reverted. It is unncessary here


# Wait for Tigera operator to be ready
echo "Waiting for Tigera operator to be ready..."
with_retry 10 30s kubectl --kubeconfig $KUBECONFIG wait --for=condition=available --timeout=300s deployment/tigera-operator -n tigera-operator

# Install Calico custom resources
echo "Installing Calico custom resources..."
with_retry 3 10s kubectl --kubeconfig $KUBECONFIG create -f https://raw.githubusercontent.com/projectcalico/calico/${CALICO_VERSION}/manifests/custom-resources.yaml
with_retry 3 10s kubectl get installation default -n tigera-operator || kubectl --kubeconfig $KUBECONFIG create -f https://raw.githubusercontent.com/projectcalico/calico/${CALICO_VERSION}/manifests/custom-resources.yaml
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. The kubectl calls should be consistent. Here you have one kubectl call using the --kubeconfig and the other without the flag

  2. Also, it is always better to use the FQDN of a custom resource when referencing it in automation scripts

Suggested change
with_retry 3 10s kubectl get installation default -n tigera-operator || kubectl --kubeconfig $KUBECONFIG create -f https://raw.githubusercontent.com/projectcalico/calico/${CALICO_VERSION}/manifests/custom-resources.yaml
with_retry 3 10s kubectl get installations.operator.tigera.io default -n tigera-operator || kubectl --kubeconfig $KUBECONFIG create -f https://raw.githubusercontent.com/projectcalico/calico/${CALICO_VERSION}/manifests/custom-resources.yaml

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

opened new PR and testing @tariq1890 @ArangoGutierrez
#499


# Wait for Calico to be ready
echo "Waiting for Calico to be ready..."
Expand Down
Loading