Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ spec:

if ! [[ $reserved_ip =~ $re ]]; then
echo "Reserved ip [$reserved_ip] is incorrect, failed to create a reserved ip"
exit 1
fi

reserved_ip2=$(curl -s --request POST \
Expand All @@ -42,6 +43,7 @@ spec:

if ! [[ $reserved_ip2 =~ $re ]]; then
echo "Reserved ip [$reserved_ip2] is incorrect, failed to create a reserved ip"
exit 1
fi

create_cm=$(kubectl -n $NAMESPACE create configmap reserved-ip-config --from-literal=ReservedIP=$reserved_ip --from-literal=ReservedIP2=$reserved_ip2 -o yaml --dry-run=client | kubectl apply -f -)
Expand Down Expand Up @@ -75,11 +77,13 @@ spec:
reserved_ip=$(kubectl get configmap reserved-ip-config -o=jsonpath='{.data.ReservedIP}' -n $NAMESPACE)
if [ -z "$reserved_ip" ]; then
echo "Error: No reserved ip found in configmap"
exit 1
fi

reserved_ip2=$(kubectl get configmap reserved-ip-config -o=jsonpath='{.data.ReservedIP2}' -n $NAMESPACE)
if [ -z "$reserved_ip2" ]; then
echo "Error: No reserved ip found in configmap"
exit 1
fi

delete_rip=$(curl -s --request DELETE \
Expand All @@ -101,7 +105,7 @@ spec:
if [[ "$delete_rip2" == "{}" ]]; then
echo "Reserved IP $reserved_ip2 deleted successfully"
else
echo "Unable to delete reserved ip: $reserved_ip. Error: $delete_rip2"
echo "Unable to delete reserved ip: $reserved_ip2. Error: $delete_rip2"
fi

delete_cm=$(kubectl delete configmap reserved-ip-config -n $NAMESPACE)
Expand Down Expand Up @@ -142,11 +146,13 @@ spec:
reserved_ip=$(kubectl get configmap reserved-ip-config -o=jsonpath='{.data.ReservedIP}' -n $NAMESPACE)
if [ -z "$reserved_ip" ]; then
echo "Error: No reserved ip found in configmap"
exit 1
fi

reserved_ip2=$(kubectl get configmap reserved-ip-config -o=jsonpath='{.data.ReservedIP2}' -n $NAMESPACE)
if [ -z "$reserved_ip2" ]; then
echo "Error: No reserved ip found in configmap"
exit 1
fi

parallel -j 2 patch_annotation ::: $reserved_ip2 "100.10.10.10"
Expand Down Expand Up @@ -187,16 +193,19 @@ spec:
reserved_ip=$(kubectl get configmap reserved-ip-config -o=jsonpath='{.data.ReservedIP}' -n $NAMESPACE)
if [ -z "$reserved_ip" ]; then
echo "Error: No reserved ip found in configmap"
exit 1
fi

reserved_ip2=$(kubectl get configmap reserved-ip-config -o=jsonpath='{.data.ReservedIP2}' -n $NAMESPACE)
if [ -z "$reserved_ip2" ]; then
echo "Error: No reserved ip found in configmap"
exit 1
fi

service_ip=$(kubectl get svc svc-test -n $NAMESPACE -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
if [ -z "$service_ip" ]; then
echo "Error: No service ip found for service svc-test"
exit 1
fi
echo "{\"service_ip\": $service_ip}"
echo "{\"reserved_ip\": $reserved_ip}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ spec:

if ! [[ $reserved_ip =~ $re ]]; then
echo "Reserved ip [$reserved_ip] is incorrect, failed to create a reserved ip"
exit 1
fi

reserved_ip2=$(curl -s --request POST \
Expand All @@ -42,6 +43,7 @@ spec:

if ! [[ $reserved_ip2 =~ $re ]]; then
echo "Reserved ip [$reserved_ip2] is incorrect, failed to create a reserved ip"
exit 1
fi

create_cm=$(kubectl -n $NAMESPACE create configmap reserved-ip-config --from-literal=ReservedIP=$reserved_ip --from-literal=ReservedIP2=$reserved_ip2 -o yaml --dry-run=client | kubectl apply -f -)
Expand Down Expand Up @@ -76,11 +78,13 @@ spec:
reserved_ip=$(kubectl get configmap reserved-ip-config -o=jsonpath='{.data.ReservedIP}' -n $NAMESPACE)
if [ -z "$reserved_ip" ]; then
echo "Error: No reserved ip found in configmap"
exit 1
fi

reserved_ip2=$(kubectl get configmap reserved-ip-config -o=jsonpath='{.data.ReservedIP2}' -n $NAMESPACE)
if [ -z "$reserved_ip2" ]; then
echo "Error: No reserved ip found in configmap"
exit 1
fi

delete_rip=$(curl -s --request DELETE \
Expand All @@ -102,7 +106,7 @@ spec:
if [[ "$delete_rip2" == "{}" ]]; then
echo "Reserved IP $reserved_ip2 deleted successfully"
else
echo "Unable to delete reserved ip: $reserved_ip. Error: $delete_rip2"
echo "Unable to delete reserved ip: $reserved_ip2. Error: $delete_rip2"
fi

delete_cm=$(kubectl delete configmap reserved-ip-config -n $NAMESPACE)
Expand Down Expand Up @@ -221,4 +225,4 @@ spec:
($error == null): true
(contains($stdout, 'No reserved ip found in configmap')): false
(contains($stdout, 'No service ip found for service svc-test')): false
(contains($stdout, 'IPs do not match')): false
(contains($stdout, 'IPs do not match')): false
2 changes: 1 addition & 1 deletion e2e/test/lb-update-port/chainsaw-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ spec:

podnames=()

for i in {1..10}; do
for i in {1..20}; do
if [[ ${#podnames[@]} -lt 2 ]]; then
output=$(curl -s $IP:8080 | jq -e .podName || true)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,23 @@ spec:

nbid=$(KUBECONFIG=$KUBECONFIG NAMESPACE=$NAMESPACE LINODE_TOKEN=$LINODE_TOKEN ../scripts/get-nb-id.sh)

nbconfig=$(curl -s \
-H "Authorization: Bearer $LINODE_TOKEN" \
-H "Content-Type: application/json" \
"$LINODE_URL/v4/nodebalancers/$nbid/configs")
for i in {1..20}; do
nbconfig=$(curl -s \
-H "Authorization: Bearer $LINODE_TOKEN" \
-H "Content-Type: application/json" \
"$LINODE_URL/v4/nodebalancers/$nbid/configs")

port_80_v2=$(echo $nbconfig | jq -r '.data[] | select(.port == 80) | .proxy_protocol == "v2"')
port_8080_v2=$(echo $nbconfig | jq -r '.data[] | select(.port == 8080) | .proxy_protocol == "v2"')
port_80_v2=$(echo $nbconfig | jq -r '.data[] | select(.port == 80) | .proxy_protocol == "v2"')
port_8080_v2=$(echo $nbconfig | jq -r '.data[] | select(.port == 8080) | .proxy_protocol == "v2"')

if [[ $port_80_v2 == "true" && $port_8080_v2 == "true" ]]; then
echo "Conditions met"
else
echo "Conditions not met"
fi
if [[ $port_80_v2 == "true" && $port_8080_v2 == "true" ]]; then
echo "Conditions met"
break
else
echo "Conditions not met"
sleep 10
fi
done
check:
($error): ~
(contains($stdout, 'Conditions met')): true
Expand Down
Loading