Skip to content

Commit bdadf6a

Browse files
committed
install operator option added
1 parent 49871ce commit bdadf6a

File tree

4 files changed

+45
-12
lines changed

4 files changed

+45
-12
lines changed

prow/config/sail-operator/istio-cni.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: sailoperator.io/v1alpha1
1+
apiVersion: sailoperator.io/v1
22
kind: IstioCNI
33
metadata:
44
name: default

prow/integ-suite-ocp.sh

+11
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ SKIP_TESTS="${2:-""}"
2929
TEST_SUITE="${1:-"pilot"}"
3030
SKIP_SETUP="${SKIP_SETUP:-"false"}"
3131
INSTALL_METALLB="${INSTALL_METALLB:-"false"}"
32+
OPERATOR_NAMESPACE="${OPERATOR_NAMESPACE:-"sail-operator"}"
3233
CONTROL_PLANE_SOURCE="${CONTROL_PLANE_SOURCE:-"istio"}"
34+
INSTALL_SAIL_OPERATOR="${INSTALL_SAIL_OPERATOR:-"true"}"
3335
# Important: SKIP_TEST_RUN is a workaround until downstream tests can be executed by using this script.
3436
# To execute the tests in downstream, set SKIP_TEST_RUN to true
3537
# Jira: https://issues.redhat.com/browse/OSSM-8029
@@ -97,6 +99,15 @@ else
9799
echo "Skipping the setup"
98100
fi
99101

102+
# Install Sail Operator
103+
if [ "${INSTALL_SAIL_OPERATOR}" == "true" ]; then
104+
install_crds
105+
install_operator
106+
oc -n $OPERATOR_NAMESPACE wait --for=condition=Available deployment/sail-operator --timeout=60s
107+
#delete downloaded crd files
108+
rm -rf crds/
109+
fi
110+
100111
# Check if the test run should be skipped
101112
# This is a workaround until downstream tests can be executed by using this script.
102113
# Jira: https://issues.redhat.com/browse/OSSM-8029

prow/setup/ocp_setup.sh

+23
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ WD=$(dirname "$0")
3131
WD=$(cd "$WD"; pwd)
3232
TIMEOUT=300
3333
export NAMESPACE="${NAMESPACE:-"istio-system"}"
34+
OPERATOR_NAMESPACE="${OPERATOR_NAMESPACE:-"sail-operator"}"
3435

3536
function setup_internal_registry() {
3637
# Validate that the internal registry is running in the OCP Cluster, configure the variable to be used in the make target.
@@ -177,4 +178,26 @@ spec:
177178
timeout --foreground -v -s SIGHUP -k ${TIMEOUT} ${TIMEOUT} bash -c 'until oc get IPAddressPool default -n metallb-system; do sleep 5; done && echo "The IP address pool has been created."'
178179

179180
echo "MetalLB has been deployed and configured with the IP address pool."
181+
}
182+
183+
# Downloads and applies crds for sail-operator
184+
function install_crds(){
185+
oc create namespace "$OPERATOR_NAMESPACE" || true
186+
curl -L https://codeload.github.com/istio-ecosystem/sail-operator/tar.gz/main | \
187+
tar -xz --strip=2 sail-operator-main/chart/crds || { echo "Failed to download crds"; exit 1; }
188+
find "crds/" -type f -name "*.yaml" | while read -r file; do
189+
echo "Applying: $file"
190+
kubectl apply --server-side -n "$OPERATOR_NAMESPACE" -f "$file"
191+
done
192+
}
193+
194+
195+
# Installs sail operator with the version in Helm Chart in upstream.
196+
function install_operator(){
197+
helm repo add sail-operator https://istio-ecosystem.github.io/sail-operator
198+
helm repo update
199+
oc apply -f <(helm template sail-operator sail-operator/sail-operator \
200+
--namespace $OPERATOR_NAMESPACE \
201+
--set operatorLogLevel=3 \
202+
--set image="quay.io/sail-dev/sail-operator:$(curl -s https://raw.githubusercontent.com/istio-ecosystem/sail-operator/main/chart/Chart.yaml | grep 'version:' | sed 's/version: //' | cut -d'.' -f1,2)-latest")
180203
}

prow/setup/sail-operator-setup.sh

+10-11
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ WORKDIR="$2"
6060
IOP_FILE="$2"/iop.yaml
6161
SAIL_IOP_FILE="$(basename "${IOP_FILE%.yaml}")-sail.yaml"
6262

