Skip to content

Commit

Permalink
scheduler: allow to specify namespace
Browse files Browse the repository at this point in the history
This change good in general, but also will help with implementing the scheduler deployment in NROP.
The change is completely optional and won't change the default behavior

Signed-off-by: Talor Itzhak <titzhak@redhat.com>
  • Loading branch information
Tal-or committed Dec 16, 2021
1 parent 881e130 commit b268f4d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/manifests/sched/sched.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,10 @@ func (mf Manifests) Clone() Manifests {
type UpdateOptions struct {
Replicas int32
PullIfNotPresent bool
Namespace string
}

func (mf Manifests) Update(logger tlog.Logger, options UpdateOptions) Manifests {
func (mf Manifests) Update(options UpdateOptions) Manifests {
ret := mf.Clone()
replicas := options.Replicas
if replicas <= 0 {
Expand All @@ -96,6 +97,10 @@ func (mf Manifests) Update(logger tlog.Logger, options UpdateOptions) Manifests
ret.Namespace.Name = NamespaceOpenShift
}

if options.Namespace != "" {
ret.Namespace.Name = options.Namespace
}

ret.SAController.Namespace = ret.Namespace.Name
manifests.UpdateClusterRoleBinding(ret.CRBController, ret.SAController.Name, ret.Namespace.Name)
manifests.UpdateRoleBinding(ret.RBController, ret.SAController.Name, ret.Namespace.Name)
Expand Down

0 comments on commit b268f4d

Please sign in to comment.