Skip to content

Commit

Permalink
Set cronExp and repoKey fields for each replication when updating
Browse files Browse the repository at this point in the history
  • Loading branch information
alexhung committed Oct 17, 2024
1 parent 5790af2 commit 0c9466d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ func (m LocalRepositoryMultiReplicationResourceModel) toAPIModel(_ context.Conte
SocketTimeoutMillis: attrs["socket_timeout_millis"].(types.Int64).ValueInt64(),
Username: attrs["username"].(types.String).ValueString(),
Password: attrs["password"].(types.String).ValueString(),
CronExp: m.CronExp.ValueString(),
RepoKey: m.RepoKey.ValueString(),
Enabled: attrs["enabled"].(types.Bool).ValueBool(),
SyncDeletes: attrs["sync_deletes"].(types.Bool).ValueBool(),
SyncProperties: attrs["sync_properties"].(types.Bool).ValueBool(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ func TestAccLocalMultiReplication_full(t *testing.T) {
resource "artifactory_local_repository_multi_replication" "{{ .repo_name }}" {
repo_key = artifactory_local_maven_repository.{{ .repo_name }}.key
cron_exp = "0 0 * * * ?"
cron_exp = "0 0 */2 * * ?"
enable_event_replication = true
replication {
Expand Down Expand Up @@ -302,7 +302,7 @@ func TestAccLocalMultiReplication_full(t *testing.T) {
Config: updateConfig,
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr(fqrn, "repo_key", name),
resource.TestCheckResourceAttr(fqrn, "cron_exp", "0 0 * * * ?"),
resource.TestCheckResourceAttr(fqrn, "cron_exp", "0 0 */2 * * ?"),
resource.TestCheckResourceAttr(fqrn, "enable_event_replication", "true"),
resource.TestCheckResourceAttr(fqrn, "replication.#", "2"),
resource.TestCheckResourceAttr(fqrn, "replication.0.username", acctest.RtDefaultUser),
Expand Down

0 comments on commit 0c9466d

Please sign in to comment.