Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI scripts improvements #523

Merged
merged 1 commit into from
Oct 22, 2023
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
12 changes: 12 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,12 @@ jobs:
name: k8s-artifact
path: ./k8s-artifacts

- name: remove virtual cluster
if: always()
run: |
kcli delete cluster $CLUSTER_NAME -y
kcli delete network $CLUSTER_NAME -y

virtual-ocp:
name: ocp
needs: [
Expand All @@ -145,3 +151,9 @@ jobs:
with:
name: ocp-artifact
path: ./ocp-artifacts

- name: remove virtual cluster
if: always()
run: |
kcli delete cluster $CLUSTER_NAME -y
kcli delete network $CLUSTER_NAME -y
bn222 marked this conversation as resolved.
Show resolved Hide resolved
5 changes: 4 additions & 1 deletion hack/run-e2e-conformance-virtual-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ controller_ip=`kubectl get node -o wide | grep ctlp | awk '{print $6}'`
insecure_registry="[[registry]]
location = \"$controller_ip:5000\"
insecure = true

[aliases]
\"golang\" = \"docker.io/library/golang\"
adrianchiris marked this conversation as resolved.
Show resolved Hide resolved
"

cat << EOF > /etc/containers/registries.conf.d/003-${cluster_name}.conf
Expand Down Expand Up @@ -223,7 +226,7 @@ spec:
- effect: NoSchedule
key: node-role.kubernetes.io/control-plane
containers:
- image: docker.io/registry:latest
- image: quay.io/libpod/registry:2.8.2
imagePullPolicy: Always
name: registry
volumeMounts:
Expand Down
10 changes: 7 additions & 3 deletions hack/run-e2e-conformance-virtual-ocp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ kcli create network -c 192.168.123.0/24 ocp
kcli create network -c 192.168.${virtual_router_id}.0/24 --nodhcp -i $cluster_name

cat <<EOF > ./${cluster_name}-plan.yaml
tag: 4.14.0-rc.1
ctlplane_memory: 24576
tag: 4.14.0-rc.6
adrianchiris marked this conversation as resolved.
Show resolved Hide resolved
ctlplane_memory: 32768
worker_memory: 8192
pool: default
disk_size: 50
Expand Down Expand Up @@ -191,13 +191,17 @@ podman build -t "${SRIOV_NETWORK_CONFIG_DAEMON_IMAGE}" -f "${root}/Dockerfile.sr
echo "## build webhook image"
podman build -t "${SRIOV_NETWORK_WEBHOOK_IMAGE}" -f "${root}/Dockerfile.webhook" "${root}"

echo "## wait for registry to be available"
kubectl wait configs.imageregistry.operator.openshift.io/cluster --for=condition=Available --timeout=120s

dockercgf=`kubectl -n ${NAMESPACE} get sa builder -oyaml | grep imagePullSecrets -A 1 | grep -o "builder-.*"`
auth=`kubectl -n ${NAMESPACE} get secret ${dockercgf} -ojson | jq '.data.".dockercfg"'`
auth="${auth:1:-1}"
auth=`echo ${auth} | base64 -d`
echo ${auth} > registry-login.conf

pass=$( jq .\"$registry\".password registry-login.conf )
internal_registry="image-registry.openshift-image-registry.svc:5000"
pass=$( jq .\"$internal_registry\".password registry-login.conf )
podman login -u serviceaccount -p ${pass:1:-1} $registry --tls-verify=false

podman push --tls-verify=false "${SRIOV_NETWORK_OPERATOR_IMAGE}"
Expand Down
15 changes: 9 additions & 6 deletions test/conformance/tests/test_sriov_operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,9 @@ var _ = Describe("[sriov] operator", func() {
cfg.Spec.ConfigDaemonNodeSelector = map[string]string{
"sriovenabled": "true",
}
err = clients.Update(context.TODO(), &cfg)
Expect(err).ToNot(HaveOccurred())
Eventually(func() error {
return clients.Update(context.TODO(), &cfg)
}, 1*time.Minute, 5*time.Second).ShouldNot(HaveOccurred())

By("Checking that a daemon is scheduled only on selected node")
Eventually(func() bool {
Expand All @@ -159,8 +160,9 @@ var _ = Describe("[sriov] operator", func() {
}, &cfg)
Expect(err).ToNot(HaveOccurred())
cfg.Spec.ConfigDaemonNodeSelector = map[string]string{}
err = clients.Update(context.TODO(), &cfg)
Expect(err).ToNot(HaveOccurred())
Eventually(func() error {
return clients.Update(context.TODO(), &cfg)
}, 1*time.Minute, 5*time.Second).ShouldNot(HaveOccurred())

By("Checking that a daemon is scheduled on each worker node")
Eventually(func() bool {
Expand Down Expand Up @@ -2316,8 +2318,9 @@ func createVanillaNetworkPolicy(node string, sriovInfos *cluster.EnabledNodes, n
DeviceType: "netdevice",
},
}
err = clients.Create(context.Background(), config)
Expect(err).ToNot(HaveOccurred())
Eventually(func() error {
return clients.Create(context.Background(), config)
}, 1*time.Minute, 5*time.Second).ShouldNot(HaveOccurred())

Eventually(func() sriovv1.Interfaces {
nodeState, err := clients.SriovNetworkNodeStates(operatorNamespace).Get(context.Background(), node, metav1.GetOptions{})
Expand Down
Loading