Skip to content

Commit e18d0b2

Browse files
Merge pull request #456 from openshift-bot/synchronize-upstream
NO-ISSUE: Synchronize From Upstream Repositories
2 parents edb1b3e + 828914c commit e18d0b2

File tree

179 files changed

+23834
-3248
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

179 files changed

+23834
-3248
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ Please follow this style to make the operator-controller project easier to revie
151151

152152
### Go version
153153

154-
Our goal is to minimize disruption by requiring the lowest possible Go language version. This means avoiding updaties to the go version specified in [go.mod](go.mod) (and other locations).
154+
Our goal is to minimize disruption by requiring the lowest possible Go language version. This means avoiding updaties to the go version specified in the project's `go.mod` file (and other locations).
155155
156156
There is a GitHub PR CI job named `go-verdiff` that will inform a PR author if the Go language version has been updated. It is not a required test, but failures should prompt authors and reviewers to have a discussion with the community about the Go language version change.
157157

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ VENVDIR := $(abspath docs/.venv)
483483
.PHONY: build-docs
484484
build-docs: venv
485485
. $(VENV)/activate; \
486-
mkdocs build
486+
mkdocs build --strict
487487

488488
.PHONY: serve-docs
489489
serve-docs: venv
@@ -493,7 +493,7 @@ serve-docs: venv
493493
.PHONY: deploy-docs
494494
deploy-docs: venv
495495
. $(VENV)/activate; \
496-
mkdocs gh-deploy --force
496+
mkdocs gh-deploy --force --strict
497497

