5.11. 过滤在 Operator 目录中如何工作


oc-mirror 插件 v2 通过处理 imageSetConfig 中的信息来选择用于镜像的捆绑包列表。

当 oc-mirror 插件 v2 选择用于镜像的捆绑包时,它不会推断 Group Version Kind (GVK) 或捆绑包依赖项,从镜像集中省略它们。相反,它严格遵循用户指令。您必须明确指定任何所需的依赖软件包及其版本。

捆绑包版本通常使用语义版本标准 (SemVer),您可以根据版本在频道中对捆绑包进行排序。您可以选择位于 ImageSetConfig 中的特定范围的 buncles。

此选择算法确保与 oc-mirror 插件 v1 相比的一致性结果。但是,它不包括升级图形详情,如 replaces, skip, 和 skipRange。这种方法与 OLM 算法不同。它可能会比升级集群所需的更多捆绑包进行镜像(mirror),因为 minVersionmaxVersion 之间的升级路径可能比较短。

Expand
表 5.1. 使用下表查看在不同场景中包括哪些捆绑包版本
ImageSetConfig operator 过滤预期的捆绑包版本

场景 1

mirror:
 operators:
   - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.10
Copy to Clipboard Toggle word wrap

对于目录中每个包(1 个捆绑包),对应于该软件包的默认频道的头版本。

场景 2

mirror:
  operators:
    - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.10
      full: true
Copy to Clipboard Toggle word wrap

指定目录的所有频道的所有捆绑包

场景 3

mirror:
  operators:
    - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.10
     packages:
    - name: compliance-operator
Copy to Clipboard Toggle word wrap

一个捆绑包,对应于该软件包的默认频道的头版本

场景 4

mirror:
  operators:
    - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.10
      full: true
      - packages:
          - name: elasticsearch-operator
Copy to Clipboard Toggle word wrap

指定软件包的所有频道捆绑包

场景 5

mirror:
  operators:
  - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.15
    packages:
    - name: compliance-operator
       minVersion: 5.6.0
Copy to Clipboard Toggle word wrap

默认频道中的所有捆绑包(从 minVersion )到频道头,该软件包不依赖于升级图表的最短路径。

场景 6

mirror:
  operators:
  - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.15
    packages:
    - name: compliance-operator
        maxVersion: 6.0.0
Copy to Clipboard Toggle word wrap

默认频道中的所有捆绑包都低于该软件包的 maxVersion

场景 7

mirror:
  operators:
  - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.15
    packages:
    - name: compliance-operator
        minVersion: 5.6.0
        maxVersion: 6.0.0
Copy to Clipboard Toggle word wrap

默认频道中的所有捆绑包,在那个软件包的 minVersionmaxVersion 之间。频道头不包含,即使过滤中包含多个频道。

场景 8

mirror:
  operators:
  - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.15
    packages:
    - name: compliance-operator
        channels
          - name: stable
Copy to Clipboard Toggle word wrap

该软件包所选频道的头捆绑包。

场景 9

mirror:
  operators:
    - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.10
      full: true
      - packages:
          - name: elasticsearch-operator
            channels:
               - name: 'stable-v0'
Copy to Clipboard Toggle word wrap

指定软件包和频道的所有捆绑包。

场景 10

mirror:
  operators:
  - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.15
    packages:
    - name: compliance-operator
        channels
          - name: stable
          - name: stable-5.5
Copy to Clipboard Toggle word wrap

该软件包每个所选频道的头捆绑包。

场景 11

mirror:
  operators:
  - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.15
    packages:
    - name: compliance-operator
        channels
          - name: stable
            minVersion: 5.6.0
Copy to Clipboard Toggle word wrap

在该软件包所选频道中,所有版本都以 minVersion 开头,直到频道头。这个场景并不能依赖升级图表中的最短路径。

场景 12

mirror:
  operators:
  - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.15
    packages:
    - name: compliance-operator
        channels
          - name: stable
            maxVersion: 6.0.0
Copy to Clipboard Toggle word wrap

在该软件包所选频道中,所有版本都最多为 maxVersion (不依赖于升级图中的最佳路径)。频道头不包含,即使过滤中包含多个频道。

场景 13

mirror:
  operators:
  - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.15
    packages:
    - name: compliance-operator
       channels
          - name: stable
            minVersion: 5.6.0
            maxVersion: 6.0.0
Copy to Clipboard Toggle word wrap

在该软件包的所选频道中,minVersionmaxVersion 之间的所有版本都不依赖于升级图表中最短的路径。频道头不包含,即使过滤中包含多个频道。

场景 14

mirror:
  operators:
  - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.14
    packages:
    - name: aws-load-balancer-operator
      bundles:
      - name: aws-load-balancer-operator.v1.1.0
    - name: 3scale-operator
      bundles:
      - name: 3scale-operator.v0.10.0-mas
Copy to Clipboard Toggle word wrap

只有为每个软件包指定的捆绑包才会包含在过滤中。

场景 15

mirror:
  operators:
  - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.15
    packages:
    - name: compliance-operator
        channels
          - name: stable
        minVersion: 5.6.0
        maxVersion: 6.0.0
Copy to Clipboard Toggle word wrap

不要使用这个场景。通过频道过滤,以及不允许带有 minVersionmaxVersion 的软件包。

场景 16

mirror:
  operators:
   - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.15
    packages:
    - name: compliance-operator
        channels
          - name: stable
        minVersion: 5.6.0
        maxVersion: 6.0.0
Copy to Clipboard Toggle word wrap

请勿使用此场景。您不能使用 full:trueminVersionmaxVersion 进行过滤。

场景 17

mirror:
  operators:
    - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.15
      full: true
    packages:
    - name: compliance-operator
        channels
          - name: stable
            minVersion: 5.6.0
            maxVersion: 6.0.0
Copy to Clipboard Toggle word wrap

请勿使用此场景。您不能使用 full:trueminVersionmaxVersion 进行过滤。

返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

Theme

© 2026 Red Hat