From acbeb6d06aa72aeec556f6c5581f7ab2863aad0d Mon Sep 17 00:00:00 2001 From: Richard Wall Date: Tue, 15 Feb 2022 21:49:12 +0000 Subject: [PATCH] Hide internal APIs from the OperatorHub UI Signed-off-by: Richard Wall --- bundle/manifests/cert-manager.clusterserviceversion.yaml | 7 ++++++- hack/fixup-csv | 9 +++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/bundle/manifests/cert-manager.clusterserviceversion.yaml b/bundle/manifests/cert-manager.clusterserviceversion.yaml index 04e52aa..e032049 100644 --- a/bundle/manifests/cert-manager.clusterserviceversion.yaml +++ b/bundle/manifests/cert-manager.clusterserviceversion.yaml @@ -36,8 +36,13 @@ metadata: capabilities: Full Lifecycle categories: Security containerImage: quay.io/jetstack/cert-manager-controller:v1.6.1 - createdAt: '2022-02-08T17:42:41' + createdAt: '2022-02-15T21:48:43' operators.operatorframework.io/builder: operator-sdk-v1.13.0+git + operators.operatorframework.io/internal-objects: |- + [ + "challenge.acme.cert-manager.io", + "order.acme.cert-manager.io" + ] operators.operatorframework.io/project_layout: unknown repository: https://github.com/jetstack/cert-manager support: The cert-manager maintainers diff --git a/hack/fixup-csv b/hack/fixup-csv index e723dbb..e3a7ad4 100755 --- a/hack/fixup-csv +++ b/hack/fixup-csv @@ -21,6 +21,7 @@ Important ClusterServiceVersion (CSV) file references: """ import argparse import base64 +import json import mimetypes import sys from datetime import datetime @@ -67,6 +68,14 @@ def main(): for arch in conf["architectures"] }) + # Hide some internal APIs from the OperatorHub UI + # https://docs.okd.io/4.9/operators/operator_sdk/osdk-generating-csvs.html#osdk-hiding-internal-objects_osdk-generating-csvs + doc["metadata"]["annotations"]["operators.operatorframework.io/internal-objects"] = literal( + json.dumps([ + "challenge.acme.cert-manager.io", + "order.acme.cert-manager.io", + ], indent=4) + ) doc["metadata"]["annotations"]["capabilities"] = conf["capabilities"] doc["metadata"]["annotations"]["categories"] = ",".join(conf["categories"]) doc["metadata"]["annotations"]["containerImage"] = doc["spec"]["install"]["spec"]["deployments"][0]["spec"]["template"]["spec"]["containers"][0]["image"]