Skip to content

Commit 8f4d36c

Browse files
committed
Use profile from environment variable CLUSTER_PROFILE
1 parent d4700fb commit 8f4d36c

24 files changed

+261
-125
lines changed

hack/cluster-version-util/task_graph.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func newTaskGraphCmd() *cobra.Command {
3030

3131
func runTaskGraphCmd(cmd *cobra.Command, args []string) error {
3232
manifestDir := args[0]
33-
release, err := payload.LoadUpdate(manifestDir, "", "")
33+
release, err := payload.LoadUpdate(manifestDir, "", "", payload.DefaultClusterProfile)
3434
if err != nil {
3535
return err
3636
}

pkg/cvo/cvo.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ type Operator struct {
148148
// exclude is an optional identifier used to exclude certain manifests
149149
// via annotation
150150
exclude string
151+
152+
clusterProfile string
151153
}
152154

153155
// New returns a new cluster version operator.
@@ -166,6 +168,7 @@ func New(
166168
client clientset.Interface,
167169
kubeClient kubernetes.Interface,
168170
exclude string,
171+
clusterProfile string,
169172
) *Operator {
170173
eventBroadcaster := record.NewBroadcaster()
171174
eventBroadcaster.StartLogging(klog.Infof)
@@ -194,7 +197,8 @@ func New(
194197
availableUpdatesQueue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "availableupdates"),
195198
upgradeableQueue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "upgradeable"),
196199

197-
exclude: exclude,
200+
exclude: exclude,
201+
clusterProfile: clusterProfile,
198202
}
199203

200204
cvInformer.Informer().AddEventHandler(optr.eventHandler())
@@ -219,7 +223,7 @@ func New(
219223
// controller that loads and applies content to the cluster. It returns an error if the payload appears to
220224
// be in error rather than continuing.
221225
func (optr *Operator) InitializeFromPayload(restConfig *rest.Config, burstRestConfig *rest.Config) error {
222-
update, err := payload.LoadUpdate(optr.defaultPayloadDir(), optr.release.Image, optr.exclude)
226+
update, err := payload.LoadUpdate(optr.defaultPayloadDir(), optr.release.Image, optr.exclude, optr.clusterProfile)
223227
if err != nil {
224228
return fmt.Errorf("the local release contents are invalid - no current version can be determined from disk: %v", err)
225229
}
@@ -261,6 +265,7 @@ func (optr *Operator) InitializeFromPayload(restConfig *rest.Config, burstRestCo
261265
},
262266
optr.exclude,
263267
optr.eventRecorder,
268+
optr.clusterProfile,
264269
)
265270

266271
return nil

0 commit comments

Comments
 (0)