Skip to content

Commit e68841c

Browse files
authored
Merge pull request #282 from gianlucam76/is-cluster-ready
Advance libsveltos pin
2 parents 058519d + 4cddc6b commit e68841c

File tree

3 files changed

+12
-23
lines changed

3 files changed

+12
-23
lines changed

controllers/clusterprofile_controller_test.go

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -737,17 +737,13 @@ var _ = Describe("ClusterProfile: Reconciler", func() {
737737
})
738738

739739
It("updateClusterSummaries creates ClusterSummary for each matching CAPI Cluster", func() {
740-
cpMachine := &clusterv1.Machine{
741-
ObjectMeta: metav1.ObjectMeta{
742-
Namespace: matchingCluster.Namespace,
743-
Name: matchingCluster.Name,
744-
Labels: map[string]string{
745-
clusterv1.ClusterNameLabel: matchingCluster.Name,
746-
clusterv1.MachineControlPlaneLabel: "ok",
747-
},
740+
matchingCluster.Status.Conditions = []clusterv1.Condition{
741+
{
742+
Type: clusterv1.ControlPlaneInitializedCondition,
743+
Status: corev1.ConditionTrue,
748744
},
749745
}
750-
cpMachine.Status.SetTypedPhase(clusterv1.MachinePhaseRunning)
746+
nonMatchingCluster.Status.Conditions = matchingCluster.Status.Conditions
751747

752748
clusterProfile.Status.MatchingClusterRefs = []corev1.ObjectReference{
753749
{
@@ -761,7 +757,6 @@ var _ = Describe("ClusterProfile: Reconciler", func() {
761757
clusterProfile,
762758
nonMatchingCluster,
763759
matchingCluster,
764-
cpMachine,
765760
}
766761

767762
c := fake.NewClientBuilder().WithScheme(scheme).WithStatusSubresource(initObjects...).WithObjects(initObjects...).Build()
@@ -795,17 +790,12 @@ var _ = Describe("ClusterProfile: Reconciler", func() {
795790
})
796791

797792
It("updateClusterSummaries updates existing ClusterSummary for each matching CAPI Cluster", func() {
798-
cpMachine := &clusterv1.Machine{
799-
ObjectMeta: metav1.ObjectMeta{
800-
Namespace: matchingCluster.Namespace,
801-
Name: matchingCluster.Name,
802-
Labels: map[string]string{
803-
clusterv1.ClusterNameLabel: matchingCluster.Name,
804-
clusterv1.MachineControlPlaneLabel: "ok",
805-
},
793+
matchingCluster.Status.Conditions = []clusterv1.Condition{
794+
{
795+
Type: clusterv1.ControlPlaneInitializedCondition,
796+
Status: corev1.ConditionTrue,
806797
},
807798
}
808-
cpMachine.Status.SetTypedPhase(clusterv1.MachinePhaseRunning)
809799

810800
clusterProfile.Status.MatchingClusterRefs = []corev1.ObjectReference{
811801
{
@@ -853,7 +843,6 @@ var _ = Describe("ClusterProfile: Reconciler", func() {
853843
nonMatchingCluster,
854844
matchingCluster,
855845
clusterSummary,
856-
cpMachine,
857846
}
858847

859848
c := fake.NewClientBuilder().WithScheme(scheme).WithStatusSubresource(initObjects...).WithObjects(initObjects...).Build()

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ require (
1717
github.com/onsi/ginkgo/v2 v2.11.0
1818
github.com/onsi/gomega v1.27.8
1919
github.com/pkg/errors v0.9.1
20-
github.com/projectsveltos/libsveltos v0.13.1-0.20230714121025-0c26a52db18a
20+
github.com/projectsveltos/libsveltos v0.13.1-0.20230720120954-d9bf8ba153e8
2121
github.com/prometheus/client_golang v1.16.0
2222
github.com/spf13/pflag v1.0.5
2323
github.com/yuin/gopher-lua v1.1.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -557,8 +557,8 @@ github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSg
557557
github.com/poy/onpar v0.0.0-20200406201722-06f95a1c68e8/go.mod h1:nSbFQvMj97ZyhFRSJYtut+msi4sOY6zJDGCdSc+/rZU=
558558
github.com/poy/onpar v1.1.2 h1:QaNrNiZx0+Nar5dLgTVp5mXkyoVFIbepjyEoGSnhbAY=
559559
github.com/poy/onpar v1.1.2/go.mod h1:6X8FLNoxyr9kkmnlqpK6LSoiOtrO6MICtWwEuWkLjzg=
560-
github.com/projectsveltos/libsveltos v0.13.1-0.20230714121025-0c26a52db18a h1:0LXghU3MN1rg/s6k90a4HXjcxEu5emorM2M5UJUCZYQ=
561-
github.com/projectsveltos/libsveltos v0.13.1-0.20230714121025-0c26a52db18a/go.mod h1:Ty+xhEY1F6dWfMTG36izU6XFtzWVBOwzOc41OekkIWg=
560+
github.com/projectsveltos/libsveltos v0.13.1-0.20230720120954-d9bf8ba153e8 h1:cukptjA3Mau1CRa8FAiznfTGHs1WiJ1QRQBp5HoLHqc=
561+
github.com/projectsveltos/libsveltos v0.13.1-0.20230720120954-d9bf8ba153e8/go.mod h1:Ty+xhEY1F6dWfMTG36izU6XFtzWVBOwzOc41OekkIWg=
562562
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
563563
github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso=
564564
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=

0 commit comments

Comments
 (0)