Skip to content

Commit f2a185f

Browse files
committed
fix: Update Chrony Service Config (#288)
1 parent c6d4983 commit f2a185f

File tree

2 files changed

+14
-19
lines changed

2 files changed

+14
-19
lines changed

parts/k8s/cloud-init/artifacts/cse_config.sh

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,13 @@ configureEtcd() {
109109
}
110110
configureChrony() {
111111
sed -i "s/makestep.*/makestep 1.0 -1/g" /etc/chrony/chrony.conf
112-
echo "refclock PHC /dev/ptp0 poll 3 dpoll -2 offset 0" >> /etc/chrony/chrony.conf
112+
cat > /etc/udev/rules.d/99-ptp_hyperv.rules << EOF
113+
ACTION!="add", GOTO="ptp_hyperv"
114+
SUBSYSTEM=="ptp", ATTR{clock_name}=="hyperv", SYMLINK += "ptp_hyperv"
115+
LABEL="ptp_hyperv"
116+
EOF
117+
udevadm control --reload
118+
udevadm trigger --subsystem-match=ptp --action=add -v
113119
}
114120
ensureChrony() {
115121
systemctlEnableAndStart chrony || exit {{GetCSEErrorCode "ERR_SYSTEMCTL_START_FAIL"}}
@@ -336,16 +342,9 @@ ensureContainerd() {
336342
}
337343

338344
ensureNoBridgeDocker0 () {
339-
# Define the name of the bridge you want to check and potentially delete
340345
BRIDGE_NAME="docker0"
341-
# Check if the bridge exists
342346
if ip link show "$BRIDGE_NAME" &> /dev/null; then
343-
# The bridge exists, so delete it
344-
echo "Deleting bridge network $BRIDGE_NAME"
345347
retrycmd 120 5 25 ip link delete "$BRIDGE_NAME" type bridge || exit {{GetCSEErrorCode "ERR_REMOVE_DOCKER_BRIDGE_FAIL"}}
346-
else
347-
# The bridge does not exist
348-
echo "Bridge network $BRIDGE_NAME does not exist"
349348
fi
350349
}
351350

@@ -618,7 +617,6 @@ configAzurePolicyAddon() {
618617
{{end}}
619618

620619
configAddons() {
621-
echo "configAddons placeholder, keep"
622620
{{if IsClusterAutoscalerAddonEnabled}}
623621
if [[ ${CLUSTER_AUTOSCALER_ADDON} == true ]]; then
624622
configClusterAutoscalerAddon

pkg/engine/templates_generated.go

Lines changed: 7 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)