Skip to content

Commit

Permalink
Add applicationSpecSchemaV3
Browse files Browse the repository at this point in the history
  • Loading branch information
onematchfox committed Dec 6, 2022
1 parent 09733d1 commit d78df16
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion argocd/resource_argocd_application.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func resourceArgoCDApplication() *schema.Resource {
},
Schema: map[string]*schema.Schema{
"metadata": metadataSchema("applications.argoproj.io"),
"spec": applicationSpecSchemaV2(),
"spec": applicationSpecSchemaV3(),
"wait": {
Type: schema.TypeBool,
Description: "Upon application creation or update, wait for application health/sync status to be healthy/Synced, upon application deletion, wait for application to be removed, when set to true.",
Expand Down
10 changes: 10 additions & 0 deletions argocd/schema_application.go
Original file line number Diff line number Diff line change
Expand Up @@ -1166,6 +1166,16 @@ func applicationSpecSchemaV2() *schema.Schema {
}
}

func applicationSpecSchemaV3() *schema.Schema {
// To support deploying applications to non-default namespaces (aka project
// source namespaces), we need to do a state migration to ensure that the Id
// on existing resources is updated to include the namespace.
// For this to happen, we need to trigger a schema version upgrade on the
// application resource however, the schema of the application `spec` has
// changed from `v2`.
return applicationSpecSchemaV2()
}

func resourceArgoCDApplicationV0() *schema.Resource {
return &schema.Resource{
Schema: map[string]*schema.Schema{
Expand Down

0 comments on commit d78df16

Please sign in to comment.