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 @@ -478,12 +478,11 @@ func (r *CRD) ReconcileRequeuOnSuccessSeconds() int {
478478 return 0
479479 }
480480 reconcile := resGenConfig .Reconcile
481- // handles the default case
482- if reconcile == nil {
483- return 0
484- } else {
481+ if reconcile != nil {
485482 return reconcile .RequeueOnSuccessSeconds
486483 }
484+ // handles the default case
485+ return 0
487486}
488487
489488// 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 @@ -246,13 +246,13 @@ func (rm *resourceManager) updateConditions (
246246 if syncCondition == nil && onSuccess {
247247 syncCondition = &ackv1alpha1.Condition{
248248 Type: ackv1alpha1.ConditionTypeResourceSynced,
249+ Status: corev1.ConditionTrue,
249250 }
250- syncCondition.Status = corev1.ConditionTrue
251251 ko.Status.Conditions = append(ko.Status.Conditions, syncCondition)
252252 }
253253{ {- else } }
254254 // Required to avoid the "declared but not used" error in the default case
255- syncCondition = nil
255+ _ = syncCondition
256256{ {- end } }
257257
258258{ {- if $updateConditionsCustomMethodName := .CRD.UpdateConditionsCustomMethodName } }
You can’t perform that action at this time.
0 commit comments