File tree Expand file tree Collapse file tree 4 files changed +10
-11
lines changed Expand file tree Collapse file tree 4 files changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ type ResourceConfig struct {
5656 // very little consistency to the APIs that we can use to instruct the code
5757 // generator :(
5858 UpdateOperation * UpdateOperationConfig `json:"update_operation,omitempty"`
59- // ReconcileConfig describes options for controlling the reconciliation
59+ // Reconcile describes options for controlling the reconciliation
6060 // logic for a particular resource.
6161 Reconcile * ReconcileConfig `json:"reconcile,omitempty"`
6262 // UpdateConditionsCustomMethodName provides the name of the custom method on the
Original file line number Diff line number Diff line change @@ -567,12 +567,11 @@ func (r *CRD) ReconcileRequeuOnSuccessSeconds() int {
567567 return 0
568568 }
569569 reconcile := resGenConfig .Reconcile
570- // handles the default case
571- if reconcile == nil {
572- return 0
573- } else {
570+ if reconcile != nil {
574571 return reconcile .RequeueOnSuccessSeconds
575572 }
573+ // handles the default case
574+ return 0
576575}
577576
578577// CustomUpdateMethodName returns the name of the custom resourceManager method
Original file line number Diff line number Diff line change @@ -66,13 +66,13 @@ func (f *resourceManagerFactory) IsAdoptable() bool {
6666 return {{ .CRD.IsAdoptable } }
6767}
6868
69- // GetRequeueOnSuccessSeconds returns true if the resource should be requeued after specified seconds
69+ // RequeueOnSuccessSeconds returns true if the resource should be requeued after specified seconds
7070// Default is false which means resource will not be requeued after success.
71- func (f *resourceManagerFactory) GetRequeueOnSuccessSeconds () ( int, bool) {
71+ func (f *resourceManagerFactory) RequeueOnSuccessSeconds () int {
7272{{- if $reconcileRequeuOnSuccessSeconds := .CRD.ReconcileRequeuOnSuccessSeconds } }
73- return { { $reconcileRequeuOnSuccessSeconds } }, true
73+ return { { $reconcileRequeuOnSuccessSeconds } }
7474{ {- else } }
75- return 0, false
75+ return 0
7676{ {- end } }
7777}
7878
Original file line number Diff line number Diff line change @@ -254,13 +254,13 @@ func (rm *resourceManager) updateConditions (
254254 if syncCondition == nil && onSuccess {
255255 syncCondition = &ackv1alpha1.Condition{
256256 Type: ackv1alpha1.ConditionTypeResourceSynced,
257+ Status: corev1.ConditionTrue,
257258 }
258- syncCondition.Status = corev1.ConditionTrue
259259 ko.Status.Conditions = append(ko.Status.Conditions, syncCondition)
260260 }
261261{ {- else } }
262262 // Required to avoid the "declared but not used" error in the default case
263- syncCondition = nil
263+ _ = syncCondition
264264{ {- end } }
265265
266266{ {- if $updateConditionsCustomMethodName := .CRD.UpdateConditionsCustomMethodName } }
You can’t perform that action at this time.
0 commit comments