我正在创建一个安装脚本,它将从YAML文件†中创建资源。此脚本将执行与此命令等效的操作:
oc new-app registry.access.redhat.com/rhscl/nginx-114-rhel7~http://github.com/username/repo.git三个YAML文件被创建如下:
imagestream for nginx-114-rhel7 - is-nginx.yamlapiVersion: image.openshift.io/v1
kind: ImageStream
metadata:
labels:
build: build-repo
name: nginx-114-rhel7
namespace: ns
spec:
tags:
- annotations: null
from:
kind: DockerImage
name: registry.access.redhat.com/rhscl/nginx-114-rhel7
name: latest
referencePolicy:
type: Sourceimagestream for repo - is-repo.yamlapiVersion: v1
kind: ImageStream
metadata:
labels:
application: is-rp
name: is-rp
namespace: nsbuildconfig for repo (输出为imagestream for repo) - bc-repo.yamlapiVersion: v1
kind: BuildConfig
metadata:
labels:
build: rp
name: bc-rp
namespace: ns
spec:
output:
to:
kind: ImageStreamTag
name: 'is-rp:latest'
postCommit: {}
resources: {}
runPolicy: Serial
source:
git:
ref: dev_1.0
uri: 'http://github.com/username/repo.git'
type: Git
strategy:
sourceStrategy:
from:
kind: ImageStreamTag
name: 'nginx-114-rhel7:latest'
namespace: flo
type: Source
successfulBuildsHistoryLimit: 5当这些命令一个接一个地运行时,
oc create -f is-nginx.yaml;oc create -f is-repo.yaml;oc create -f bc-repo.yaml;oc start-build bc/bc-rep --wait我收到这条错误信息,
The ImageStreamTag "nginx-114-rhel7:latest" is invalid: from: Error resolving ImageStreamTag nginx-114-rhel7:latest in namespace ns: unable to find latest tagged image但是,当我使用sleep在start-build之前运行命令时,构建将被正确触发。
oc create -f is-nginx.yaml;oc create -f is-repo.yaml;oc create -f bc-repo.yaml;sleep 5;oc start-build bc/bc-rep如何在不输入start-build命令的情况下触发sleep?oc wait似乎只适用于--for=condition和--for=delete。我不知道--for=condition的价值是什么。
oc -我没有看到关于创建安装脚本的明确指导方针--只使用YAML或类似的†命令--用于将应用程序部署到OpenShift上。
https://stackoverflow.com/questions/58623255
复制相似问题