Skip to content

Commit

Permalink
only enable time wait sync service when NTP server is existing
Browse files Browse the repository at this point in the history
Signed-off-by: Date Huang <date.huang@suse.com>
  • Loading branch information
Date Huang authored and bk201 committed Dec 27, 2022
1 parent bb01624 commit cb666a0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
7 changes: 0 additions & 7 deletions package/harvester-os/files/system/oem/06_ntp.yaml

This file was deleted.

2 changes: 2 additions & 0 deletions pkg/config/cos.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const (
manifestsDirectory = "/var/lib/rancher/rke2/server/manifests/"
harvesterConfig = "harvester-config.yaml"
ntpdService = "systemd-timesyncd"
timeWaitSyncService = "systemd-time-wait-sync"
rancherdBootstrapDir = "/etc/rancher/rancherd/config.yaml.d/"

networkConfigDirectory = "/etc/sysconfig/network/"
Expand Down Expand Up @@ -86,6 +87,7 @@ func ConvertToCOS(config *HarvesterConfig) (*yipSchema.YipConfig, error) {
if len(cfg.OS.NTPServers) > 0 {
initramfs.TimeSyncd["NTP"] = strings.Join(cfg.OS.NTPServers, " ")
initramfs.Systemctl.Enable = append(initramfs.Systemctl.Enable, ntpdService)
initramfs.Systemctl.Enable = append(initramfs.Systemctl.Enable, timeWaitSyncService)
}
if len(cfg.OS.DNSNameservers) > 0 {
initramfs.Commands = append(initramfs.Commands, getAddStaticDNSServersCmd(cfg.OS.DNSNameservers))
Expand Down

0 comments on commit cb666a0

Please sign in to comment.