diff --git a/docs/content/en/docs-dev/operator-manual/piped/configuration-reference.md b/docs/content/en/docs-dev/operator-manual/piped/configuration-reference.md index 70ce11be27..82ec4c73b9 100644 --- a/docs/content/en/docs-dev/operator-manual/piped/configuration-reference.md +++ b/docs/content/en/docs-dev/operator-manual/piped/configuration-reference.md @@ -25,6 +25,7 @@ spec: | pipedKeyData | string | Base64 encoded string of Piped key. Either pipedKeyFile or pipedKeyData must be set. | Yes | | apiAddress | string | The address used to connect to the control-plane's API. | Yes | | syncInterval | duration | How often to check whether an application should be synced. Default is `1m`. | No | + | git | [Git](/docs/operator-manual/piped/configuration-reference/#git) | Git configuration needed for Git commands. | No | | repositories | [][Repository](/docs/operator-manual/piped/configuration-reference/#gitrepository) | List of Git repositories this piped will handle. | No | | chartRepositories | [][ChartRepository](/docs/operator-manual/piped/configuration-reference/#chartrepository) | List of Helm chart repositories that should be added while starting up. | No | diff --git a/pkg/app/piped/appconfigreporter/appconfigreporter.go b/pkg/app/piped/appconfigreporter/appconfigreporter.go index d59e3d665d..33626a0d7a 100644 --- a/pkg/app/piped/appconfigreporter/appconfigreporter.go +++ b/pkg/app/piped/appconfigreporter/appconfigreporter.go @@ -106,8 +106,7 @@ func (r *Reporter) Run(ctx context.Context) error { r.gitRepos[repoCfg.RepoID] = repo } - // FIXME: Think about sync interval of app config reporter - ticker := time.NewTicker(r.config.SyncInterval.Duration()) + ticker := time.NewTicker(r.config.AppConfigSyncInterval.Duration()) defer ticker.Stop() for { diff --git a/pkg/config/piped.go b/pkg/config/piped.go index baa493038e..fc80e3fc5a 100644 --- a/pkg/config/piped.go +++ b/pkg/config/piped.go @@ -49,6 +49,9 @@ type PipedSpec struct { // How often to check whether an application should be synced. // Default is 1m. SyncInterval Duration `json:"syncInterval" default:"1m"` + // How often to check whether an application configuration file should be synced. + // Default is 5m. + AppConfigSyncInterval Duration `json:"appConfigSyncInterval" default:"5m"` // Git configuration needed for git commands. Git PipedGit `json:"git"` // List of git repositories this piped will handle. diff --git a/pkg/config/piped_test.go b/pkg/config/piped_test.go index e5006973f2..34a24f28dc 100644 --- a/pkg/config/piped_test.go +++ b/pkg/config/piped_test.go @@ -37,12 +37,13 @@ func TestPipedConfig(t *testing.T) { expectedKind: KindPiped, expectedAPIVersion: "pipecd.dev/v1beta1", expectedSpec: &PipedSpec{ - ProjectID: "test-project", - PipedID: "test-piped", - PipedKeyFile: "etc/piped/key", - APIAddress: "your-pipecd.domain", - WebAddress: "https://your-pipecd.domain", - SyncInterval: Duration(time.Minute), + ProjectID: "test-project", + PipedID: "test-piped", + PipedKeyFile: "etc/piped/key", + APIAddress: "your-pipecd.domain", + WebAddress: "https://your-pipecd.domain", + SyncInterval: Duration(time.Minute), + AppConfigSyncInterval: Duration(5 * time.Minute), Git: PipedGit{ Username: "username", Email: "username@email.com",