From 8dae24a49e20bbc687ebcc8a75ccf8320300374f Mon Sep 17 00:00:00 2001 From: Talor Itzhak Date: Sun, 22 Sep 2024 18:38:01 +0300 Subject: [PATCH] hypershift: check for platform There are places where the deployer should behave the same for OpenShift and HyperShift. For example when it sets the selinux policy. Hence, we want to add `platform.HyperShift` under the check. Signed-off-by: Talor Itzhak --- pkg/manifests/rte/rte.go | 4 ++-- pkg/manifests/sched/sched.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/manifests/rte/rte.go b/pkg/manifests/rte/rte.go index e5e95161..72637e7c 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 != "" { 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 }