Skip to content

Commit

Permalink
Add etcd name file to hash files (#338)
Browse files Browse the repository at this point in the history
* Add etcd name file to hash files

* go mod and gofmt

* fixes
  • Loading branch information
galal-hussein authored Sep 19, 2020
1 parent f06b971 commit c33d859
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ require (
github.com/google/go-containerregistry v0.0.0-20190617215043-876b8855d23c
github.com/pkg/errors v0.9.1
github.com/rancher/helm-controller v0.7.3
github.com/rancher/k3s v1.19.1-rc2.0.20200916233211-b66760fccddd
github.com/rancher/k3s v1.19.2-0.20200919010936-46fe57d7e905
github.com/rancher/wrangler v0.6.1
github.com/sirupsen/logrus v1.6.0
github.com/urfave/cli v1.22.2
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -695,8 +695,8 @@ github.com/rancher/go-powershell v0.0.0-20200701184732-233247d45373 h1:BePi97poJ
github.com/rancher/go-powershell v0.0.0-20200701184732-233247d45373/go.mod h1:Vz8oLnHgttpo/aZrTpjbcpZEDzzElqNau2zmorToY0E=
github.com/rancher/helm-controller v0.7.3 h1:WTQHcNF2vl9w6Xd1eBtXDe0JUsYMFFstqX9ghGhI5Ac=
github.com/rancher/helm-controller v0.7.3/go.mod h1:ZylsxIMGNADRPRNW+NiBWhrwwks9vnKLQiCHYWb6Bi0=
github.com/rancher/k3s v1.19.1-rc2.0.20200916233211-b66760fccddd h1:BxaXJ6VOlfeKWvKsCrrbOG8TpHgvat9yxvkETfryxGY=
github.com/rancher/k3s v1.19.1-rc2.0.20200916233211-b66760fccddd/go.mod h1:KZ7cVGFco3Q8FfQGynHIZZ7MYVE+yPdk6TZB9s9YqWk=
github.com/rancher/k3s v1.19.2-0.20200919010936-46fe57d7e905 h1:5dVEwMzgk7/iTzhPXRdG50AsE8mwvtC210Exjfbr9rw=
github.com/rancher/k3s v1.19.2-0.20200919010936-46fe57d7e905/go.mod h1:KZ7cVGFco3Q8FfQGynHIZZ7MYVE+yPdk6TZB9s9YqWk=
github.com/rancher/kine v0.4.0 h1:1IhWy3TzjExG8xnj46eyUEWdzqNAD1WrgL4eEBKm6Uc=
github.com/rancher/kine v0.4.0/go.mod h1:IImtCJ68AIkE+VY/kUI0NkyJL5q5WzO8QvMsSXqbrpA=
github.com/rancher/kubernetes v1.19.0-k3s1 h1:TPFj4qlQgZ2E9xE/ScFLtBQoymxPNCXAYHJpSZYRW3o=
Expand Down
10 changes: 9 additions & 1 deletion pkg/podexecutor/staticpod.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ type StaticPodConfig struct {
Images images.Images
CloudProvider *CloudProviderConfig
CISMode bool
DataDir string
}

type CloudProviderConfig struct {
Expand Down Expand Up @@ -101,14 +102,14 @@ func (s *StaticPodConfig) APIServer(ctx context.Context, etcdReady <-chan struct
args = append(args[:i], args[i+1:]...)
}
}

after(etcdReady, func() error {
return staticpod.Run(s.ManifestsDir, staticpod.Args{
Command: "kube-apiserver",
Args: args,
Image: s.Images.KubeAPIServer,
Dirs: ssldirs,
CPUMillis: 250,
Files: []string{etcdNameFile(s.DataDir)},
})
})
return auth, http.NotFoundHandler(), err
Expand All @@ -127,6 +128,7 @@ func (s *StaticPodConfig) Scheduler(apiReady <-chan struct{}, args []string) err
HealthPort: 10251,
HealthProto: "HTTP",
CPUMillis: 100,
Files: []string{etcdNameFile(s.DataDir)},
})
})
}
Expand All @@ -149,6 +151,7 @@ func (s *StaticPodConfig) ControllerManager(apiReady <-chan struct{}, args []str
"--cloud-provider="+s.CloudProvider.Name,
"--cloud-config="+s.CloudProvider.Path)
}

if err := images.Pull(s.ImagesDir, "kube-controller-manager", s.Images.KubeControllManager); err != nil {
return err
}
Expand All @@ -163,6 +166,7 @@ func (s *StaticPodConfig) ControllerManager(apiReady <-chan struct{}, args []str
HealthPort: 10252,
HealthProto: "HTTP",
CPUMillis: 200,
Files: []string{etcdNameFile(s.DataDir)},
})
})
}
Expand Down Expand Up @@ -277,3 +281,7 @@ func chownr(path string, uid, gid int) error {
return err
})
}

func etcdNameFile(dataDir string) string {
return filepath.Join(dataDir, "server", "db", "etcd", "name")
}
1 change: 1 addition & 0 deletions pkg/rke2/rke2.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ func setup(clx *cli.Context, cfg Config) error {
ManifestsDir: agentManifestsDir,
CISMode: cisMode,
CloudProvider: cpConfig,
DataDir: dataDir,
}
executor.Set(&sp)

Expand Down

0 comments on commit c33d859

Please sign in to comment.