Skip to content

Commit

Permalink
Implement meta.ObjectWithConditions interfaces
Browse files Browse the repository at this point in the history
Follow up on #325 to fully implement new tooling requirements. By
implementing the interfaces, the conditions package can now be used.

Signed-off-by: Hidde Beydals <hello@hidde.co>
  • Loading branch information
hiddeco committed Mar 22, 2022
1 parent c684a81 commit 2324c8b
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions api/v1beta1/imageupdateautomation_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ limitations under the License.
package v1beta1

import (
"time"

apimeta "k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

Expand Down Expand Up @@ -141,6 +143,24 @@ type ImageUpdateAutomation struct {
Status ImageUpdateAutomationStatus `json:"status,omitempty"`
}

// GetRequeueAfter returns the duration after which the ImageUpdateAutomation
// must be reconciled again.
func (auto ImageUpdateAutomation) GetRequeueAfter() time.Duration {
return auto.Spec.Interval.Duration
}

// GetConditions returns the status conditions of the object.
func (auto ImageUpdateAutomation) GetConditions() []metav1.Condition {
return auto.Status.Conditions
}

// SetConditions sets the status conditions on the object.
func (auto *ImageUpdateAutomation) SetConditions(conditions []metav1.Condition) {
auto.Status.Conditions = conditions
}

// GetStatusConditions returns a pointer to the Status.Conditions slice.
// Deprecated: use GetConditions instead.
func (auto *ImageUpdateAutomation) GetStatusConditions() *[]metav1.Condition {
return &auto.Status.Conditions
}
Expand Down

0 comments on commit 2324c8b

Please sign in to comment.