首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >OpenShift :等待创建图像流

OpenShift :等待创建图像流
EN

Stack Overflow用户
提问于 2019-10-30 10:26:21
回答 2查看 783关注 0票数 0

我正在创建一个安装脚本,它将从YAML文件†中创建资源。此脚本将执行与此命令等效的操作:

代码语言:javascript
运行
复制
oc new-app registry.access.redhat.com/rhscl/nginx-114-rhel7~http://github.com/username/repo.git

三个YAML文件被创建如下:

  1. imagestream for nginx-114-rhel7 - is-nginx.yaml
代码语言:javascript
运行
复制
apiVersion: 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: Source
  1. imagestream for repo - is-repo.yaml
代码语言:javascript
运行
复制
apiVersion: v1
kind: ImageStream
metadata:
  labels:
    application: is-rp
  name: is-rp
  namespace: ns
  1. buildconfig for repo (输出为imagestream for repo) - bc-repo.yaml
代码语言:javascript
运行
复制
apiVersion: 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

当这些命令一个接一个地运行时,

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

我收到这条错误信息,

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

但是,当我使用sleepstart-build之前运行命令时,构建将被正确触发。

代码语言:javascript
运行
复制
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命令的情况下触发sleepoc wait似乎只适用于--for=condition--for=delete。我不知道--for=condition的价值是什么。

oc -我没有看到关于创建安装脚本的明确指导方针--只使用YAML或类似的†命令--用于将应用程序部署到OpenShift上。

EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58623255

复制
相关文章

相似问题

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