[英]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.