Skip to content

Instantly share code, notes, and snippets.

@bentito
Last active June 29, 2022 15:47
Show Gist options
  • Save bentito/f6ffb32786165b184c84ce9b01d37b79 to your computer and use it in GitHub Desktop.
Save bentito/f6ffb32786165b184c84ce9b01d37b79 to your computer and use it in GitHub Desktop.
Working with PR#748 operator-registry opm render output

From PR operator-framework/operator-registry#748 build this version of OPM then :

opm index prune --from-index registry.redhat.io/redhat/redhat-operator-index:v4.10 -c docker --packages cluster-logging

(will need to docker login redhat registry) then: docker push the pared down index, for ex:

docker push quay.io/btofel/pared-opm-indexes:cluster-logging-only

then: opm render (fbc) this pruned index image

opm render quay.io/btofel/pared-opm-indexes:cluster-logging-only

nice rendering of fbc without data blobs:

opm render quay.io/btofel/pared-opm-indexes:cluster-logging-only|jq '(.icon.base64data, .properties[]?.value.data) |= "xxx"'

references:

https://issues.redhat.com/browse/PORTENABLE-208

https://docs.openshift.com/container-platform/4.10/cli_reference/opm/cli-opm-ref.html

@bentito
Copy link
Author

bentito commented Jun 29, 2022

above yields:

