blob: 1a7473163a4272473a95e4c9f654ea1fc6048a4a [file] [log] [blame]
Giorgi Lekveishvili7fb28bf2023-06-24 19:51:16 +04001package main
2
3import (
4 "github.com/giolekva/pcloud/core/installer"
giof6ad2982024-08-23 17:42:49 +04005 "github.com/giolekva/pcloud/core/installer/kube"
Giorgi Lekveishvili7fb28bf2023-06-24 19:51:16 +04006)
7
8func newNSCreator() (installer.NamespaceCreator, error) {
giof6ad2982024-08-23 17:42:49 +04009 return installer.NewNamespaceCreator(kube.KubeConfigOpts{
10 KubeConfigPath: rootFlags.kubeConfig,
11 })
Giorgi Lekveishvilicd9e42c2023-12-13 09:49:44 +040012}
13
14func newZoneFetcher() (installer.ZoneStatusFetcher, error) {
15 return installer.NewZoneStatusFetcher(rootFlags.kubeConfig)
Giorgi Lekveishvili7fb28bf2023-06-24 19:51:16 +040016}
gio778577f2024-04-29 09:44:38 +040017
18func newHelmReleaseMonitor() (installer.HelmReleaseMonitor, error) {
19 return installer.NewHelmReleaseMonitor(rootFlags.kubeConfig)
20}
giof8843412024-05-22 16:38:05 +040021
22func newJobCreator() (installer.JobCreator, error) {
giof6ad2982024-08-23 17:42:49 +040023 clientset, err := kube.NewKubeClient(kube.KubeConfigOpts{
24 KubeConfigPath: rootFlags.kubeConfig,
25 })
giof8843412024-05-22 16:38:05 +040026 if err != nil {
27 return nil, err
28 }
29 return installer.NewJobCreator(clientset.BatchV1()), nil
30}