Skip to content

Commit 2515be2

Browse files
committed
tmp2
1 parent abbbbdd commit 2515be2

File tree

6 files changed

+27
-19
lines changed

6 files changed

+27
-19
lines changed

exp/api/v1beta2/rosaroleconfig_types.go

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ type ROSARoleConfigList struct {
153153

154154
const (
155155
// RosaRoleConfigReadyCondition condition reports on the successful reconciliation of RosaRoleConfig.
156-
RosaRoleConfigReadyCondition clusterv1.ConditionType = "RosaRoleConfigReady"
156+
RosaRoleConfigReadyCondition = "RosaRoleConfigReady"
157157

158158
// RosaRoleConfigDeletionFailedReason used to report failures while deleting RosaRoleConfig.
159159
RosaRoleConfigDeletionFailedReason = "DeletionFailed"
@@ -163,18 +163,22 @@ const (
163163

164164
// RosaRoleConfigDeletionStarted used to indicate that the deletion of RosaRoleConfig has started.
165165
RosaRoleConfigDeletionStarted = "DeletionStarted"
166+
167+
// RosaRoleConfigCreatedReason used to indicate that the RosaRoleConfig has been created.
168+
RosaRoleConfigCreatedReason = "Created"
166169
)
167170

171+
// TODO: SOLVE THIS!
172+
func (r *ROSARoleConfig) SetConditions(conditions clusterv1.Conditions) {
173+
r.Status.Conditions = conditions
174+
175+
}
176+
168177
// GetConditions returns the observations of the operational state of the RosaNetwork resource.
169178
func (r *ROSARoleConfig) GetConditions() clusterv1.Conditions {
170179
return r.Status.Conditions
171180
}
172181

173-
// SetConditions sets the underlying service state of the RosaRoleConfig to the predescribed clusterv1.Conditions.
174-
func (r *ROSARoleConfig) SetConditions(conditions clusterv1.Conditions) {
175-
r.Status.Conditions = conditions
176-
}
177-
178182
func init() {
179183
SchemeBuilder.Register(&ROSARoleConfig{}, &ROSARoleConfigList{})
180184
}

exp/controllers/rosaroleconfig_controller.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import (
3737
rosalogging "github.com/openshift/rosa/pkg/logging"
3838
"github.com/openshift/rosa/pkg/ocm"
3939
rosacli "github.com/openshift/rosa/pkg/rosa"
40+
corev1 "k8s.io/api/core/v1"
4041
apierrors "k8s.io/apimachinery/pkg/api/errors"
4142
"k8s.io/apimachinery/pkg/runtime"
4243
"k8s.io/klog/v2"
@@ -164,6 +165,14 @@ func (r *ROSARoleConfigReconciler) Reconcile(ctx context.Context, req ctrl.Reque
164165

165166
if r.rosaRolesConfigReady(scope) {
166167
conditions.MarkTrue(scope.RosaRoleConfig, expinfrav1.RosaRoleConfigReadyCondition)
168+
conditions.Set(scope.RosaRoleConfig,
169+
&clusterv1.Condition{
170+
Type: expinfrav1.RosaRoleConfigReadyCondition,
171+
Status: corev1.ConditionTrue,
172+
Reason: expinfrav1.RosaRoleConfigCreatedReason,
173+
Severity: clusterv1.ConditionSeverityInfo,
174+
Message: "RosaRoleConfig is ready to be used.",
175+
})
167176

168177
}
169178
return ctrl.Result{}, nil

go.mod

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
module sigs.k8s.io/cluster-api-provider-aws/v2
22

3-
go 1.23
4-
5-
toolchain go1.23.1
3+
go 1.23.1
64

75
// kube-openapi should match the version imported by CAPI.
86
replace k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340
@@ -34,7 +32,8 @@ require (
3432
github.com/openshift-online/ocm-common v0.0.21
3533
github.com/openshift-online/ocm-sdk-go v0.1.465
3634
// github.com/openshift/rosa v1.2.54-rc1.0.20250604182244-c38eaa8ff4e2
37-
github.com/openshift/rosa v0.0.0-20250528120404-279e4e58d597
35+
// github.com/openshift/rosa v0.0.0-20250528120404-279e4e58d597
36+
github.com/openshift/rosa v1.2.54
3837
github.com/pkg/errors v0.9.1
3938
github.com/prometheus/client_golang v1.19.1
4039
github.com/sergi/go-diff v1.3.1
@@ -223,7 +222,6 @@ require (
223222
go.opentelemetry.io/otel/sdk v1.28.0 // indirect
224223
go.opentelemetry.io/otel/trace v1.28.0 // indirect
225224
go.opentelemetry.io/proto/otlp v1.3.1 // indirect
226-
go.uber.org/mock v0.3.0 // indirect
227225
go.uber.org/multierr v1.11.0 // indirect
228226
go.uber.org/zap v1.27.0 // indirect
229227
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
@@ -251,7 +249,7 @@ require (
251249
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
252250
)
253251

254-
replace github.com/openshift/rosa => ./rosa
252+
// replace github.com/openshift/rosa => ./rosa
255253

256254
// replace github.com/openshift/rosa => github.com/PanSpagetka/rosa
257255
// replace github.com/openshift/rosa => github.com/PanSpagetka/rosa v0.0.0-20250528120404-279e4e58d597

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,8 @@ github.com/openshift-online/ocm-common v0.0.21 h1:rfp6cPPgVPk/Sm7xAsNFQHaK9Ng1bE
467467
github.com/openshift-online/ocm-common v0.0.21/go.mod h1:VEkuZp9aqbXtetZ5ycND6QpvhykvTuBF3oPsVM1X3vI=
468468
github.com/openshift-online/ocm-sdk-go v0.1.465 h1:RZr92sdcAKyLVcL19/RYOn6KVtspDUH1wc3UuO4LgiE=
469469
github.com/openshift-online/ocm-sdk-go v0.1.465/go.mod h1:EOkylgH0bafd+SlU9YvMrIIxHJw0Hk1EnC7W1VZeW8I=
470+
github.com/openshift/rosa v1.2.54 h1:BgSixJm/c87HdgiLDfpowPdA0jFiX6e4/KIPjZkeFpw=
471+
github.com/openshift/rosa v1.2.54/go.mod h1:H+CPk0tEWLop91ILWIbbT4eI+7w0QP2hYARm4rQsg5Q=
470472
github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8=
471473
github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
472474
github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM=
@@ -623,8 +625,6 @@ go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
623625
go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
624626
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
625627
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
626-
go.uber.org/mock v0.3.0 h1:3mUxI1No2/60yUYax92Pt8eNOEecx2D3lcXZh2NEZJo=
627-
go.uber.org/mock v0.3.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc=
628628
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
629629
go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4=
630630
go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU=

main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ import (
6565
"sigs.k8s.io/cluster-api-provider-aws/v2/pkg/logger"
6666
"sigs.k8s.io/cluster-api-provider-aws/v2/pkg/record"
6767
"sigs.k8s.io/cluster-api-provider-aws/v2/version"
68+
6869
// +kubebuilder:scaffold:imports
6970
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
7071
expclusterv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1"

pkg/cloud/scope/rosaroleconfig.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import (
3131
"sigs.k8s.io/cluster-api-provider-aws/v2/pkg/cloud"
3232
"sigs.k8s.io/cluster-api-provider-aws/v2/pkg/cloud/throttle"
3333
"sigs.k8s.io/cluster-api-provider-aws/v2/pkg/logger"
34-
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
3534
"sigs.k8s.io/cluster-api/util/patch"
3635
)
3736

@@ -137,10 +136,7 @@ func (s *RosaRoleConfigScope) GetClient() client.Client {
137136
func (s *RosaRoleConfigScope) PatchObject() error {
138137
return s.patchHelper.Patch(
139138
context.TODO(),
140-
s.RosaRoleConfig,
141-
patch.WithOwnedConditions{Conditions: []clusterv1.ConditionType{
142-
expinfrav1.RosaRoleConfigReadyCondition,
143-
}})
139+
s.RosaRoleConfig)
144140
}
145141

146142
// Close closes the current scope persisting the RosaRoleConfig configuration and status.

0 commit comments

Comments
 (0)