Skip to content

Commit 1abd633

Browse files
committed
feat: switch to kstatus-compatible status conditions
1 parent 6280108 commit 1abd633

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

api/v1/conditions.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package v1
22

33
const (
4-
// ConditionTypeAvailable represents the status of the Secret reconciliation
5-
ConditionTypeAvailable = "Available"
4+
// ConditionTypeReady is used to signal whether a reconciliation has completed successfully.
5+
ConditionTypeReady = "Ready"
66
)

internal/tokenmanager/token_secret.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func NewTokenSecret(ctx context.Context, key types.NamespacedName, owner tokenMa
8383
s.log.Info("initializing token status conditions")
8484

8585
condition := metav1.Condition{
86-
Type: githubv1.ConditionTypeAvailable,
86+
Type: githubv1.ConditionTypeReady,
8787
Status: metav1.ConditionUnknown,
8888
Reason: "Reconciling",
8989
Message: "Starting reconciliation",
@@ -152,7 +152,7 @@ func (s *tokenSecret) Reconcile() (result reconcile.Result, err error) {
152152
// Secret was found, so update it
153153
if !metav1.IsControlledBy(secret, s.owner) {
154154
condition := metav1.Condition{
155-
Type: githubv1.ConditionTypeAvailable,
155+
Type: githubv1.ConditionTypeReady,
156156
Status: metav1.ConditionFalse,
157157
Reason: "Failed",
158158
Message: "Secret already exists",
@@ -217,7 +217,7 @@ func (s *tokenSecret) CreateSecret() error {
217217
}
218218

219219
condition := metav1.Condition{
220-
Type: githubv1.ConditionTypeAvailable,
220+
Type: githubv1.ConditionTypeReady,
221221
Status: metav1.ConditionFalse,
222222
Reason: "Creating",
223223
Message: "Creating Secret",
@@ -263,7 +263,7 @@ func (s *tokenSecret) UpdateSecret() error {
263263
s.Data = s.SecretData(installationToken.GetToken())
264264

265265
condition := metav1.Condition{
266-
Type: githubv1.ConditionTypeAvailable,
266+
Type: githubv1.ConditionTypeReady,
267267
Status: metav1.ConditionUnknown,
268268
Reason: "Updating",
269269
Message: "Updating Secret",
@@ -300,7 +300,7 @@ func (s *tokenSecret) DeleteSecret(key types.NamespacedName) error {
300300
log := s.log.WithValues("func", "DeleteSecret")
301301

302302
condition := metav1.Condition{
303-
Type: githubv1.ConditionTypeAvailable,
303+
Type: githubv1.ConditionTypeReady,
304304
Status: metav1.ConditionFalse,
305305
Reason: "Reconciling",
306306
Message: "Deleting old Secret",

0 commit comments

Comments
 (0)