mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-06 15:46:57 +01:00
34 lines
1.3 KiB
Plaintext
34 lines
1.3 KiB
Plaintext
// Module included in the following assemblies:
|
|
//
|
|
// * operators/operator_sdk/osdk-generating-csvs.adoc
|
|
|
|
[id="osdk-hiding-internal-objects_{context}"]
|
|
= Hiding internal objects
|
|
|
|
It is common practice for Operators to use Custom Resource Definitions (CRDs)
|
|
internally to accomplish a task. These objects are not meant for users to
|
|
manipulate and can be confusing to users of the Operator. For example, a
|
|
database Operator might have a Replication CRD that is created whenever a user
|
|
creates a Database object with `replication: true`.
|
|
|
|
If any CRDs are not meant for manipulation by users, they can be hidden in the
|
|
user interface using the `operators.operatorframework.io/internal-objects`
|
|
annotation in the Operator's ClusterServiceVersion (CSV):
|
|
|
|
.Internal object annotation
|
|
[source,yaml]
|
|
----
|
|
apiVersion: operators.coreos.com/v1alpha1
|
|
kind: ClusterServiceVersion
|
|
metadata:
|
|
name: my-operator-v1.2.3
|
|
annotations:
|
|
operators.operatorframework.io/internal-objects: '["my.internal.crd1.io","my.internal.crd2.io"]' <1>
|
|
...
|
|
----
|
|
<1> Set any internal CRDs as an array of strings.
|
|
|
|
Before marking one of your CRDs as internal, make sure that any debugging
|
|
information or configuration that might be required to manage the application is
|
|
reflected on the CR's status or `spec` block, if applicable to your Operator.
|