Skip to content

Commit 9aa30eb

Browse files
committed
remove unnecessary changes
1 parent 4d9d4b0 commit 9aa30eb

10 files changed

+7
-221
lines changed

api/v1beta1/cloudstackcluster_types.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import (
2525

2626
const (
2727
ClusterFinalizer = "cloudstackcluster.infrastructure.cluster.x-k8s.io"
28-
DefaultIdentityRefKind = "Secret"
2928
CloudStackClusterLabelName = "cloudstackcluster.infrastructure.cluster.x-k8s.io/name"
3029
NetworkTypeIsolated = "Isolated"
3130
NetworkTypeShared = "Shared"

api/v1beta1/conversion.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,6 @@ const DefaultEndpointCredential = "global"
3333
//nolint:golint,revive,stylecheck
3434
func Convert_v1beta1_CloudStackCluster_To_v1beta2_CloudStackCluster(in *CloudStackCluster, out *v1beta2.CloudStackCluster, s conv.Scope) error {
3535
out.ObjectMeta = in.ObjectMeta
36-
var identifyRef *v1beta2.CloudStackIdentityReference
37-
if in.Spec.IdentityRef != nil {
38-
identifyRef = &v1beta2.CloudStackIdentityReference{}
39-
err := Convert_v1beta1_CloudStackIdentityReference_To_v1beta2_CloudStackIdentityReference(in.Spec.IdentityRef, identifyRef, nil)
40-
if err != nil {
41-
return err
42-
}
43-
}
4436
failureDomains, err := getFailureDomains(in)
4537
if err != nil {
4638
return err

api/v1beta1/zz_generated.conversion.go

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

api/v1beta2/cloudstackcluster_types.go

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2121
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
2222
"sigs.k8s.io/controller-runtime/pkg/client"
23-
"strings"
2423
)
2524

2625
const (
@@ -30,43 +29,6 @@ const (
3029

3130
var K8sClient client.Client
3231

33-
// CloudStackIdentityReference is a reference to an infrastructure
34-
// provider identity to be used to provision cluster resources.
35-
type CloudStackIdentityReference struct {
36-
// Kind of the identity. Must be supported by the infrastructure provider
37-
// and may be either cluster or namespace-scoped.
38-
// +kubebuilder:validation:MinLength=1
39-
Kind string `json:"kind"`
40-
41-
// Name of the infrastructure identity to be used.
42-
Name string `json:"name"`
43-
}
44-
45-
type ZoneStatusMap map[string]Zone
46-
47-
type Zone struct {
48-
// Name.
49-
//+optional
50-
Name string `json:"name,omitempty"`
51-
52-
// ID.
53-
//+optional
54-
ID string `json:"id,omitempty"`
55-
56-
// The network within the Zone to use.
57-
Network Network `json:"network"`
58-
}
59-
60-
// MetaName returns a lower cased name to be used in a k8s object meta.
61-
// It prefers the zone's name, but will use the ID if that's the only present identifier.
62-
func (z *Zone) MetaName() string {
63-
s := z.Name
64-
if s == "" {
65-
s = z.ID
66-
}
67-
return strings.ToLower(s)
68-
}
69-
7032
// CloudStackClusterSpec defines the desired state of CloudStackCluster.
7133
type CloudStackClusterSpec struct {
7234
FailureDomains []CloudStackFailureDomainSpec `json:"failureDomains"`

api/v1beta2/webhook_suite_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import (
3333
admissionv1beta1 "k8s.io/api/admission/v1beta1"
3434
//+kubebuilder:scaffold:imports
3535
"k8s.io/apimachinery/pkg/runtime"
36-
infrav2 "sigs.k8s.io/cluster-api-provider-cloudstack/api/v1beta2"
36+
infrav1 "sigs.k8s.io/cluster-api-provider-cloudstack/api/v1beta2"
3737
ctrl "sigs.k8s.io/controller-runtime"
3838
"sigs.k8s.io/controller-runtime/pkg/client"
3939
"sigs.k8s.io/controller-runtime/pkg/envtest"
@@ -78,7 +78,7 @@ var _ = BeforeSuite(func() {
7878
Expect(cfg).NotTo(BeNil())
7979

8080
scheme := runtime.NewScheme()
81-
err = infrav2.AddToScheme(scheme)
81+
err = infrav1.AddToScheme(scheme)
8282
Expect(err).NotTo(HaveOccurred())
8383

8484
err = admissionv1beta1.AddToScheme(scheme)
@@ -102,9 +102,9 @@ var _ = BeforeSuite(func() {
102102
})
103103
Expect(err).NotTo(HaveOccurred())
104104

105-
Ω((&infrav2.CloudStackCluster{}).SetupWebhookWithManager(mgr)).Should(Succeed())
106-
Ω((&infrav2.CloudStackMachine{}).SetupWebhookWithManager(mgr)).Should(Succeed())
107-
Ω((&infrav2.CloudStackMachineTemplate{}).SetupWebhookWithManager(mgr)).Should(Succeed())
105+
Ω((&infrav1.CloudStackCluster{}).SetupWebhookWithManager(mgr)).Should(Succeed())
106+
Ω((&infrav1.CloudStackMachine{}).SetupWebhookWithManager(mgr)).Should(Succeed())
107+
Ω((&infrav1.CloudStackMachineTemplate{}).SetupWebhookWithManager(mgr)).Should(Succeed())
108108

109109
//+kubebuilder:scaffold:webhook
110110

api/v1beta2/zz_generated.deepcopy.go

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

config/manager/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1
1212
kind: Kustomization
1313
images:
1414
- name: controller
15-
newName: public.ecr.aws/j9l9l0k3/cluster-api-provider-capc
15+
newName: localhost:5000/cluster-api-provider-cloudstack
1616
newTag: latest

config/rbac/cloudstackclusteryufei_editor_role.yaml

Lines changed: 0 additions & 24 deletions
This file was deleted.

config/rbac/cloudstackclusteryufei_viewer_role.yaml

Lines changed: 0 additions & 20 deletions
This file was deleted.

controllers/utils/failuredomains.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,7 @@ func (r *ReconciliationRunner) RemoveExtraneousFailureDomains(fds *infrav1.Cloud
8888
// Send a deletion request for each FailureDomain no speced for.
8989
for _, fd := range fds.Items {
9090
_fd := fd
91-
name := fd.Name
92-
if _, present := fdPresenceByName[name]; !present {
91+
if _, present := fdPresenceByName[fd.Name]; !present {
9392
if err := r.K8sClient.Delete(r.RequestCtx, &_fd); err != nil {
9493
return ctrl.Result{}, errors.Wrap(err, "failed to delete obsolete failure domain")
9594
}

0 commit comments

Comments
 (0)