简体   繁体   English

OpenShift:构建失败,出现“无效的 Output 参考”

[英]OpenShift : Build failed with 'Invalid Output reference'

I am creating a build configuration with the following YAML.我正在使用以下 YAML 创建构建配置。 Then, I trigger the build manually with oc .然后,我使用oc手动触发构建。 So, the following commands are run.因此,运行以下命令。

oc create -f mybuildconfig.yaml
oc start-build bc/ns-bc-myproject --wait

Build configuration YAML:构建配置 YAML:

apiVersion: v1
kind: BuildConfig
metadata:
  labels:
    build: myproject
  name: ns-bc-myproject
  namespace: ns
spec:
  output:
    to:
      kind: ImageStreamTag
      name: 'ns-is-myproject:latest'
  postCommit: {}
  resources: {}
  runPolicy: Serial
  source:
    git:
      ref: dev_1.0
      uri: 'https://github.com/ns/myproject.git'
    type: Git
  strategy:
    sourceStrategy:
      from:
        kind: ImageStreamTag
        name: 'nodejs:10'
        namespace: openshift
    type: Source
  successfulBuildsHistoryLimit: 5

The build never goes through;构建永远不会通过; it keeps failing with the message as Invalid output reference.它一直失败,消息为 Invalid output 参考。 What is missing?什么不见了?

You need to create an image stream in the namespace where your build config is pushing the image to.您需要在构建配置将映像推送到的命名空间中创建映像 stream

Something like this will work for you:像这样的东西会为你工作:

- apiVersion: v1
  kind: ImageStream
  metadata:
    labels:
      application: ns-is-myproject
    name: ns-is-myproject
    namespace: ns-is-myproject

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将输出参考程序集构建到子文件夹 - Build output reference assemblies to subfolder Docker 映像构建无法识别构建参数:参考格式无效 - Docker image build fails to recognize build argument : invalid reference format 在OpenShift上部署失败 - Failed deploy on OpenShift Ant /构建JAR:构建失败,找不到参考task.path - Ant/Build a JAR : Build failed, Reference task.path not found Travis CI 构建失败,因为没有 output - Travis CI build failed because of no output 离子生成失败; 无效的%JAVA_HOME%(android) - Ionic build failed; invalid %JAVA_HOME% (android) 删除引用后,以前引用的DLL仍包含在构建输出中 - Previously referenced DLL is still included in build output after removing reference 如何设置 output 子文件夹以将参考 dll 复制到构建 - How to set output subfolder to copy reference dll to on build Visual C ++生成错误:无法注册输出 - Visual C++ build error: Failed to register output 任务 ':app:compileReleaseJavaWithJavac' 的执行失败。 编译失败; 有关详细信息,请参阅编译器错误输出。 在 Flutter 构建中 - Execution failed for task ':app:compileReleaseJavaWithJavac'. Compilation failed; see the compiler error output for details. in Flutter build
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM