Skip to content

Commit

Permalink
fix list images in kubevirt and tinkerbell (#7049)
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamed-rafraf authored Jan 13, 2025
1 parent 3a50ae6 commit 4ca4392
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions modules/api/pkg/handler/common/provider/baremetal.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ func TinkerbellImages(ctx context.Context, datacenterName string, userInfoGetter
httpSource := datacenter.Spec.Baremetal.Tinkerbell.Images.HTTP
if httpSource != nil {
for os, versions := range httpSource.OperatingSystems {
// Ensure the sub-map for the operating system is initialized
if _, ok := res.Standard.OperatingSystems[os]; !ok {
res.Standard.OperatingSystems[os] = map[string]string{}
}
for version, link := range versions {
res.Standard.OperatingSystems[os][version] = link
}
Expand Down
4 changes: 4 additions & 0 deletions modules/api/pkg/handler/common/provider/kubevirt.go
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,10 @@ func KubeVirtImages(ctx context.Context, datacenterName string, userInfoGetter p
httpSource := datacenter.Spec.Kubevirt.Images.HTTP
if httpSource != nil {
for os, versions := range httpSource.OperatingSystems {
// Ensure the sub-map for the operating system is initialized
if _, ok := res.Standard.OperatingSystems[os]; !ok {
res.Standard.OperatingSystems[os] = map[string]string{}
}
for version, link := range versions {
res.Standard.OperatingSystems[os][version] = link
}
Expand Down
1 change: 0 additions & 1 deletion modules/api/pkg/resources/machine/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,6 @@ func getBaremetalProviderConfig(cluster *kubermaticv1.Cluster, nodeSpec apiv1.No
tinkerbellSpec := &tink.TinkerbellPluginSpec{
ClusterName: providerconfig.ConfigVarString{Value: cluster.Name},
HardwareRef: tinkerbellConfig.HardwareRef,
Auth: tink.Auth{Kubeconfig: providerconfig.ConfigVarString{Value: cluster.Spec.Cloud.Baremetal.Tinkerbell.Kubeconfig}},
OSImageURL: providerconfig.ConfigVarString{Value: tinkerbellConfig.OsImageUrl},
}

Expand Down

0 comments on commit 4ca4392

Please sign in to comment.