Skip to content

Commit b536cb4

Browse files
Drop kubevirt infraClusterKubeconfig API fields as it's not neeeded (covered by the credentials) (#3675)
Signed-off-by: Artiom Diomin <[email protected]> Co-authored-by: Artiom Diomin <[email protected]>
1 parent 2242438 commit b536cb4

File tree

9 files changed

+4
-41
lines changed

9 files changed

+4
-41
lines changed

docs/api_reference/v1beta2.en.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
+++
22
title = "v1beta2 API Reference"
3-
date = 2025-06-11T12:48:35+02:00
3+
date = 2025-06-12T15:55:08+03:00
44
weight = 11
55
+++
66
## v1beta2
@@ -572,7 +572,6 @@ KubevirtSpec defines the Kubevirt provider
572572
| Field | Description | Scheme | Required |
573573
| ----- | ----------- | ------ | -------- |
574574
| infraNamespace | InfraNamespace is the namespace that KubeVirt provider will use to create and manage resources in the infra cluster, such as VirtualMachines, VirtualMachineInstances, etc... | string | true |
575-
| infraClusterKubeconfig | InfraClusterKubeconfig is a base64-encoded kubeconfig file that points to a KubeVirt infra cluster (a cluster where KubeVirt is installed). This Kubeconfig will be used to create and manage KubeVirt specific resources such as DataVolumes. | string | true |
576575
| zoneAndRegionEnabled | ZoneAndRegionEnabled indicates if need to get Region and zone labels from the cloud provider | bool | false |
577576
| loadBalancerEnabled | LoadBalancerEnabled indicates if the ccm should create and manage the clusters load balancers. | bool | false |
578577

docs/api_reference/v1beta3.en.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
+++
22
title = "v1beta3 API Reference"
3-
date = 2025-06-11T12:48:35+02:00
3+
date = 2025-06-12T15:55:08+03:00
44
weight = 11
55
+++
66
## v1beta3
@@ -574,7 +574,6 @@ KubevirtSpec defines the Kubevirt provider
574574
| Field | Description | Scheme | Required |
575575
| ----- | ----------- | ------ | -------- |
576576
| infraNamespace | InfraNamespace is the namespace that KubeVirt provider will use to create and manage resources in the infra cluster, such as VirtualMachines, VirtualMachineInstances, etc... | string | true |
577-
| infraClusterKubeconfig | InfraClusterKubeconfig is a base64-encoded kubeconfig file that points to a KubeVirt infra cluster (a cluster where KubeVirt is installed). This Kubeconfig will be used to create and manage KubeVirt specific resources such as DataVolumes. | string | true |
578577
| zoneAndRegionEnabled | ZoneAndRegionEnabled indicates if need to get Region and zone labels from the cloud provider | bool | false |
579578
| loadBalancerEnabled | LoadBalancerEnabled indicates if the ccm should create and manage the clusters load balancers. | bool | false |
580579

