Skip to content

Commit

Permalink
Merge pull request #2351 from darkmuggle/pr/check-dropins
Browse files Browse the repository at this point in the history
Bug 1918415: check dropins for nil-pointers
  • Loading branch information
openshift-merge-robot committed Jan 23, 2021
2 parents 52dd3ba + 0ad7755 commit 438a5dc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/daemon/update.go
Expand Up @@ -1469,6 +1469,10 @@ func (dn *Daemon) writeUnits(units []ign3types.Unit) error {
for _, u := range units {
// write the dropin to disk
for i := range u.Dropins {
if u.Dropins[i].Contents == nil || *u.Dropins[i].Contents == "" {
glog.Infof("Dropin for %s has no content, skipping write", u.Dropins[i].Name)
continue
}
glog.Infof("Writing systemd unit dropin %q", u.Dropins[i].Name)
dpath := filepath.Join(pathSystemd, u.Name+".d", u.Dropins[i].Name)
if _, err := os.Stat("/usr" + dpath); err == nil &&
Expand Down

0 comments on commit 438a5dc

Please sign in to comment.