mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-10-01 01:36:09 -04:00
image: set runtime-endpoint in crictl config (#821)
Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
This commit is contained in:
parent
942d11a4c8
commit
b9a1a9ae5e
@ -244,11 +244,13 @@ type SetupPodNetworkInput struct {
|
||||
// FixCilium fixes https://github.com/cilium/cilium/issues/19958 but instead of a rollout restart of
|
||||
// the cilium daemonset, it only restarts the local cilium pod.
|
||||
func (k *KubernetesUtil) FixCilium(log *logger.Logger) {
|
||||
ctx := context.Background()
|
||||
|
||||
// wait for cilium pod to be healthy
|
||||
client := http.Client{}
|
||||
for {
|
||||
time.Sleep(5 * time.Second)
|
||||
req, err := http.NewRequestWithContext(context.Background(), http.MethodGet, "http://127.0.0.1:9879/healthz", http.NoBody)
|
||||
req, err := http.NewRequestWithContext(ctx, http.MethodGet, "http://127.0.0.1:9879/healthz", http.NoBody)
|
||||
if err != nil {
|
||||
log.With(zap.Error(err)).Errorf("Unable to create request")
|
||||
continue
|
||||
@ -265,7 +267,7 @@ func (k *KubernetesUtil) FixCilium(log *logger.Logger) {
|
||||
}
|
||||
|
||||
// get cilium container id
|
||||
out, err := exec.CommandContext(context.Background(), "/run/state/bin/crictl", "ps", "--name", "cilium-agent", "-q").CombinedOutput()
|
||||
out, err := exec.CommandContext(ctx, "/run/state/bin/crictl", "ps", "--name", "cilium-agent", "-q").CombinedOutput()
|
||||
if err != nil {
|
||||
log.With(zap.Error(err)).Errorf("Getting cilium container id failed: %s", out)
|
||||
return
|
||||
@ -278,7 +280,7 @@ func (k *KubernetesUtil) FixCilium(log *logger.Logger) {
|
||||
containerID := outLines[len(outLines)-2]
|
||||
|
||||
// get cilium pod id
|
||||
out, err = exec.CommandContext(context.Background(), "/run/state/bin/crictl", "inspect", "-o", "go-template", "--template", "{{ .info.sandboxID }}", containerID).CombinedOutput()
|
||||
out, err = exec.CommandContext(ctx, "/run/state/bin/crictl", "inspect", "-o", "go-template", "--template", "{{ .info.sandboxID }}", containerID).CombinedOutput()
|
||||
if err != nil {
|
||||
log.With(zap.Error(err)).Errorf("Getting cilium pod id failed: %s", out)
|
||||
return
|
||||
@ -291,12 +293,12 @@ func (k *KubernetesUtil) FixCilium(log *logger.Logger) {
|
||||
podID := outLines[len(outLines)-2]
|
||||
|
||||
// stop and delete pod
|
||||
out, err = exec.CommandContext(context.Background(), "/run/state/bin/crictl", "stopp", podID).CombinedOutput()
|
||||
out, err = exec.CommandContext(ctx, "/run/state/bin/crictl", "stopp", podID).CombinedOutput()
|
||||
if err != nil {
|
||||
log.With(zap.Error(err)).Errorf("Stopping cilium agent pod failed: %s", out)
|
||||
return
|
||||
}
|
||||
out, err = exec.CommandContext(context.Background(), "/run/state/bin/crictl", "rmp", podID).CombinedOutput()
|
||||
out, err = exec.CommandContext(ctx, "/run/state/bin/crictl", "rmp", podID).CombinedOutput()
|
||||
if err != nil {
|
||||
log.With(zap.Error(err)).Errorf("Removing cilium agent pod failed: %s", out)
|
||||
}
|
||||
|
1
image/mkosi.skeleton/etc/crictl.yaml
Normal file
1
image/mkosi.skeleton/etc/crictl.yaml
Normal file
@ -0,0 +1 @@
|
||||
runtime-endpoint: "unix:///run/containerd/containerd.sock"
|
Loading…
Reference in New Issue
Block a user