pkg/apis/kubeone/types.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -446,9 +446,6 @@ type KubevirtSpec struct {
446446
// InfraNamespace is the namespace that KubeVirt provider will use to create and manage resources in the infra cluster,
447447
// such as VirtualMachines, VirtualMachineInstances, etc...
448448
InfraNamespace string `json:"infraNamespace"`
449-
// InfraClusterKubeconfig is a base64-encoded kubeconfig file that points to a KubeVirt infra cluster (a cluster where KubeVirt is installed).
450-
// This Kubeconfig will be used to create and manage KubeVirt specific resources such as DataVolumes.
451-
InfraClusterKubeconfig string `json:"infraClusterKubeconfig"`
452449
// ZoneAndRegionEnabled indicates if need to get Region and zone labels from the cloud provider
453450
ZoneAndRegionEnabled bool `json:"zoneAndRegionEnabled,omitempty"`
454451
// LoadBalancerEnabled indicates if the ccm should create and manage the clusters load balancers.

pkg/apis/kubeone/v1beta2/types.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -451,9 +451,6 @@ type KubevirtSpec struct {
451451
// InfraNamespace is the namespace that KubeVirt provider will use to create and manage resources in the infra cluster,
452452
// such as VirtualMachines, VirtualMachineInstances, etc...
453453
InfraNamespace string `json:"infraNamespace"`
454-
// InfraClusterKubeconfig is a base64-encoded kubeconfig file that points to a KubeVirt infra cluster (a cluster where KubeVirt is installed).
455-
// This Kubeconfig will be used to create and manage KubeVirt specific resources such as DataVolumes.
456-
InfraClusterKubeconfig string `json:"infraClusterKubeconfig"`
457454
// ZoneAndRegionEnabled indicates if need to get Region and zone labels from the cloud provider
458455
ZoneAndRegionEnabled bool `json:"zoneAndRegionEnabled,omitempty"`
459456
// LoadBalancerEnabled indicates if the ccm should create and manage the clusters load balancers.

pkg/apis/kubeone/v1beta2/zz_generated.conversion.go

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

pkg/apis/kubeone/v1beta3/types.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -443,9 +443,6 @@ type KubevirtSpec struct {
443443
// InfraNamespace is the namespace that KubeVirt provider will use to create and manage resources in the infra cluster,
444444
// such as VirtualMachines, VirtualMachineInstances, etc...
445445
InfraNamespace string `json:"infraNamespace"`
446-
// InfraClusterKubeconfig is a base64-encoded kubeconfig file that points to a KubeVirt infra cluster (a cluster where KubeVirt is installed).
447-
// This Kubeconfig will be used to create and manage KubeVirt specific resources such as DataVolumes.
448-
InfraClusterKubeconfig string `json:"infraClusterKubeconfig"`
449446
// ZoneAndRegionEnabled indicates if need to get Region and zone labels from the cloud provider
450447
ZoneAndRegionEnabled bool `json:"zoneAndRegionEnabled,omitempty"`
451448
// LoadBalancerEnabled indicates if the ccm should create and manage the clusters load balancers.

pkg/apis/kubeone/v1beta3/zz_generated.conversion.go

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

pkg/apis/kubeone/validation/validation.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ package validation
1919
import (
2020
"bytes"
2121
"crypto/x509"
22-
"encoding/base64"
2322
"fmt"
2423
"net"
2524
"os"
@@ -209,15 +208,6 @@ func ValidateCloudProviderSpec(cluster kubeoneapi.KubeOneCluster, fldPath *field
209208
allErrs = append(allErrs, field.Forbidden(kubevirtFld, "only one provider can be used at the same time"))
210209
}
211210
providerFound = true
212-
switch providerSpec.Kubevirt.InfraClusterKubeconfig {
213-
case "":
214-
allErrs = append(allErrs, field.Required(kubevirtFld.Child("infraClusterKubeconfig"), "is required for kubevirt provider"))
215-
default:
216-
_, err := base64.StdEncoding.DecodeString(providerSpec.Kubevirt.InfraClusterKubeconfig)
217-
if err != nil {
218-
allErrs = append(allErrs, field.Forbidden(kubevirtFld.Child("infraClusterKubeconfig"), "must be base64-encoded"))
219-
}
220-
}
221211
if providerSpec.Kubevirt.InfraNamespace == "" {
222212
allErrs = append(allErrs, field.Required(kubevirtFld.Child("infraNamespace"), "is required for kubevirt provider"))
223213
}

pkg/apis/kubeone/validation/validation_test.go

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -513,29 +513,17 @@ func TestValidateCloudProviderSpec(t *testing.T) {
513513
},
514514
{
515515
name: "valid Kubevirt provider config",
516-
providerConfig: kubeoneapi.CloudProviderSpec{
517-
Kubevirt: &kubeoneapi.KubevirtSpec{
518-
InfraClusterKubeconfig: "YXBpVmVyc2lvbjogdjEKY2x1c3RlcnM6Ci0gY2x1c3RlcjoKICAgIGNlcnRpZmljYXRlLWF1dGhvcml0eS1kYXRhOiBMU1hZWgogICAgc2VydmVyOiBodHRwczovL3h5ei5leGFtcGxlLmNvbTo2NDQzCiAgbmFtZTogeHl6CmNvbnRleHRzOgotIGNvbnRleHQ6CiAgICBjbHVzdGVyOiB4eXoKICAgIHVzZXI6IGRlZmF1bHQKICBuYW1lOiB4eXoKY3VycmVudC1jb250ZXh0OiB4eXoKa2luZDogQ29uZmlnCnByZWZlcmVuY2VzOiB7fQp1c2VyczoKLSBuYW1lOiBkZWZhdWx0CiAgdXNlcjoKICAgIHRva2VuOiB4eXphdzI1Lnh5ego=",
519-
InfraNamespace: "tenant-xyz",
520-
},
521-
},
522-
expectedError: false,
523-
},
524-
{
525-
name: "Kubevirt provider config missing InfraClusterKubeconfig",
526516
providerConfig: kubeoneapi.CloudProviderSpec{
527517
Kubevirt: &kubeoneapi.KubevirtSpec{
528518
InfraNamespace: "tenant-xyz",
529519
},
530520
},
531-
expectedError: true,
521+
expectedError: false,
532522
},
533523
{
534524
name: "Kubevirt provider config missing InfraNamespace",
535525
providerConfig: kubeoneapi.CloudProviderSpec{
536-
Kubevirt: &kubeoneapi.KubevirtSpec{
537-
InfraClusterKubeconfig: "YXBpVmVyc2lvbjogdjEKY2x1c3RlcnM6Ci0gY2x1c3RlcjoKICAgIGNlcnRpZmljYXRlLWF1dGhvcml0eS1kYXRhOiBMU1hZWgogICAgc2VydmVyOiBodHRwczovL3h5ei5leGFtcGxlLmNvbTo2NDQzCiAgbmFtZTogeHl6CmNvbnRleHRzOgotIGNvbnRleHQ6CiAgICBjbHVzdGVyOiB4eXoKICAgIHVzZXI6IGRlZmF1bHQKICBuYW1lOiB4eXoKY3VycmVudC1jb250ZXh0OiB4eXoKa2luZDogQ29uZmlnCnByZWZlcmVuY2VzOiB7fQp1c2VyczoKLSBuYW1lOiBkZWZhdWx0CiAgdXNlcjoKICAgIHRva2VuOiB4eXphdzI1Lnh5ego=",
538-
},
526+
Kubevirt: &kubeoneapi.KubevirtSpec{},
539527
},
540528
expectedError: true,
541529
},

0 commit comments

Comments
 (0)