代码拉取完成,页面将自动刷新
同步操作将从 openEuler-RISC-V/ceph 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From a4c108a75e1240403813c96c022161a7ca33bbae Mon Sep 17 00:00:00 2001
From: liyuanyuan <liyuanyuan@xfusion.com>
Date: Thu, 15 Dec 2022 21:41:04 +0800
Subject: [PATCH] fix no module named v1_event for mgr/k8sevent
---
src/pybind/mgr/k8sevents/module.py | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/pybind/mgr/k8sevents/module.py b/src/pybind/mgr/k8sevents/module.py
index 1e12d1f27..66235e8f8 100644
--- a/src/pybind/mgr/k8sevents/module.py
+++ b/src/pybind/mgr/k8sevents/module.py
@@ -53,6 +53,9 @@ finally:
event_queue = queue.Queue()
try:
+ import kubernetes
+ from distutils.version import StrictVersion
+
from kubernetes import client, config, watch
from kubernetes.client.rest import ApiException
except ImportError:
@@ -67,7 +70,10 @@ else:
# which causes an exception in the generator. A workaround is discussed for a similar issue
# in https://github.com/kubernetes-client/python/issues/376 which has been used here
# pylint: disable=no-member
- from kubernetes.client.models.v1_event import V1Event
+ if kubernetes.__version__ <= StrictVersion("18.20.0"):
+ from kubernetes.client.models.v1_event import V1Event
+ else:
+ from kubernetes.client.models.core_v1_event import CoreV1Event as V1Event
def local_involved_object(self, involved_object):
if involved_object is None:
involved_object = client.V1ObjectReference(api_version="1")
--
2.27.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。