Skip to content

Commit

Permalink
Merge pull request #1991 from ktock/fix-argoci
Browse files Browse the repository at this point in the history
CI: fix K3sArgoWorkflow failure
  • Loading branch information
AkihiroSuda authored Feb 26, 2025
2 parents 0bbee9a + e0dbe54 commit f75681d
Showing 1 changed file with 29 additions and 2 deletions.
31 changes: 29 additions & 2 deletions script/k3s-argo-workflow/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ REPO="${CONTEXT}../../"
K3S_VERSION=master
K3S_REPO=https://github.com/k3s-io/k3s
K3S_CONTAINERD_REPO=https://github.com/k3s-io/containerd
ARGO_VERSION=v3.6.4

K3S_NODE_REPO=ghcr.io/stargz-containers
K3S_NODE_IMAGE_NAME=k3s
Expand Down Expand Up @@ -86,7 +87,33 @@ function run {
--k3s-arg='--snapshotter='"${SNAPSHOTTER}"'@server:*;agent:*'
kubectl create ns argo
kubectl apply -n argo -f "${CUSTOM_ARGOYAML}"

# workaround for argo failing to list namespaces
cat <<EOF | kubectl -n argo apply -f -
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: argo-namespace-access-cr
rules:
- apiGroups:
- ""
resources:
- namespaces
verbs:
- list
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: argo-namespace-access-crb
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: argo-namespace-access-cr
subjects:
- kind: ServiceAccount
name: argo
namespace: argo
EOF
# Wait for the cluster is ready
local RETRYNUM=30
local RETRYINTERVAL=1
Expand Down Expand Up @@ -122,7 +149,7 @@ if [ "${RESULT_FILE}" == "" ] ; then
fi
echo "result to ${RESULT_FILE}"

wget -O "${ORG_ARGOYAML}" https://raw.githubusercontent.com/argoproj/argo-workflows/v3.4.3/manifests/quick-start-minimal.yaml
wget -O "${ORG_ARGOYAML}" https://raw.githubusercontent.com/argoproj/argo-workflows/${ARGO_VERSION}/manifests/quick-start-minimal.yaml

git clone -b ${K3S_VERSION} --depth 1 "${K3S_REPO}" "${TMP_K3S_REPO}"
sed -i "s|github.com/k3s-io/stargz-snapshotter .*$|$(realpath ${REPO})|g" "${TMP_K3S_REPO}/go.mod"
Expand Down

0 comments on commit f75681d

Please sign in to comment.