From c6eaf8fcbe771cdeb26d31cb61c6b80cfa6676a0 Mon Sep 17 00:00:00 2001 From: Robert Schweikert Date: Wed, 5 Aug 2026 13:44:23 -0400 Subject: [PATCH 1/2] Fix SUSE Linux Micro 6+ SUSE Linux Micro 6+ is based on the SLES 16 code base and we need to account for the same semantics as in SLES 16. Recognize SL Micro and handle it appropriately. Thanks to @Lidong Zhong from the SUSE L3 team. --- google_guest_agent/oslogin.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/google_guest_agent/oslogin.go b/google_guest_agent/oslogin.go index ab18fb97..7e56c11b 100644 --- a/google_guest_agent/oslogin.go +++ b/google_guest_agent/oslogin.go @@ -140,8 +140,9 @@ func (o *osloginMgr) Disabled(ctx context.Context) (bool, error) { } func setupSles16OSLoginDirs() error { - isSles16 := strings.Contains(osInfo.OS, "sles") || strings.Contains(osInfo.OS, "opensuse") - if !isSles16 || osInfo.Version.Major != 16 { + isSles16 := strings.Contains(osInfo.OS, "sles") || strings.Contains(osInfo.OS, "opensuse") + isSLMicro := strings.Contains(osInfo.OS, "sl-micro") + if !((isSles16 && osInfo.Version.Major == 16) || isSLMicro) { logger.Infof("Skipping OSLogin SLES 16 specific setup on %q %d", osInfo.OS, osInfo.Version.Major) return nil } From a866c5fc93603a5a0fceb42200bfc692048ed819 Mon Sep 17 00:00:00 2001 From: Robert Schweikert Date: Thu, 6 Aug 2026 08:04:03 -0400 Subject: [PATCH 2/2] Add tests for SUSE Linux Micro --- google_guest_agent/oslogin.go | 6 +++--- google_guest_agent/oslogin_linux_test.go | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/google_guest_agent/oslogin.go b/google_guest_agent/oslogin.go index 7e56c11b..37a13ffa 100644 --- a/google_guest_agent/oslogin.go +++ b/google_guest_agent/oslogin.go @@ -140,9 +140,9 @@ func (o *osloginMgr) Disabled(ctx context.Context) (bool, error) { } func setupSles16OSLoginDirs() error { - isSles16 := strings.Contains(osInfo.OS, "sles") || strings.Contains(osInfo.OS, "opensuse") - isSLMicro := strings.Contains(osInfo.OS, "sl-micro") - if !((isSles16 && osInfo.Version.Major == 16) || isSLMicro) { + isSles16 := strings.Contains(osInfo.OS, "sles") || strings.Contains(osInfo.OS, "opensuse") + isSLMicro := strings.Contains(osInfo.OS, "sl-micro") + if !((isSles16 && osInfo.Version.Major == 16) || isSLMicro) { logger.Infof("Skipping OSLogin SLES 16 specific setup on %q %d", osInfo.OS, osInfo.Version.Major) return nil } diff --git a/google_guest_agent/oslogin_linux_test.go b/google_guest_agent/oslogin_linux_test.go index 6d327594..7404cced 100644 --- a/google_guest_agent/oslogin_linux_test.go +++ b/google_guest_agent/oslogin_linux_test.go @@ -890,6 +890,21 @@ func TestSetupUsrEtcOSLoginDirs(t *testing.T) { dstShouldExist: true, prevSetup: true, }, + { + name: "sle-micro-no-copy", + info: osinfo.OSInfo{OS: "sle-micro", Version: osinfo.Ver{Major: 5}}, + createSrc: true, + createDst: false, + dstShouldExist: false, + }, + { + name: "sl-micro-copy", + info: osinfo.OSInfo{OS: "sl-micro", Version: osinfo.Ver{Major: 6}}, + createSrc: true, + createDst: false, + dstShouldExist: true, + dstContent: "test", + }, } for _, tt := range tests {