diff --git a/pkg/commands/deploy.go b/pkg/commands/deploy.go index ef7e7299..cc75c0e2 100644 --- a/pkg/commands/deploy.go +++ b/pkg/commands/deploy.go @@ -145,12 +145,13 @@ func NewDeployTopologyUpdaterCommand(env *deployer.Environment, commonOpts *opti env.Log.V(3).Info("detection", "platform", commonOpts.ClusterPlatform, "reason", reason, "version", commonOpts.ClusterVersion, "source", source) return updaters.Deploy(env, commonOpts.UpdaterType, options.Updater{ - Platform: commonOpts.ClusterPlatform, - PlatformVersion: commonOpts.ClusterVersion, - WaitCompletion: commonOpts.WaitCompletion, - RTEConfigData: commonOpts.RTEConfigData, - DaemonSet: options.ForDaemonSet(commonOpts), - EnableCRIHooks: commonOpts.UpdaterCRIHooksEnable, + Platform: commonOpts.ClusterPlatform, + PlatformVersion: commonOpts.ClusterVersion, + WaitCompletion: commonOpts.WaitCompletion, + RTEConfigData: commonOpts.RTEConfigData, + DaemonSet: options.ForDaemonSet(commonOpts), + EnableCRIHooks: commonOpts.UpdaterCRIHooksEnable, + CustomSELinuxPolicy: commonOpts.UpdaterCustomSELinuxPolicy, }) }, Args: cobra.NoArgs, diff --git a/pkg/commands/remove.go b/pkg/commands/remove.go index 49e8e258..bae2ee8a 100644 --- a/pkg/commands/remove.go +++ b/pkg/commands/remove.go @@ -201,12 +201,13 @@ func NewRemoveTopologyUpdaterCommand(env *deployer.Environment, commonOpts *opti env.Log.V(3).Info("detection", "platform", commonOpts.ClusterPlatform, "reason", reason, "version", commonOpts.ClusterVersion, "source", source) return updaters.Remove(env, commonOpts.UpdaterType, options.Updater{ - Platform: commonOpts.ClusterPlatform, - PlatformVersion: commonOpts.ClusterVersion, - WaitCompletion: commonOpts.WaitCompletion, - RTEConfigData: commonOpts.RTEConfigData, - DaemonSet: options.ForDaemonSet(commonOpts), - EnableCRIHooks: commonOpts.UpdaterCRIHooksEnable, + Platform: commonOpts.ClusterPlatform, + PlatformVersion: commonOpts.ClusterVersion, + WaitCompletion: commonOpts.WaitCompletion, + RTEConfigData: commonOpts.RTEConfigData, + DaemonSet: options.ForDaemonSet(commonOpts), + EnableCRIHooks: commonOpts.UpdaterCRIHooksEnable, + CustomSELinuxPolicy: commonOpts.UpdaterCustomSELinuxPolicy, }) }, Args: cobra.NoArgs, diff --git a/pkg/deploy/cluster.go b/pkg/deploy/cluster.go index 1d8a0e9c..05a4164d 100644 --- a/pkg/deploy/cluster.go +++ b/pkg/deploy/cluster.go @@ -51,12 +51,13 @@ func OnCluster(env *deployer.Environment, commonOpts *options.Options) error { return err } if err := updaters.Deploy(env, commonOpts.UpdaterType, options.Updater{ - Platform: commonOpts.ClusterPlatform, - PlatformVersion: commonOpts.ClusterVersion, - WaitCompletion: commonOpts.WaitCompletion, - RTEConfigData: commonOpts.RTEConfigData, - DaemonSet: options.ForDaemonSet(commonOpts), - EnableCRIHooks: commonOpts.UpdaterCRIHooksEnable, + Platform: commonOpts.ClusterPlatform, + PlatformVersion: commonOpts.ClusterVersion, + WaitCompletion: commonOpts.WaitCompletion, + RTEConfigData: commonOpts.RTEConfigData, + DaemonSet: options.ForDaemonSet(commonOpts), + EnableCRIHooks: commonOpts.UpdaterCRIHooksEnable, + CustomSELinuxPolicy: commonOpts.UpdaterCustomSELinuxPolicy, }); err != nil { return err } diff --git a/pkg/deployer/platform/detect/detect.go b/pkg/deployer/platform/detect/detect.go index 12d9deb4..bda33efb 100644 --- a/pkg/deployer/platform/detect/detect.go +++ b/pkg/deployer/platform/detect/detect.go @@ -112,7 +112,7 @@ func PlatformFromClients(ctx context.Context, cvLister ClusterVersionsLister, in } func Version(ctx context.Context, plat platform.Platform) (platform.Version, error) { - if plat == platform.OpenShift { + if plat == platform.OpenShift || plat == platform.HyperShift { return OpenshiftVersion(ctx) } return KubernetesVersion(ctx) diff --git a/pkg/manifests/rte/rte.go b/pkg/manifests/rte/rte.go index e5e95161..1577d4bc 100644 --- a/pkg/manifests/rte/rte.go +++ b/pkg/manifests/rte/rte.go @@ -68,7 +68,7 @@ func (mf Manifests) Clone() Manifests { ConfigMap: mf.ConfigMap.DeepCopy(), } - if mf.plat == platform.OpenShift { + if mf.plat == platform.OpenShift || mf.plat == platform.HyperShift { // MachineConfig is obsolete starting from OCP v4.18 if mf.MachineConfig != nil { ret.MachineConfig = mf.MachineConfig.DeepCopy() @@ -111,7 +111,7 @@ func (mf Manifests) Render(opts options.UpdaterDaemon) (Manifests, error) { } rteupdate.DaemonSet(ret.DaemonSet, mf.plat, rteConfigMapName, opts.DaemonSet) - if mf.plat == platform.OpenShift { + if mf.plat == platform.OpenShift || mf.plat == platform.HyperShift { selinuxType := selinuxassets.RTEContextType if mf.MachineConfig != nil { if opts.Name != "" { @@ -185,7 +185,7 @@ func GetManifests(plat platform.Platform, version platform.Version, namespace st var err error mf := New(plat) - if plat == platform.OpenShift { + if plat == platform.OpenShift || plat == platform.HyperShift { if withCustomSELinuxPolicy { mf.MachineConfig, err = manifests.MachineConfig(manifests.ComponentResourceTopologyExporter, version, withCRIHooks) if err != nil { diff --git a/pkg/manifests/sched/sched.go b/pkg/manifests/sched/sched.go index a6cfd9a6..3a595c23 100644 --- a/pkg/manifests/sched/sched.go +++ b/pkg/manifests/sched/sched.go @@ -145,7 +145,7 @@ func (mf Manifests) Render(logger logr.Logger, opts options.Scheduler) (Manifest schedupdate.ControllerDeployment(ret.DPController, opts.PullIfNotPresent, opts.CtrlPlaneAffinity) if opts.Namespace != "" { ret.Namespace.Name = opts.Namespace - } else if mf.plat == platform.OpenShift { + } else if mf.plat == platform.OpenShift || mf.plat == platform.HyperShift { ret.Namespace.Name = NamespaceOpenShift }