{
  "schema": "olm.package",
  "name": "cluster-logging",
  "defaultChannel": "stable",
  "icon": {
    "base64data": "xxx",
    "mediatype": "image/svg+xml"
  }
}
{
  "schema": "olm.channel",
  "name": "stable",
  "package": "cluster-logging",
  "entries": [
    {
      "name": "cluster-logging.5.4.2",
      "skipRange": ">=4.6.0-0 <5.4.2"
    }
  ],
  "icon": {
    "base64data": "xxx"
  }
}
{
  "schema": "olm.channel",
  "name": "stable-5.2",
  "package": "cluster-logging",
  "entries": [
    {
      "name": "cluster-logging.5.2.11",
      "skipRange": ">=4.6.0-0 <5.2.11"
    }
  ],
  "icon": {
    "base64data": "xxx"
  }
}
{
  "schema": "olm.channel",
  "name": "stable-5.3",
  "package": "cluster-logging",
  "entries": [
    {
      "name": "cluster-logging.5.3.8",
      "skipRange": ">=4.6.0-0 <5.3.8"
    }
  ],
  "icon": {
    "base64data": "xxx"
  }
}
{
  "schema": "olm.channel",
  "name": "stable-5.4",
  "package": "cluster-logging",
  "entries": [
    {
      "name": "cluster-logging.5.4.2",
      "skipRange": ">=4.6.0-0 <5.4.2"
    }
  ],
  "icon": {
    "base64data": "xxx"
  }
}
{
  "schema": "olm.bundle",
  "name": "cluster-logging.5.2.11",
  "package": "cluster-logging",
  "image": "registry.redhat.io/openshift-logging/cluster-logging-operator-bundle@sha256:8cdf8b5249f4c683c7f530bd331945c555a955bdb7254b9fc2b256c8b64d18a1",
  "properties": [
    {
      "type": "olm.gvk",
      "value": {
        "group": "logging.openshift.io",
        "kind": "ClusterLogForwarder",
        "version": "v1",
        "data": "xxx"
      }
    },
    {
      "type": "olm.gvk",
      "value": {
        "group": "logging.openshift.io",
        "kind": "ClusterLogging",
        "version": "v1",
        "data": "xxx"
      }
    },
    {
      "type": "olm.package",
      "value": {
        "packageName": "cluster-logging",
        "version": "5.2.11",
        "data": "xxx"
      }
    },
    {
      "type": "olm.bundle.object",
      "value": {
        "data": "xxx"
      }
    },
    {
      "type": "olm.bundle.object",
      "value": {
        "data": "xxx"
      }
    },
    {
      "type": "olm.bundle.object",
      "value": {
        "data": "xxx"
      }
    },
    {
      "type": "olm.bundle.object",
      "value": {
        "data": "xxx"
      }
    },
    {
      "type": "olm.bundle.object",
      "value": {
        "data": "xxx"
      }
    },
    {
      "type": "olm.bundle.object",
      "value": {
        "data": "xxx"
      }
    }
  ],
  "relatedImages": [
    {
      "name": "",
      "image": "registry.redhat.io/openshift-logging/cluster-logging-operator-bundle@sha256:8cdf8b5249f4c683c7f530bd331945c555a955bdb7254b9fc2b256c8b64d18a1"
    },
    {
      "name": "openshift-logging/cluster-logging-rhel8-operator",
      "image": "registry.redhat.io/openshift-logging/cluster-logging-rhel8-operator@sha256:5f4f4296efe01388cc165daac562e518e7cd277096890c3c67cf4428aaa77021"
    },
    {
      "name": "openshift-logging/fluentd-rhel8",
      "image": "registry.redhat.io/openshift-logging/fluentd-rhel8@sha256:5ab0e0e2e58748c732ba0bec52e4393a3fe8e5846ff69d8be2849832fb6e22f1"
    },
    {
      "name": "openshift-logging/log-file-metric-exporter-rhel8",
      "image": "registry.redhat.io/openshift-logging/log-file-metric-exporter-rhel8@sha256:634d45eb07fa556bd7589342c1dca74a3a8f9d176cd8a3bb95ae4819d2872abd"
    }
  ],
  "icon": {
    "base64data": "xxx"
  }
}
{
  "schema": "olm.bundle",
  "name": "cluster-logging.5.3.8",
  "package": "cluster-logging",
  "image": "registry.redhat.io/openshift-logging/cluster-logging-operator-bundle@sha256:6e851b208cd411d4e36d51808ebb38c391122061d4000f3094f61924224d2777",
  "properties": [
    {
      "type": "olm.gvk",
      "value": {
        "group": "logging.openshift.io",
        "kind": "ClusterLogForwarder",
        "version": "v1",
        "data": "xxx"
      }
    },
    {
      "type": "olm.gvk",
      "value": {
        "group": "logging.openshift.io",
        "kind": "ClusterLogging",
        "version": "v1",
        "data": "xxx"
      }
    },
    {
      "type": "olm.package",
      "value": {
        "packageName": "cluster-logging",
        "version": "5.3.8",
        "data": "xxx"
      }
    },
    {
      "type": "olm.bundle.object",
      "value": {
        "data": "xxx"
      }
    },
    {
      "type": "olm.bundle.object",
      "value": {
        "data": "xxx"
      }
    },
    {
      "type": "olm.bundle.object",
      "value": {
        "data": "xxx"
      }
    },
    {
      "type": "olm.bundle.object",
      "value": {
        "data": "xxx"
      }
    },
    {
      "type": "olm.bundle.object",
      "value": {
        "data": "xxx"
      }
    },
    {
      "type": "olm.bundle.object",
      "value": {
        "data": "xxx"
      }
    },
    {
      "type": "olm.bundle.object",
      "value": {
        "data": "xxx"
      }
    }
  ],
  "relatedImages": [
    {
      "name": "",
      "image": "registry.redhat.io/openshift-logging/cluster-logging-operator-bundle@sha256:6e851b208cd411d4e36d51808ebb38c391122061d4000f3094f61924224d2777"
    },
    {
      "name": "openshift-logging/cluster-logging-rhel8-operator",
      "image": "registry.redhat.io/openshift-logging/cluster-logging-rhel8-operator@sha256:2727b69bcd4f83032e0068e6a3d45ff56e388dd184a55ac89c379a6f288916b0"
    },
    {
      "name": "openshift-logging/fluentd-rhel8",
      "image": "registry.redhat.io/openshift-logging/fluentd-rhel8@sha256:832424a5426c15e6e594d2b7368fab37b9f27f5dc5699988d12fa9cd7e817df9"
    },
    {
      "name": "openshift-logging/log-file-metric-exporter-rhel8",
      "image": "registry.redhat.io/openshift-logging/log-file-metric-exporter-rhel8@sha256:b8490a368d7384c06f4048295f408601692896fe5b5291af2e63c7528e6efde3"
    }
  ],
  "icon": {
    "base64data": "xxx"
  }
}
{
  "schema": "olm.bundle",
  "name": "cluster-logging.5.4.2",
  "package": "cluster-logging",
  "image": "registry.redhat.io/openshift-logging/cluster-logging-operator-bundle@sha256:7b4219619dfd37e9df620098454cef878839b4c359f87959ab232f06d70ebb7f",
  "properties": [
    {
      "type": "olm.gvk",
      "value": {
        "group": "logging.openshift.io",
        "kind": "ClusterLogForwarder",
        "version": "v1",
        "data": "xxx"
      }
    },
    {
      "type": "olm.gvk",
      "value": {
        "group": "logging.openshift.io",
        "kind": "ClusterLogging",
        "version": "v1",
        "data": "xxx"
      }
    },
    {
      "type": "olm.package",
      "value": {
        "packageName": "cluster-logging",
        "version": "5.4.2",
        "data": "xxx"
      }
    },
    {
      "type": "olm.bundle.object",
      "value": {
        "data": "xxx"
      }
    },
    {
      "type": "olm.bundle.object",
      "value": {
        "data": "xxx"
      }
    },
    {
      "type": "olm.bundle.object",
      "value": {
        "data": "xxx"
      }
    },
    {
      "type": "olm.bundle.object",
      "value": {
        "data": "xxx"
      }
    },
    {
      "type": "olm.bundle.object",
      "value": {
        "data": "xxx"
      }
    },
    {
      "type": "olm.bundle.object",
      "value": {
        "data": "xxx"
      }
    },
    {
      "type": "olm.bundle.object",
      "value": {
        "data": "xxx"
      }
    }
  ],
  "relatedImages": [
    {
      "name": "",
      "image": "registry.redhat.io/openshift-logging/cluster-logging-operator-bundle@sha256:7b4219619dfd37e9df620098454cef878839b4c359f87959ab232f06d70ebb7f"
    },
    {
      "name": "openshift-logging/cluster-logging-rhel8-operator",
      "image": "registry.redhat.io/openshift-logging/cluster-logging-rhel8-operator@sha256:4ef108cc8bcb920efaed75ca68ff2f23b97416888c410e82ae3ab6ec27cffad9"
    },
    {
      "name": "openshift-logging/fluentd-rhel8",
      "image": "registry.redhat.io/openshift-logging/fluentd-rhel8@sha256:c4230c3bc2220b38ea68528acabf69d6fee69e3f529f2e8b28f9cbb2b5ea81f7"
    },
    {
      "name": "openshift-logging/log-file-metric-exporter-rhel8",
      "image": "registry.redhat.io/openshift-logging/log-file-metric-exporter-rhel8@sha256:b274417151eef4f98f115eb122b32cccfc6fddf3df8c0d86a15f393b7ab4ff25"
    },
    {
      "name": "openshift-logging/vector-rhel8",
      "image": "registry.redhat.io/openshift-logging/vector-rhel8@sha256:baeef8e0dcc4d6b0af4587783c1d263f0b34c47e9b6ddee956e9c348f02ba3ec"
    }
  ],
  "icon": {
    "base64data": "xxx"
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment