1
0
mirror of https://github.com/rancher/rke.git synced 2025-09-01 15:06:23 +00:00

Refactor reconcilation

Add role based add/delete for services

Use pointers for hosts

Consistent log format
This commit is contained in:
galal-hussein
2017-12-01 01:16:45 +02:00
parent 7699c6b5f0
commit d1f78f0b40
20 changed files with 341 additions and 202 deletions

View File

@@ -14,7 +14,7 @@ import (
"github.com/sirupsen/logrus"
)
func DeployCertificatesOnMasters(cpHosts []hosts.Host, crtMap map[string]CertificatePKI) error {
func DeployCertificatesOnMasters(cpHosts []*hosts.Host, crtMap map[string]CertificatePKI) error {
// list of certificates that should be deployed on the masters
crtList := []string{
CACertName,
@@ -31,7 +31,7 @@ func DeployCertificatesOnMasters(cpHosts []hosts.Host, crtMap map[string]Certifi
}
for i := range cpHosts {
err := doRunDeployer(&cpHosts[i], env)
err := doRunDeployer(cpHosts[i], env)
if err != nil {
return err
}
@@ -39,7 +39,7 @@ func DeployCertificatesOnMasters(cpHosts []hosts.Host, crtMap map[string]Certifi
return nil
}
func DeployCertificatesOnWorkers(workerHosts []hosts.Host, crtMap map[string]CertificatePKI) error {
func DeployCertificatesOnWorkers(workerHosts []*hosts.Host, crtMap map[string]CertificatePKI) error {
// list of certificates that should be deployed on the workers
crtList := []string{
CACertName,
@@ -53,7 +53,7 @@ func DeployCertificatesOnWorkers(workerHosts []hosts.Host, crtMap map[string]Cer
}
for i := range workerHosts {
err := doRunDeployer(&workerHosts[i], env)
err := doRunDeployer(workerHosts[i], env)
if err != nil {
return err
}
@@ -75,7 +75,7 @@ func doRunDeployer(host *hosts.Host, containerEnv []string) error {
Binds: []string{
"/etc/kubernetes:/etc/kubernetes",
},
Privileged: true,
Privileged: true,
}
resp, err := host.DClient.ContainerCreate(context.Background(), imageCfg, hostCfg, nil, CrtDownloaderContainer)
if err != nil {