Skip to content

Commit

Permalink
removed preview from ManagedServiceAccount (#494)
Browse files Browse the repository at this point in the history
* managedserviceaccount is now default, and -preview will function in place of default during Reconcile loop

Signed-off-by: Nathaniel Graham <[[email protected], [email protected]]>

* if the preview version was pruned, enable non-preview

Signed-off-by: Nathaniel Graham <[[email protected], [email protected]]>

* comments

Signed-off-by: Nathaniel Graham <[[email protected], [email protected]]>

* moved enable / disable logic to separate statement

Signed-off-by: Nathaniel Graham <[[email protected], [email protected]]>

* removed -preview from offComponents in utils.go

Signed-off-by: Nathaniel Graham <[[email protected], [email protected]]>

---------

Signed-off-by: Nathaniel Graham <[[email protected], [email protected]]>
Co-authored-by: Nathaniel Graham <[[email protected], [email protected]]>
  • Loading branch information
ngraham20 and Nathaniel Graham authored Sep 6, 2023
1 parent 8f52b37 commit 41d1077
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 13 deletions.
28 changes: 15 additions & 13 deletions api/v1/multiclusterengine_methods.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,20 @@ limitations under the License.
package v1

const (
ManagedServiceAccount = "managedserviceaccount-preview"
ConsoleMCE = "console-mce"
Discovery = "discovery"
Hive = "hive"
AssistedService = "assisted-service"
ClusterLifecycle = "cluster-lifecycle"
ClusterManager = "cluster-manager"
ServerFoundation = "server-foundation"
HyperShift = "hypershift"
HyperShiftPreview = "hypershift-preview"
ClusterProxyAddon = "cluster-proxy-addon"
HypershiftLocalHosting = "hypershift-local-hosting"
LocalCluster = "local-cluster"
ManagedServiceAccount = "managedserviceaccount"
ManagedServiceAccountPreview = "managedserviceaccount-preview"
ConsoleMCE = "console-mce"
Discovery = "discovery"
Hive = "hive"
AssistedService = "assisted-service"
ClusterLifecycle = "cluster-lifecycle"
ClusterManager = "cluster-manager"
ServerFoundation = "server-foundation"
HyperShift = "hypershift"
HyperShiftPreview = "hypershift-preview"
ClusterProxyAddon = "cluster-proxy-addon"
HypershiftLocalHosting = "hypershift-local-hosting"
LocalCluster = "local-cluster"
)

var allComponents = []string{
Expand All @@ -43,6 +44,7 @@ var allComponents = []string{
ServerFoundation,
ConsoleMCE,
ManagedServiceAccount,
ManagedServiceAccountPreview,
HyperShift,
HyperShiftPreview,
HypershiftLocalHosting,
Expand Down
12 changes: 12 additions & 0 deletions controllers/backplaneconfig_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1038,6 +1038,18 @@ func (r *MultiClusterEngineReconciler) setDefaults(ctx context.Context, m *backp
updateNecessary = true
}

if m.Enabled(backplanev1.ManagedServiceAccountPreview) {
// if the preview was pruned, enable the non-preview version instead
m.Enable(backplanev1.ManagedServiceAccount)
// no need to disable -preview version, as it will get pruned below
updateNecessary = true
}

// managedserviceaccount preview component upgraded in 2.9.0
if m.Prune(backplanev1.ManagedServiceAccountPreview) {
updateNecessary = true
}

if utils.DeduplicateComponents(m) {
updateNecessary = true
}
Expand Down

0 comments on commit 41d1077

Please sign in to comment.