Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions internal/operator-controller/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ import (
"fmt"
"strings"

"github.com/operator-framework/api/pkg/operators/v1alpha1"

"github.com/santhosh-tekuri/jsonschema/v6"
"sigs.k8s.io/yaml"
)
Expand All @@ -47,6 +49,10 @@ const (
FormatSingleNamespaceInstallMode = "singleNamespaceInstallMode"
)

// DeploymentConfig is a type alias for v1alpha1.SubscriptionConfig
// to maintain clear naming in the OLMv1 context while reusing the v0 type.
type DeploymentConfig = v1alpha1.SubscriptionConfig
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we weren't going to use SubscriptionConfig because of the extra selector field?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the RFC:

NOTE: The v0 SubscriptionConfig struct also has a [Selector](https://github.com/operator-framework/api/blob/master/pkg/operators/v1alpha1/subscription_types.go#L47) field, however it is completely ignored by the v0 controller. According to the comment in the code, it was meant to: 
Select which pods/ReplicaSets would receive the subscription’s configuration
Match pod template labels(similar to Deployment selectors) 
However, the code that extracts subscription config overrides(pkg/controller/operators/olm/overrides/config.go) extracts all other fields like NodeSelector, Tolerations, Resources and are subsequently applied, but the Selector field is never extracted. 

OLMv1 will maintain the same behavior—accepting but ignoring this field.

Notice that there's no applySelectorConfig() function, so we're just ignoring that field.

With our wish to reuse v0 SubscriptionConfig for maintainability, we carry over nuance/s into v1. Silently ignoring the selector field being one of them.

We have to remember to document this explicitly for our users everywhere for added clarity.


// SchemaProvider lets each package format type describe what configuration it accepts.
//
// Different package format types provide schemas in different ways:
Expand Down
Loading
Loading