This is an automated email from the ASF dual-hosted git repository.
d4rkstar pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/openserverless-operator.git
The following commit(s) were added to refs/heads/main by this push:
new 95eef44 0.9.1 (#115)
95eef44 is described below
commit 95eef447cfbd8dd48d93eac979162ed6e5c2e5bb
Author: Bruno Salzano <[email protected]>
AuthorDate: Sat Aug 22 13:44:25 2026 +0200
0.9.1 (#115)
* fix: fix absolute path in run.sh
starting the operator locally gave error "No such file or directory task:
Failed to run task "run": task: Failed to run task "d:run": exit status 127",
because of an absolute path inside run.sh
* fix: path to check for db ready
changed the path for wait_db_ready. The path without the final / led to a
301 and not a 200
* fix: invoker and operator image from env
removed hardcoded values for cfg.get operator.image / operator.tag and
invoker.image and invoker.tag. Config now check env vars and defaults to old
images
* fix(test): milvus tests
fixed tests for minio / seaweedfs .
* chore(docs): taskfile
added desc to taskfile tasks
* fix: namespace validation
added namespace validation in user creation
* chore(deps): bump urllib3 from 2.3.0 to 2.7.0
* fix: kube type detection (#114)
* Update Docker actions to latest versions
* chore: workflow/image alignment
---------
Co-authored-by: Michele Sciabarra
<[email protected]>
---
.github/workflows/image.yml | 10 +++++----
.gitignore | 1 +
Taskfile.yml | 4 +++-
TaskfileBuild.yml | 5 +++++
nuvolaris/kube.py | 50 +++++++++++++++++++++++++++++++++++++-------
nuvolaris/registry_deploy.py | 5 +++--
6 files changed, 61 insertions(+), 14 deletions(-)
diff --git a/.github/workflows/image.yml b/.github/workflows/image.yml
index 0f2467c..3d766a4 100644
--- a/.github/workflows/image.yml
+++ b/.github/workflows/image.yml
@@ -74,17 +74,19 @@ jobs:
#- name: Integration Test
# run: task itest
# continue-on-error: false
+ - name: Show Image Registry
+ run: echo "IMAGE_REGISTRY=${{ env.IMAGE_REGISTRY }}"
- name: Registry login
- uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
+ uses: docker/login-action@af1e73f918a031802d376d3c8bbc3fe56130a9b0 #
v4.4.0
with:
registry: ${{ env.IMAGE_REGISTRY || 'registry.hub.docker.com' }}
username: ${{ env.IMAGE_REGISTRY == 'ghcr.io' &&
github.repository_owner || secrets.DOCKERHUB_USER }}
password: ${{ env.IMAGE_REGISTRY == 'ghcr.io' &&
secrets.GITHUB_TOKEN || secrets.DOCKERHUB_TOKEN }}
- name: Set up QEMU
- uses:
docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
+ uses:
docker/setup-qemu-action@96fe6ef7f33517b61c61be40b68a1882f3264fb8 # v4.2.0
with:
image: tonistiigi/binfmt:qemu-v7.0.0-28
- name: Set up Docker Buildx
- uses:
docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
+ uses:
docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
- name: Image
- run: task buildx-and-push TAG="$IMG_TAG"
\ No newline at end of file
+ run: task buildx-and-push TAG="$IMG_TAG"
diff --git a/.gitignore b/.gitignore
index ab4a642..566f6b0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -57,3 +57,4 @@ actions/github/webhook/common
.direnv/
.idea/**
.vscode/**
+misc
\ No newline at end of file
diff --git a/Taskfile.yml b/Taskfile.yml
index 51341e5..69a4e6b 100644
--- a/Taskfile.yml
+++ b/Taskfile.yml
@@ -22,7 +22,9 @@ vars:
N: ""
T: ""
P: ""
- BASETAG: 0.1.0-incubating
+ BASETAG:
+ # fixed to 0.1.0-incubating - overridable with MY_BASETAG env var
+ sh: echo "${MY_BASETAG:-0.1.0-incubating}"
KUBE:
sh: ./detect.sh
NS: "nuvolaris"
diff --git a/TaskfileBuild.yml b/TaskfileBuild.yml
index b6f24b4..81e018b 100644
--- a/TaskfileBuild.yml
+++ b/TaskfileBuild.yml
@@ -53,6 +53,11 @@ tasks:
${MY_OPERATOR_IMAGE:-{{.OPERATOR_IMAGE}}}:{{.OPERATOR_TAG}}
--name=nuvolaris
+ k3s:build-and-load:
+ - task: build
+ - >
+ docker save ${MY_OPERATOR_IMAGE:-{{.OPERATOR_IMAGE}}}:{{.OPERATOR_TAG}}
| sudo k3s ctr images import -
+
buildx-and-push:
- >
docker buildx build
diff --git a/nuvolaris/kube.py b/nuvolaris/kube.py
index a921173..8772744 100644
--- a/nuvolaris/kube.py
+++ b/nuvolaris/kube.py
@@ -21,6 +21,7 @@ import nuvolaris.template as tpl
import subprocess
import json
import logging
+import re
import yaml
@@ -172,11 +173,46 @@ def rollout(name, namespace="nuvolaris"):
except:
return None
-def detect_kind():
+def detect() -> str | None:
+ """
+ >>> import nuvolaris.kube as kube
+ >>> kube.mocker.config("get nodes", [{"nuvolaris.io/kube": "kind"}])
+ >>> kube.detect()
+ 'kind'
+ >>> kube.mocker.config("get nodes", [{"eksctl.io/cluster-name": "prod"}])
+ >>> kube.detect()
+ 'eks'
+ >>> kube.mocker.config("get nodes", [{"kubernetes.io/os": "linux"}])
+ >>> kube.detect()
+ 'generic'
+ >>> kube.mocker.reset()
+ """
try:
- is_kind = kubectl("get","node/nuvolaris-control-plane",
- namespace=None,
- jsonpath='{.metadata.labels.nuvolaris\\.io/kube}')
- return is_kind and "kind" in is_kind
- except:
- return False
\ No newline at end of file
+ nodes_labels = kubectl("get", "nodes", namespace=None,
+ jsonpath='{.items[].metadata.labels}')
+ except Exception:
+ return None
+
+ if not nodes_labels or not isinstance(nodes_labels, (list, dict)):
+ return None
+
+ if isinstance(nodes_labels, dict):
+ nodes_labels = [nodes_labels]
+
+ text = json.dumps(nodes_labels)
+
+ if "eksctl.io" in text:
+ return "eks"
+ elif "microk8s.io" in text:
+ return "microk8s"
+ elif "lke.linode.com" in text:
+ return "lks"
+ elif "openshift.io" in text:
+ return "openshift"
+ elif re.search(r"instance-type.*k3s", text):
+ return "k3s"
+ elif any(isinstance(labels, dict) and "kind" in
labels.get("nuvolaris.io/kube", "")
+ for labels in nodes_labels):
+ return "kind"
+ else:
+ return "generic"
\ No newline at end of file
diff --git a/nuvolaris/registry_deploy.py b/nuvolaris/registry_deploy.py
index e9c13fe..5a2f445 100644
--- a/nuvolaris/registry_deploy.py
+++ b/nuvolaris/registry_deploy.py
@@ -70,8 +70,9 @@ def create_internal_registry(data, owner=None):
#path the registry pull secret
repoInternalHost = data['repoHostname']
- if kube.detect_kind():
- # when repo is kind, the registry pull secret will point
+ kube_kind = kube.detect()
+ if kube_kind == 'kind' or kube_kind == 'k3s':
+ # when kubernetes is installed on kind or k3s, the registry pull
secret will point
# to the node port exposed on the node
repoInternalHost = "127.0.0.1:32000"