22.4. 执行 OpenShift Operator 管道


您可以通过以下方法运行 OpenShift Operator 管道。

提示

在以下示例中,根据您的要求删除或添加参数和工作区。

如果您使用 Red Hat OpenShift Local,以前称为 Red Hat CodeReady Containers (CRC)或 IBM Power for ppc64le 架构的 Red Hat OpenShift,请将以下 tekton CLI 参数传递给每个 ci pipeline 命令以避免权限问题:

--pod-template templates/crc-pod-template.yml

故障排除

如果您的 OpenShift Pipelines operator 1.9 或更高版本无法正常工作,请按照以下步骤修复它:

先决条件

在创建自定义安全性上下文约束(SCC)前,请确保您具有集群的管理员特权。

步骤

要使 OpenShift Pipelines operator 1.9 或更高版本正常工作,并执行需要特权升级的 ci-pipeline 中的任务子集,创建自定义安全性上下文约束(SCC)并将其链接到管道服务帐户:

  1. 创建新 SCC:

    oc apply -f ansible/roles/operator-pipeline/templates/openshift/openshift-pipelines-custom-scc.yml
    Copy to Clipboard Toggle word wrap
  2. 将新 SCC 添加到 ci-pipeline 服务帐户:

    oc adm policy add-scc-to-user pipelines-custom-scc -z pipeline
    Copy to Clipboard Toggle word wrap

22.4.1. 运行 Minimal 管道

步骤

在终端窗口中运行以下命令:

GIT_REPO_URL=<Git URL to your certified-operators fork >
BUNDLE_PATH=<path to the bundle in the Git Repo> (For example - operators/my-operator/1.2.8)

tkn pipeline start operator-ci-pipeline \
  --param git_repo_url=$GIT_REPO_URL \
  --param git_branch=main \
  --param bundle_path=$BUNDLE_PATH \
  --param env=prod \
  --workspace name=pipeline,volumeClaimTemplateFile=templates/workspace-template.yml \
  --showlog
Copy to Clipboard Toggle word wrap

运行此命令后,管道会提示您提供额外的参数。接受所有默认值,以完成管道执行。

以下内容被设置为默认值,不需要显式包含,但如果在不同的名称下创建了 kubeconfig secret,则可以覆盖。

--param kubeconfig_secret_name=kubeconfig \
--param kubeconfig_secret_key=kubeconfig
Copy to Clipboard Toggle word wrap

如果您在 ppc64le 和 s390x 架构上运行 ci 管道,请从默认值 quay.io/redhat-isv/operator-pipelines-images:released 改为 quay.io/redhat-isv/operator-pipelines-images:multi-arch

故障排除

如果您在使用 SSH URL 时收到 Permission Denied 错误,请尝试 GITHUB HTTPS URL。

22.4.2. 使用镜像摘要固定运行管道

先决条件

执行指令 启用摘要固定

步骤

在终端窗口中运行以下命令:

GIT_REPO_URL=<Git URL to your certified-operators fork >
BUNDLE_PATH=<path to the bundle in the Git Repo> (ie: operators/my-operator/1.2.8)
GIT_USERNAME=<your github username>
GIT_EMAIL=<your github email address>

tkn pipeline start operator-ci-pipeline \
  --param git_repo_url=$GIT_REPO_URL \
  --param git_branch=main \
  --param bundle_path=$BUNDLE_PATH \
  --param env=prod \
  --param pin_digests=true \
  --param git_username=$GIT_USERNAME \
  --param git_email=$GIT_EMAIL \
  --workspace name=pipeline,volumeClaimTemplateFile=templates/workspace-template.yml \
  --workspace name=ssh-dir,secret=github-ssh-credentials \
  --showlog
Copy to Clipboard Toggle word wrap

故障排除

当您收到错误 - 无法读取 https://github.com的用户名 时,请提供 SSH github URL for- param git_repo_url

22.4.3. 使用私有容器 registry 运行管道

先决条件

使用私有容器 registry 执行 下包括的说明。

步骤

在终端窗口中运行以下命令:

GIT_REPO_URL=<Git URL to your certified-operators fork >
BUNDLE_PATH=<path to the bundle in the Git Repo> (ie: operators/my-operator/1.2.8)
GIT_USERNAME=<your github username>
GIT_EMAIL=<your github email address>
REGISTRY=<your image registry.  ie: quay.io>
IMAGE_NAMESPACE=<namespace in the container registry>

tkn pipeline start operator-ci-pipeline \
  --param git_repo_url=$GIT_REPO_URL \
  --param git_branch=main \
  --param bundle_path=$BUNDLE_PATH \
  --param env=prod \
  --param pin_digests=true \
  --param git_username=$GIT_USERNAME \
  --param git_email=$GIT_EMAIL \
  --param registry=$REGISTRY \
  --param image_namespace=$IMAGE_NAMESPACE \
  --workspace name=pipeline,volumeClaimTemplateFile=templates/workspace-template.yml \
  --workspace name=ssh-dir,secret=github-ssh-credentials \
  --workspace name=registry-credentials,secret=registry-docker config-secret \
  --showlog \
Copy to Clipboard Toggle word wrap
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat