Skip to content

Commit

Permalink
Add test coverage for pkg/services
Browse files Browse the repository at this point in the history
  • Loading branch information
laozc committed Oct 16, 2023
1 parent 013ce3f commit a1eb2cc
Show file tree
Hide file tree
Showing 3 changed files with 533 additions and 3 deletions.
3 changes: 3 additions & 0 deletions pkg/context/fake/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ const (
// Clusterv1a2UUID is the UID of the fake CAPI v1alpha3 Cluster resource.
Clusterv1a2UUID = "00000000-0000-0000-0000-000000000000"

// InfrastructureRefName is the name of the InfrastructureRef in fake CAPI Cluster resource.
InfrastructureRefName = "fake-cluster-infrastructure-ref"

VSphereClusterName = "fake-vsphere-cluster"

// VSphereClusterUUID is the UID of the fake VSphereCluster resource.
Expand Down
5 changes: 5 additions & 0 deletions pkg/context/fake/fake_cluster_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package fake

import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"

Expand Down Expand Up @@ -61,6 +62,10 @@ func newClusterV1() clusterv1.Cluster {
CIDRBlocks: []string{ServiceCIDR},
},
},
InfrastructureRef: &corev1.ObjectReference{
Namespace: Namespace,
Name: InfrastructureRefName,
},
},
}
}
Expand Down
Loading

0 comments on commit a1eb2cc

Please sign in to comment.