首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >同步生成错误:无法访问群集以检测模式

同步生成错误:无法访问群集以检测模式
EN

Stack Overflow用户
提问于 2019-08-13 11:25:26
回答 1查看 596关注 0票数 1

在试图构建同步时,我得到了一个错误,它阻止了我构建图像:

代码语言:javascript
复制
[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。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-08-13 11:25:26

这是因为您是从"oc“命令中注销的。如果您尝试使用它,您将得到类似于以下错误:

代码语言:javascript
复制
$ oc get pods
error: the server doesn't have a resource type "pods"

要修复它,您必须再次登录:

代码语言:javascript
复制
$ 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“,则必须首先设置环境:

代码语言:javascript
复制
$ eval $(minishift oc-env)
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/57476776

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档