在试图构建同步时,我得到了一个错误,它阻止了我构建图像:
[INFO] --- fabric8-maven-plugin:3.5.38:build (build) @ meta ---
[INFO] F8: Using OpenShift build with strategy S2I
[WARNING] F8: Cannot access cluster for detecting mode: Failure executing: GET at: https://192.168.42.178:8443/. Message: Unauthorized! Token may have expired! Please log-in again. Unauthorized.
[INFO] F8: Running generator spring-boot
[INFO] F8: spring-boot: Using Docker image fabric8/s2i-java:2.1 as base / builder
[WARNING] F8: Cannot access cluster for detecting mode: Failure executing: GET at: https://192.168.42.178:8443/. Message: Unauthorized! Token may have expired! Please log-in again. Unauthorized.
[ERROR] F8: Failed to execute the build [io.fabric8.kubernetes.client.DefaultKubernetesClient cannot be cast to
io.fabric8.openshift.client.OpenShiftClient]
...
[ERROR] Failed to execute goal io.fabric8:fabric8-maven-plugin:3.5.38:build (build) on project meta: Failed to execute the build: io.fabric8.kubernetes.client.DefaultKubernetesClient cannot be cast to io.fabric8.openshift.client.OpenShiftClient -> [Help 1]
...用于构建syndesis的命令:syndesis build -i -f - -c。
发布于 2019-08-13 11:25:26
这是因为您是从"oc“命令中注销的。如果您尝试使用它,您将得到类似于以下错误:
$ oc get pods
error: the server doesn't have a resource type "pods"要修复它,您必须再次登录:
$ oc login
Authentication required for https://192.168.42.178:8443 (openshift)
Username: developer
Password:
Login successful.
You have access to the following projects and can switch between them with 'oc project <projectname>':
myproject
* syndesis
Using project "syndesis".如果无法识别命令"oc“,则必须首先设置环境:
$ eval $(minishift oc-env)https://stackoverflow.com/questions/57476776
复制相似问题