Skip to content

Commit 9934e02

Browse files
committed
pkg/watches: handle JSON conversions for reconcilePeriod
1 parent aa148c1 commit 9934e02

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ func main() {
141141
for _, w := range ws {
142142
reconcilePeriod := defaultReconcilePeriod
143143
if w.ReconcilePeriod != nil {
144-
reconcilePeriod = *w.ReconcilePeriod
144+
reconcilePeriod = w.ReconcilePeriod.Duration
145145
}
146146

147147
maxConcurrentReconciles := defaultMaxConcurrentReconciles

pkg/watches/watches.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ import (
1919
"fmt"
2020
"io/ioutil"
2121
"os"
22-
"time"
2322

2423
"helm.sh/helm/v3/pkg/chart"
2524
"helm.sh/helm/v3/pkg/chart/loader"
25+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2626
"k8s.io/apimachinery/pkg/runtime/schema"
2727
"sigs.k8s.io/yaml"
2828
)
@@ -33,7 +33,7 @@ type Watch struct {
3333

3434
WatchDependentResources *bool `json:"watchDependentResources,omitempty"`
3535
OverrideValues map[string]string `json:"overrideValues,omitempty"`
36-
ReconcilePeriod *time.Duration `json:"reconcilePeriod,omitempty"`
36+
ReconcilePeriod *metav1.Duration `json:"reconcilePeriod,omitempty"`
3737
MaxConcurrentReconciles *int `json:"maxConcurrentReconciles,omitempty"`
3838

3939
Chart *chart.Chart `json:"-"`

pkg/watches/watches_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ func TestLoadWatches(t *testing.T) {
4141
kind: MyKind
4242
chart: ../../testdata/test-chart-0.1.0.tgz
4343
watchDependentResources: false
44+
reconcilePeriod: 10s
4445
overrideValues:
4546
key: value
4647
`,

0 commit comments

Comments
 (0)