Skip to content

Commit 9cabdfa

Browse files
committed
Add support for SUSE SLE-Micro
Signed-off-by: Egbert Eich <[email protected]>
1 parent d77a00e commit 9cabdfa

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

controllers/object_controls.go

+15-1
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,20 @@ var SubscriptionPathMap = map[string](MountPathToVolumeSource){
279279
},
280280
},
281281
},
282+
"sl-micro": {
283+
"/etc/zypp/credentials.d": corev1.VolumeSource{
284+
HostPath: &corev1.HostPathVolumeSource{
285+
Path: "/etc/zypp/credentials.d",
286+
Type: newHostPathType(corev1.HostPathDirectory),
287+
},
288+
},
289+
"/etc/SUSEConnect": corev1.VolumeSource{
290+
HostPath: &corev1.HostPathVolumeSource{
291+
Path: "/etc/SUSEConnect",
292+
Type: newHostPathType(corev1.HostPathFileOrCreate),
293+
},
294+
},
295+
},
282296
}
283297

284298
type controlFunc []func(n ClusterPolicyController) (gpuv1.State, error)
@@ -3304,7 +3318,7 @@ func transformDriverContainer(obj *appsv1.DaemonSet, config *gpuv1.ClusterPolicy
33043318
}
33053319

33063320
// set up subscription entitlements for RHEL(using K8s with a non-CRIO runtime) and SLES
3307-
if (release["ID"] == "rhel" && n.openshift == "" && n.runtime != gpuv1.CRIO) || release["ID"] == "sles" {
3321+
if (release["ID"] == "rhel" && n.openshift == "" && n.runtime != gpuv1.CRIO) || release["ID"] == "sles" || release["ID"] == "sl-micro" {
33083322
n.logger.Info("Mounting subscriptions into the driver container", "OS", release["ID"])
33093323
pathToVolumeSource, err := getSubscriptionPathsToVolumeSources()
33103324
if err != nil {

internal/state/driver_volumes.go

+15-1
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,20 @@ var SubscriptionPathMap = map[string]MountPathToVolumeSource{
111111
},
112112
},
113113
},
114+
"sl-micro": {
115+
"/etc/zypp/credentials.d": corev1.VolumeSource{
116+
HostPath: &corev1.HostPathVolumeSource{
117+
Path: "/etc/zypp/credentials.d",
118+
Type: newHostPathType(corev1.HostPathDirectory),
119+
},
120+
},
121+
"/etc/SUSEConnect": corev1.VolumeSource{
122+
HostPath: &corev1.HostPathVolumeSource{
123+
Path: "/etc/SUSEConnect",
124+
Type: newHostPathType(corev1.HostPathFileOrCreate),
125+
},
126+
},
127+
},
114128
}
115129

116130
// TODO: make this a public utils method
@@ -171,7 +185,7 @@ func (s *stateDriver) getDriverAdditionalConfigs(ctx context.Context, cr *v1alph
171185
}
172186

173187
// set up subscription entitlements for RHEL(using K8s with a non-CRIO runtime) and SLES
174-
if (pool.osRelease == "rhel" && openshiftVersion == "" && runtime != consts.CRIO) || pool.osRelease == "sles" {
188+
if (pool.osRelease == "rhel" && openshiftVersion == "" && runtime != consts.CRIO) || pool.osRelease == "sles" || pool.osRelease == "sl-micro" {
175189
logger.Info("Mounting subscriptions into the driver container", "OS", pool.osVersion)
176190
pathToVolumeSource, err := getSubscriptionPathsToVolumeSources(pool.osRelease)
177191
if err != nil {

0 commit comments

Comments
 (0)