From f4ac38987eabd5139f9636574b056c5461e9596a Mon Sep 17 00:00:00 2001 From: Phil Nichol <35630607+philnichol@users.noreply.github.com> Date: Fri, 11 Feb 2022 00:05:15 +0000 Subject: [PATCH] added additionalNodeSelector to manifestgen options Signed-off-by: Phil Nichol <35630607+philnichol@users.noreply.github.com> --- pkg/manifestgen/install/options.go | 35 ++++++++++++++-------------- pkg/manifestgen/install/templates.go | 3 +++ 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/pkg/manifestgen/install/options.go b/pkg/manifestgen/install/options.go index a456007b..e37b5e84 100644 --- a/pkg/manifestgen/install/options.go +++ b/pkg/manifestgen/install/options.go @@ -19,23 +19,24 @@ package install import "time" type Options struct { - BaseURL string - Version string - Namespace string - Components []string - ComponentsExtra []string - EventsAddr string - Registry string - ImagePullSecret string - WatchAllNamespaces bool - NetworkPolicy bool - LogLevel string - NotificationController string - ManifestFile string - Timeout time.Duration - TargetPath string - ClusterDomain string - TolerationKeys []string + BaseURL string + Version string + Namespace string + Components []string + ComponentsExtra []string + EventsAddr string + Registry string + ImagePullSecret string + WatchAllNamespaces bool + NetworkPolicy bool + LogLevel string + NotificationController string + ManifestFile string + Timeout time.Duration + TargetPath string + ClusterDomain string + TolerationKeys []string + AdditionalNodeSelectors map[string]string } func MakeDefaultOptions() Options { diff --git a/pkg/manifestgen/install/templates.go b/pkg/manifestgen/install/templates.go index ac47cf27..b92a7aa6 100644 --- a/pkg/manifestgen/install/templates.go +++ b/pkg/manifestgen/install/templates.go @@ -133,6 +133,9 @@ spec: spec: nodeSelector: kubernetes.io/os: linux +{{- range $k, $v := .AdditionalNodeSelectors }} + {{$k}}: "{{$v}}" +{{- end }} {{- if .ImagePullSecret }} imagePullSecrets: - name: {{.ImagePullSecret}}