Skip to content

Commit

Permalink
updates from feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
rvanderp3 committed Mar 1, 2024
1 parent 1194eb9 commit 59eb4cf
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ func (v VSphereProviderConfig) getWorkspaceFromFailureDomain(failureDomain *conf
return workspace
}

func getReducedTemplate(template string) string {
// getTemplateName returns the name of the name of the template
func getTemplateName(template string) string {
if strings.Contains(template, "/") {
return template[strings.LastIndex(template, "/")+1:]
}
Expand All @@ -95,11 +96,11 @@ func getReducedTemplate(template string) string {
// Diff compares two ProviderConfigs and returns a list of differences,
// or nil if there are none.
func (v VSphereProviderConfig) Diff(other machinev1beta1.VSphereMachineProviderSpec) ([]string, error) {
// templates can be provided either with an absolute path or relative.
// this can result in the control plane nodes rolling out when they dont need to.
// as long as the OVA name matches that will be considered a match.
otherTemplate := getReducedTemplate(other.Template)
currentTemplate := getReducedTemplate(v.providerConfig.Template)
// Templates can be provided either with an absolute path or relative.
// This can result in the control plane nodes rolling out when they dont need to.
// As long as the OVA name matches that will be considered a match.
otherTemplate := getTemplateName(other.Template)
currentTemplate := getTemplateName(v.providerConfig.Template)

if otherTemplate == currentTemplate {
other.Template = v.providerConfig.Template
Expand Down
5 changes: 2 additions & 3 deletions pkg/webhooks/controlplanemachineset/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import (
configv1 "github.com/openshift/api/config/v1"
machinev1 "github.com/openshift/api/machine/v1"
machinev1beta1 "github.com/openshift/api/machine/v1beta1"
configv1builder "github.com/openshift/cluster-api-actuator-pkg/testutils/resourcebuilder/config/v1"

"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/discovery"
Expand Down Expand Up @@ -91,8 +90,8 @@ var _ = BeforeSuite(func() {
Expect(err).NotTo(HaveOccurred())
Expect(k8sClient).NotTo(BeNil())

infrastructure := configv1builder.Infrastructure().AsAWS("cluster", "us-east-1").WithName("cluster").Build()
Expect(k8sClient.Create(ctx, infrastructure)).To(Succeed())
// infrastructure := configv1builder.Infrastructure().AsAWS("cluster", "us-east-1").WithName("cluster").Build()
// Expect(k8sClient.Create(ctx, infrastructure)).To(Succeed())

// CEL requires Kube 1.25 and above, so check for the minimum server version.
discoveryClient, err := discovery.NewDiscoveryClientForConfig(cfg)
Expand Down

0 comments on commit 59eb4cf

Please sign in to comment.