Skip to content

Commit 080e834

Browse files
author
Eric Stroczynski
authored
doc/user/olm-catalog: document that gen-csv and code annotations (#2345)
are only officially supported for Go Operators for now internal/scaffold/olm-catalog/csv.go: do not overwrite customresourcedefinitions for non-Go Operators
1 parent 81c6c8a commit 080e834

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

doc/user/olm-catalog/csv-annotations.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
This document describes the semantics of Cluster Service Version (CSV) [code annotations][code-annotations-design] and lists all possible annotations.
66

7+
**Note:** CSV annotations can only be used in Go Operator projects. Annotations for Ansible and Helm Operator projects will be added in the future.
8+
79
## Usage
810

911
All annotations have a `+operator-sdk:gen-csv` prefix, denoting that they're parsed while executing [`operator-sdk olm-catalog gen-csv`][sdk-cli-ref].

doc/user/olm-catalog/generating-a-csv.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ This document describes how to manage the following lifecycle for your Operator
66
- **Upgrade your Operator** - Carry over any customizations you have made and ensure a rolling update to the next version of your Operator.
77
- **Refresh your CRDs** - If a new version has updated CRDs, refresh those definitions within the CSV automatically.
88

9+
**Note:** `operator-sdk olm-catalog gen-csv` only officially supports Go Operators. Ansible and Helm Operators will be fully supported in the future. However, `gen-csv` _may_ work with Ansible and Helm Operators if their project structure aligns with that described below.
10+
911
## Configuration
1012

1113
Operator SDK projects have an expected [project layout][doc-project-layout]. In particular, a few manifests are expected to be present in the `deploy` directory:

internal/scaffold/olm-catalog/csv.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import (
2727
"github.com/operator-framework/operator-sdk/internal/scaffold"
2828
"github.com/operator-framework/operator-sdk/internal/scaffold/input"
2929
"github.com/operator-framework/operator-sdk/internal/util/k8sutil"
30+
"github.com/operator-framework/operator-sdk/internal/util/projutil"
3031
"github.com/operator-framework/operator-sdk/internal/util/yamlutil"
3132

3233
"github.com/blang/semver"
@@ -392,7 +393,11 @@ func (s *CSV) updateCSVFromManifests(cfg *CSVConfig, csv *olmapiv1alpha1.Cluster
392393
case "Deployment":
393394
err = deployments(manifests).apply(csv)
394395
case "CustomResourceDefinition":
395-
err = crds(manifests).apply(csv)
396+
// TODO(estroz): customresourcedefinition should not be updated for
397+
// Ansible and Helm CSV's until annotated updates are implemented.
398+
if projutil.IsOperatorGo() {
399+
err = crds(manifests).apply(csv)
400+
}
396401
default:
397402
if _, ok := crGVKSet[gvk]; ok {
398403
crUpdaters = append(crUpdaters, manifests...)

0 commit comments

Comments
 (0)