-
Notifications
You must be signed in to change notification settings - Fork 462
Use MCD binary from container in /run/bin #1766
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,5 @@ | ||
| #!/usr/bin/sh | ||
| exec /usr/libexec/machine-config-daemon pivot "$@" | ||
| set -xeuo pipefail | ||
| # This script just exists for "CLI compatibility" for admins | ||
| # to use interactively via ssh/oc debug node. | ||
| exec /run/bin/machine-config-daemon pivot "$@" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1280,9 +1280,25 @@ func (dn *Daemon) updateOS(config *mcfgv1.MachineConfig) error { | |
| } | ||
|
|
||
| glog.Infof("Updating OS to %s", newURL) | ||
| if err := dn.NodeUpdaterClient.RunPivot(newURL); err != nil { | ||
| MCDPivotErr.WithLabelValues(newURL, err.Error()).SetToCurrentTime() | ||
| return fmt.Errorf("failed to run pivot: %v", err) | ||
| // In the cluster case, for now we run indirectly via machine-config-daemon-host.service | ||
cgwalters marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| // for SELinux reasons, see https://bugzilla.redhat.com/show_bug.cgi?id=1839065 | ||
| if dn.kubeClient != nil { | ||
|
||
| if err := dn.NodeUpdaterClient.RunPivot(newURL); err != nil { | ||
| MCDPivotErr.WithLabelValues(newURL, err.Error()).SetToCurrentTime() | ||
| return fmt.Errorf("failed to run pivot: %v", err) | ||
| } | ||
| } else { | ||
| // If we're here we're invoked via `machine-config-daemon-firstboot.service`, so let's | ||
| // just run the update directly rather than invoking another service. | ||
| client := NewNodeUpdaterClient() | ||
| _, changed, err := client.PullAndRebase(newURL, false) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| if !changed { | ||
| // This really shouldn't happen | ||
| glog.Warningf("Didn't change when updating to %s ?", newURL) | ||
| } | ||
| } | ||
|
|
||
| return nil | ||
|
|
||
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| name: "machine-config-daemon-pull.service" | ||
| enabled: true | ||
| contents: | | ||
| [Unit] | ||
| Description=Machine Config Daemon Pull | ||
| # Make sure it runs only on OSTree booted system | ||
| ConditionPathExists=/run/ostree-booted | ||
| # This "stamp file" is unlinked when we complete | ||
| # machine-config-daemon-firstboot.service | ||
| ConditionPathExists=/etc/ignition-machine-config-encapsulated.json | ||
| Wants=network-online.target | ||
| After=network-online.target | ||
|
|
||
sinnykumari marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| [Service] | ||
| Type=oneshot | ||
| RemainAfterExit=yes | ||
| # See https://github.com/coreos/fedora-coreos-tracker/issues/354 | ||
| ExecStart=/bin/sh -c '/bin/mkdir -p /run/bin && chcon --reference=/usr/bin /run/bin' | ||
| ExecStart=/bin/sh -c "/usr/bin/podman pull --authfile=/var/lib/kubelet/config.json --quiet '{{ .Images.setupEtcdEnvKey }}'" | ||
| ExecStart=/bin/sh -c "/usr/bin/podman run --rm --quiet --net=host --entrypoint=cat '{{ .Images.setupEtcdEnvKey }}' /usr/bin/machine-config-daemon > /run/bin/machine-config-daemon.tmp" | ||
| ExecStart=/bin/sh -c '/usr/bin/chmod a+x /run/bin/machine-config-daemon.tmp && mv /run/bin/machine-config-daemon.tmp /run/bin/machine-config-daemon' | ||
|
|
||
| {{if .Proxy -}} | ||
| {{if .Proxy.HTTPProxy -}} | ||
| Environment=HTTP_PROXY={{.Proxy.HTTPProxy}} | ||
| {{end -}} | ||
| {{if .Proxy.HTTPSProxy -}} | ||
| Environment=HTTPS_PROXY={{.Proxy.HTTPSProxy}} | ||
| {{end -}} | ||
| {{if .Proxy.NoProxy -}} | ||
| Environment=NO_PROXY={{.Proxy.NoProxy}} | ||
| {{end -}} | ||
| {{end -}} | ||
|
|
||
| [Install] | ||
| RequiredBy=machine-config-daemon-firstboot.service | ||
Uh oh!
There was an error while loading. Please reload this page.