Skip to content

Commit

Permalink
Add support for SUSE SLE-Micro
Browse files Browse the repository at this point in the history
Signed-off-by: Egbert Eich <[email protected]>
  • Loading branch information
e4t committed Nov 21, 2024
1 parent d77a00e commit 9cabdfa
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
16 changes: 15 additions & 1 deletion controllers/object_controls.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,20 @@ var SubscriptionPathMap = map[string](MountPathToVolumeSource){
},
},
},
"sl-micro": {
"/etc/zypp/credentials.d": corev1.VolumeSource{
HostPath: &corev1.HostPathVolumeSource{
Path: "/etc/zypp/credentials.d",
Type: newHostPathType(corev1.HostPathDirectory),
},
},
"/etc/SUSEConnect": corev1.VolumeSource{
HostPath: &corev1.HostPathVolumeSource{
Path: "/etc/SUSEConnect",
Type: newHostPathType(corev1.HostPathFileOrCreate),
},
},
},
}

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

// set up subscription entitlements for RHEL(using K8s with a non-CRIO runtime) and SLES
if (release["ID"] == "rhel" && n.openshift == "" && n.runtime != gpuv1.CRIO) || release["ID"] == "sles" {
if (release["ID"] == "rhel" && n.openshift == "" && n.runtime != gpuv1.CRIO) || release["ID"] == "sles" || release["ID"] == "sl-micro" {
n.logger.Info("Mounting subscriptions into the driver container", "OS", release["ID"])
pathToVolumeSource, err := getSubscriptionPathsToVolumeSources()
if err != nil {
Expand Down
16 changes: 15 additions & 1 deletion internal/state/driver_volumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,20 @@ var SubscriptionPathMap = map[string]MountPathToVolumeSource{
},
},
},
"sl-micro": {
"/etc/zypp/credentials.d": corev1.VolumeSource{
HostPath: &corev1.HostPathVolumeSource{
Path: "/etc/zypp/credentials.d",
Type: newHostPathType(corev1.HostPathDirectory),
},
},
"/etc/SUSEConnect": corev1.VolumeSource{
HostPath: &corev1.HostPathVolumeSource{
Path: "/etc/SUSEConnect",
Type: newHostPathType(corev1.HostPathFileOrCreate),
},
},
},
}

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

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

0 comments on commit 9cabdfa

Please sign in to comment.