63-
ISTIO_VERSION="${ISTIO_VERSION:-latest}"
64-
INGRESS_GATEWAY_SVC_NAMESPACE="${INGRESS_GATEWAY_SVC_NAMESPACE:-istio-system}"
63+
ISTIO_VERSION="${ISTIO_VERSION:-v1.24.1}"
64+
NAMESPACE="${NAMESPACE:-istio-system}"
6565
ISTIOCNI_NAMESPACE="${ISTIOCNI_NAMESPACE:-istio-cni}"
6666

6767
ISTIOCNI="${PROW}/config/sail-operator/istio-cni.yaml"
@@ -75,7 +75,7 @@ function download_execute_converter(){
7575
cd "${PROW}"
7676
curl -fsSL "$CONVERTER_ADDRESS" -o "$CONVERTER_SCRIPT" || { echo "Failed to download converter script"; exit 1; }
7777
chmod +x "$CONVERTER_SCRIPT"
78-
bash "$CONVERTER_SCRIPT" "$IOP_FILE" -v "$ISTIO_VERSION" -n "$INGRESS_GATEWAY_SVC_NAMESPACE" || { echo "Failed to execute converter script"; exit 1; }
78+
bash "$CONVERTER_SCRIPT" "$IOP_FILE" -v "$ISTIO_VERSION" -n "$NAMESPACE" || { echo "Failed to execute converter script"; exit 1; }
7979
rm "$CONVERTER_SCRIPT"
8080
}
8181

@@ -94,28 +94,27 @@ function install_istiod(){
9494
if [ "${SAIL_API_VERSION:-}" != "" ]; then
9595
yq -i eval ".apiVersion = \"sailoperator.io/$SAIL_API_VERSION\"" "$WORKDIR/$SAIL_IOP_FILE"
9696
fi
97-
oc apply -f "$WORKDIR/$SAIL_IOP_FILE"
98-
oc wait --for=condition=Available=True deployment/istiod --timeout=30s
97+
oc apply -f "$WORKDIR/$SAIL_IOP_FILE" || { echo "Failed to install istiod"; exit 1; }
9998
echo "istiod created."
10099
}
101100

102101
# Install ingress and egress gateways
103102
function install_gateways(){
104-
helm template -n "$INGRESS_GATEWAY_SVC_NAMESPACE" istio-ingressgateway "${ROOT}"/manifests/charts/gateway --values "$INGRESS_GATEWAY_VALUES" > "${WORKDIR}"/istio-ingressgateway.yaml
103+
helm template -n "$NAMESPACE" istio-ingressgateway "${ROOT}"/manifests/charts/gateway --values "$INGRESS_GATEWAY_VALUES" > "${WORKDIR}"/istio-ingressgateway.yaml
105104
oc apply -f "${WORKDIR}"/istio-ingressgateway.yaml
106-
helm template -n "$INGRESS_GATEWAY_SVC_NAMESPACE" istio-egressgateway "${ROOT}"/manifests/charts/gateway --values "$EGRESS_GATEWAY_VALUES" > "${WORKDIR}"/istio-egressgateway.yaml
105+
helm template -n "$NAMESPACE" istio-egressgateway "${ROOT}"/manifests/charts/gateway --values "$EGRESS_GATEWAY_VALUES" > "${WORKDIR}"/istio-egressgateway.yaml
107106
oc apply -f "${WORKDIR}"/istio-egressgateway.yaml
108-
oc wait --for=condition=Available=True deployment/istio-ingressgateway --timeout=30s
109-
oc wait --for=condition=Available=True deployment/istio-egressgateway --timeout=30s
107+
oc -n "$NAMESPACE" wait --for=condition=Available deployment/istio-ingressgateway --timeout=30s
108+
oc -n "$NAMESPACE" wait --for=condition=Available deployment/istio-egressgateway --timeout=30s
110109
echo "Gateways created."
111110

112111
}
113112

114113
function cleanup_istio(){
115114
oc delete istio/default
116115
oc delete istioCNI/default
117-
oc delete all --selector app=istio-egressgateway -n "$INGRESS_GATEWAY_SVC_NAMESPACE"
118-
oc delete all --selector app=istio-ingressgateway -n "$INGRESS_GATEWAY_SVC_NAMESPACE"
116+
oc delete all --selector app=istio-egressgateway -n "$NAMESPACE"
117+
oc delete all --selector app=istio-ingressgateway -n "$NAMESPACE"
119118
echo "Cleanup completed."
120119
}
121120

0 commit comments

Comments
 (0)