我正在尝试将某些 GKE 集群从 1.21 升级到 1.22,但收到一些有关已弃用 API 的警告。我的集群中也运行 Istio 1.12.1 版本
\n其中之一引起了我的一些担忧:
\n/apis/extensions/v1beta1/ingresses
我很惊讶地看到这个警告,因为我们的部署是最新的。我们不使用 Ingress。
\n进一步深入研究,我得到了以下详细信息:
\n\xe2\x9e\x9c kubectl get --raw /apis/extensions/v1beta1/ingresses | jq\nWarning: extensions/v1beta1 Ingress is deprecated in v1.14+, unavailable in v1.22+; use networking.k8s.io/v1 Ingress\n{\n "kind": "IngressList",\n "apiVersion": "extensions/v1beta1",\n "metadata": {\n "resourceVersion": "191638911"\n },\n "items": []\n}\nRun Code Online (Sandbox Code Playgroud)\n看来 IngressList 是调用旧 API 的。尝试删除相同的,
\n\xe2\x9e\x9c kubectl delete --raw /apis/extensions/v1beta1/ingresses\nError from server (MethodNotAllowed): the server does not allow this method on the requested resource\nRun Code Online (Sandbox Code Playgroud)\n既不能删除,也不能升级。
\n …我收到以下错误 **ASM ClassReader 无法解析类文件 - 可能是由于尚不支持的新 Java 类文件版本 **
我使用 JDK 1.8 和 Apache 7 并且使用 Spring 3.2.9 版本来运行我的 web 项目
[jar:file:/apps/tomcat/instances/tomcat01/work/Catalina/localhost/ConcurArchival_Web/WEB-INF/lib/ecl-test-1.0.0.jar!/com/tgt/ecl/framework/test/MVCTest.class]; nested exception is org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn't supported yet: URL
Run Code Online (Sandbox Code Playgroud)
退伍军人的帮助表示赞赏
下面添加了堆栈跟踪:
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: URL [jar:file:/apps/tomcat/instances/tomcat01/work/Catalina/localhost/ConcurArchival_Web/WEB-INF/lib/tgt-ecl-test-1.0.0.jar!/com/tgt/ecl/framework/test/MVCTest.class]; nested exception is org.springframework.core.NestedIOException: ASM ClassReader failed to parse …Run Code Online (Sandbox Code Playgroud) 我正在尝试为我的 argparse 模块编写单元测试用例。然而,测试并没有按预期进行。我的代码如下:
import argparse
def create_parser():
PARSER = argparse.ArgumentParser(prog='traffic_problem_one', \
orbit2_traffic_speed', description='Geek Trust traffic problem', \
allow_abbrev=False)
PARSER.add_argument('Climate', metavar='--climate', action='store', type=str, help='Climate condition')
PARSER.add_argument('Orbit1', metavar='--orbit1', action='store', type=int, help='Orbit 1 traffic speed')
PARSER.add_argument('Orbit2', metavar='--orbit2', action='store', type=int, help='Orbit 2 traffic speed')
return PARSER
PARSER = create_parser()
ARGS = PARSER.parse_args()
input = [ARGS.Climate, ARGS.Orbit1, ARGS.Orbit2]
Run Code Online (Sandbox Code Playgroud)
对应的测试文件如下:
import sys
import os
sys.path.append(os.path.dirname(__file__)+"/../")
from src.main import *
from unittest import TestCase
class CommandLineTestCase(TestCase):
"""
Base TestCase class, sets up a CLI parser
"""
@classmethod …Run Code Online (Sandbox Code Playgroud)