498498
# The demo script requires to install asciinema with: brew install asciinema to run on mac os envs.
499499
# Please ensure that all demos are named with the demo name and the suffix -demo-script.sh

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
[![unit-test](https://github.com/operator-framework/operator-controller/actions/workflows/unit-test.yaml/badge.svg)](https://github.com/operator-framework/operator-controller/actions/workflows/unit-test.yaml)
2+
[![e2e](https://github.com/operator-framework/operator-controller/actions/workflows/e2e.yaml/badge.svg)](https://github.com/operator-framework/operator-controller/actions/workflows/e2e.yaml)
3+
[![codecov](https://codecov.io/gh/operator-framework/operator-controller/graph/badge.svg?token=5f34zaWaN7)](https://codecov.io/gh/operator-framework/operator-controller)
4+
15
# operator-controller
26
The operator-controller is the central component of Operator Lifecycle Manager (OLM) v1.
37
It extends Kubernetes with an API through which users can install extensions.

api/v1/clusterextension_types.go

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ limitations under the License.
1717
package v1
1818

1919
import (
20+
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
2021
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2122
)
2223

@@ -25,6 +26,8 @@ var ClusterExtensionKind = "ClusterExtension"
2526
type (
2627
UpgradeConstraintPolicy string
2728
CRDUpgradeSafetyEnforcement string
29+
30+
ClusterExtensionConfigType string
2831
)
2932

3033
const (
@@ -39,6 +42,8 @@ const (
3942
// Use with caution as this can lead to unknown and potentially
4043
// disastrous results such as data loss.
4144
UpgradeConstraintPolicySelfCertified UpgradeConstraintPolicy = "SelfCertified"
45+
46+
ClusterExtensionConfigTypeInline ClusterExtensionConfigType = "Inline"
4247
)
4348

4449
// ClusterExtensionSpec defines the desired state of ClusterExtension
@@ -92,6 +97,15 @@ type ClusterExtensionSpec struct {
9297
//
9398
// +optional
9499
Install *ClusterExtensionInstallConfig `json:"install,omitempty"`
100+
101+
// config contains optional configuration values applied during rendering of the
102+
// ClusterExtension's manifests. Values can be specified inline.
103+
//
104+
// config is optional. When not specified, the default configuration of the resolved bundle will be used.
105+
//
106+
// <opcon:experimental>
107+
// +optional
108+
Config *ClusterExtensionConfig `json:"config,omitempty"`
95109
}
96110

97111
const SourceTypeCatalog = "Catalog"
@@ -138,6 +152,34 @@ type ClusterExtensionInstallConfig struct {
138152
Preflight *PreflightConfig `json:"preflight,omitempty"`
139153
}
140154

155+
// ClusterExtensionConfig is a discriminated union which selects the source configuration values to be merged into
156+
// the ClusterExtension's rendered manifests.
157+
//
158+
// +kubebuilder:validation:XValidation:rule="has(self.configType) && self.configType == 'Inline' ?has(self.inline) : !has(self.inline)",message="inline is required when configType is Inline, and forbidden otherwise"
159+
// +union
160+
type ClusterExtensionConfig struct {
161+
// configType is a required reference to the type of configuration source.
162+
//
163+
// Allowed values are "Inline"
164+
//
165+
// When this field is set to "Inline", the cluster extension configuration is defined inline within the
166+
// ClusterExtension resource.
167+
//
168+
// +unionDiscriminator
169+
// +kubebuilder:validation:Enum:="Inline"
170+
// +kubebuilder:validation:Required
171+
ConfigType ClusterExtensionConfigType `json:"configType"`
172+
173+
// inline contains JSON or YAML values specified directly in the
174+
// ClusterExtension.
175+
//
176+
// inline must be set if configType is 'Inline'.
177+
//
178+
// +kubebuilder:validation:Type=object
179+
// +optional
180+
Inline *apiextensionsv1.JSON `json:"inline,omitempty"`
181+
}
182+
141183
// CatalogFilter defines the attributes used to identify and filter content from a catalog.
142184
type CatalogFilter struct {
143185
// packageName is a reference to the name of the package to be installed

api/v1/zz_generated.deepcopy.go

Lines changed: 24 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

commitchecker.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
expectedMergeBase: 07bd008eaadcebf79415cb360205c73b420666e1
1+
expectedMergeBase: b4aeb921ef4cdfd7d4ae49da78ee62c313e8bbac
22
upstreamBranch: main
33
upstreamOrg: operator-framework
44
upstreamRepo: operator-controller

config/base/operator-controller/crd/experimental/olm.operatorframework.io_clusterextensions.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,40 @@ spec:
5757
description: spec is an optional field that defines the desired state
5858
of the ClusterExtension.
5959
properties:
60+
config:
61+
description: |-
62+
config contains optional configuration values applied during rendering of the
63+
ClusterExtension's manifests. Values can be specified inline.
64+
65+
config is optional. When not specified, the default configuration of the resolved bundle will be used.
66+
properties:
67+
configType:
68+
description: |-
69+
configType is a required reference to the type of configuration source.
70+
71+
Allowed values are "Inline"
72+
73+
When this field is set to "Inline", the cluster extension configuration is defined inline within the
74+
ClusterExtension resource.
75+
enum:
76+
- Inline
77+
type: string
78+
inline:
79+
description: |-
80+
inline contains JSON or YAML values specified directly in the
81+
ClusterExtension.
82+
83+
inline must be set if configType is 'Inline'.
84+
type: object
85+
x-kubernetes-preserve-unknown-fields: true
86+
required:
87+
- configType
88+
type: object
89+
x-kubernetes-validations:
90+
- message: inline is required when configType is Inline, and forbidden
91+
otherwise
92+
rule: 'has(self.configType) && self.configType == ''Inline'' ?has(self.inline)
93+
: !has(self.inline)'
6094
install:
6195
description: |-
6296
install is an optional field used to configure the installation options

docs/api-reference/olmv1-api-reference.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,40 @@ _Appears in:_
239239
| `status` _[ClusterExtensionStatus](#clusterextensionstatus)_ | status is an optional field that defines the observed state of the ClusterExtension. | | |
240240

241241

242+
#### ClusterExtensionConfig
243+
244+
245+
246+
ClusterExtensionConfig is a discriminated union which selects the source configuration values to be merged into
247+
the ClusterExtension's rendered manifests.
248+
249+
250+
251+
_Appears in:_
252+
- [ClusterExtensionSpec](#clusterextensionspec)
253+
254+
| Field | Description | Default | Validation |
255+
| --- | --- | --- | --- |
256+
| `configType` _[ClusterExtensionConfigType](#clusterextensionconfigtype)_ | configType is a required reference to the type of configuration source.<br /><br />Allowed values are "Inline"<br /><br />When this field is set to "Inline", the cluster extension configuration is defined inline within the<br />ClusterExtension resource. | | Enum: [Inline] <br />Required: \{\} <br /> |
257+
| `inline` _[JSON](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.31/#json-v1-apiextensions-k8s-io)_ | inline contains JSON or YAML values specified directly in the<br />ClusterExtension.<br /><br />inline must be set if configType is 'Inline'. | | Type: object <br /> |
258+
259+
260+
#### ClusterExtensionConfigType
261+
262+
_Underlying type:_ _string_
263+
264+
265+
266+
267+
268+
_Appears in:_
269+
- [ClusterExtensionConfig](#clusterextensionconfig)
270+
271+
| Field | Description |
272+
| --- | --- |
273+
| `Inline` | |
274+
275+
242276
#### ClusterExtensionInstallConfig
243277

244278

@@ -309,6 +343,7 @@ _Appears in:_
309343
| `serviceAccount` _[ServiceAccountReference](#serviceaccountreference)_ | serviceAccount is a reference to a ServiceAccount used to perform all interactions<br />with the cluster that are required to manage the extension.<br />The ServiceAccount must be configured with the necessary permissions to perform these interactions.<br />The ServiceAccount must exist in the namespace referenced in the spec.<br />serviceAccount is required. | | Required: \{\} <br /> |
310344
| `source` _[SourceConfig](#sourceconfig)_ | source is a required field which selects the installation source of content<br />for this ClusterExtension. Selection is performed by setting the sourceType.<br /><br />Catalog is currently the only implemented sourceType, and setting the<br />sourcetype to "Catalog" requires the catalog field to also be defined.<br /><br />Below is a minimal example of a source definition (in yaml):<br /><br />source:<br /> sourceType: Catalog<br /> catalog:<br /> packageName: example-package | | Required: \{\} <br /> |
311345
| `install` _[ClusterExtensionInstallConfig](#clusterextensioninstallconfig)_ | install is an optional field used to configure the installation options<br />for the ClusterExtension such as the pre-flight check configuration. | | |
346+
| `config` _[ClusterExtensionConfig](#clusterextensionconfig)_ | config contains optional configuration values applied during rendering of the<br />ClusterExtension's manifests. Values can be specified inline.<br /><br />config is optional. When not specified, the default configuration of the resolved bundle will be used.<br /><br /><opcon:experimental> | | |
312347

313348

314349
#### ClusterExtensionStatus

docs/draft/api-reference/catalogd-webserver-metas-endpoint.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ As an example, to access only the [package schema](https://olm.operatorframework
3131

3232
the URL to access the service would be `https://catalogd-service.olmv1-system.svc/catalogs/operatorhubio/api/v1/metas?schema=olm.package`
3333

34-
For more examples of valid queries that can be made to the `api/v1/metas` service endpoint, please see [Catalog Queries](../howto/catalog-queries.md).
34+
For more examples of valid queries that can be made to the `api/v1/metas` service endpoint, please see [Catalog Queries](../../howto/catalog-queries.md).
3535

3636
!!! note
3737

docs/draft/howto/catalog-queries-metas-endpoint.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Catalog queries
22

3-
After you [add a catalog of extensions](../tutorials/add-catalog.md) to your cluster, you must port forward your catalog as a service.
3+
After you [add a catalog of extensions](../../tutorials/add-catalog.md) to your cluster, you must port forward your catalog as a service.
44
Then you can query the catalog by using `curl` commands and the `jq` CLI tool to find extensions to install.
55

66
## Prerequisites

0 commit comments

Comments
 (0)