Exemple #1
0
 public KubernetesClient(IKubernetesConfigProvider configProvider, IWatchdogStatusAggregator statusAggregator, ILoggerFactory loggerFactory, IAutoCraneConfig config, IDurationParser durationParser)
 {
     this.logger           = loggerFactory.CreateLogger <KubernetesClient>();
     this.client           = new Kubernetes(configProvider.Get());
     this.statusAggregator = statusAggregator;
     this.config           = config;
     this.durationParser   = durationParser;
 }
Exemple #2
0
            public DataRepositoryUpgradeOracle(DataRepositoryKnownGoods knownGoods, DataRepositoryLatestVersionInfo latestVersionInfo, IReadOnlyList <PodDataRequestInfo> pods, ILogger <DataRepositoryUpgradeOracle> logger, IClock clock, IWatchdogStatusAggregator watchdogStatusAggregator)
            {
                this.knownGoods        = knownGoods;
                this.latestVersionInfo = latestVersionInfo;
                this.pods   = pods;
                this.logger = logger;
                this.clock  = clock;
                this.watchdogStatusAggregator = watchdogStatusAggregator;

                // this is likely a list of data deployment daemonsets
                this.podsWithRepo = new Dictionary <string, List <PodDataRequestInfo> >();
                foreach (var pod in pods)
                {
                    foreach (var repoSpec in pod.DataSources)
                    {
                        if (!this.podsWithRepo.TryGetValue(repoSpec, out var list))
                        {
                            list = new List <PodDataRequestInfo>();
                            this.podsWithRepo[repoSpec] = list;
                        }

                        list.Add(pod);
                    }
                }

                // this is a list of pods mounting volumes to the daemonsets supplying the data
                // we look at their watchdogs
                this.podsDependingOnRepo = new Dictionary <string, List <PodDataRequestInfo> >();
                foreach (var pod in pods)
                {
                    foreach (var repo in pod.DependsOn)
                    {
                        if (!this.podsDependingOnRepo.TryGetValue(repo, out var list))
                        {
                            list = new List <PodDataRequestInfo>();
                            this.podsDependingOnRepo[repo] = list;
                        }

                        list.Add(pod);
                    }
                }
            }
Exemple #3
0
 public DataRepositoryUpgradeOracleFactory(ILoggerFactory loggerFactory, IClock clock, IWatchdogStatusAggregator watchdogStatusAggregator)
 {
     this.logger = loggerFactory.CreateLogger <DataRepositoryUpgradeOracle>();
     this.clock  = clock;
     this.watchdogStatusAggregator = watchdogStatusAggregator;
 }