Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add finalizer to medata #392

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions argocd/schema_metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,12 @@ func metadataFields(objectName string) map[string]*schema.Schema {
Description: fmt.Sprintf("The unique in time and space value for this %s. More info: http://kubernetes.io/docs/user-guide/identifiers#uids", objectName),
Computed: true,
},
"finalizers": {
Type: schema.TypeList,
Description: "List of finalizers that will prevent deletion of this object",
Computed: false,
Optional: true,
Elem: &schema.Schema{Type: schema.TypeString},
},
}
}
4 changes: 4 additions & 0 deletions argocd/structure_metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ func expandMetadata(d *schema.ResourceData) (meta meta.ObjectMeta) {
meta.Namespace = v.(string)
}

if v, ok := m["finalizers"].([]interface{}); ok && len(v) > 0 {
meta.Finalizers = expandStringList(v)
}

return meta
}

Expand Down
1 change: 1 addition & 0 deletions docs/resources/application.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ resource "argocd_application" "multiple_sources" {
Optional:

- `annotations` (Map of String) An unstructured key value map stored with the applications.argoproj.io that may be used to store arbitrary metadata. More info: http://kubernetes.io/docs/user-guide/annotations
- `finalizers` (List of String) List of finalizers that will prevent deletion of this object
- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the applications.argoproj.io. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels
- `name` (String) Name of the applications.argoproj.io, must be unique. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names
- `namespace` (String) Namespace of the applications.argoproj.io, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
Expand Down
1 change: 1 addition & 0 deletions docs/resources/application_set.md
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,7 @@ resource "argocd_application_set" "progressive_sync" {
Optional:

- `annotations` (Map of String) An unstructured key value map stored with the applicationsets.argoproj.io that may be used to store arbitrary metadata. More info: http://kubernetes.io/docs/user-guide/annotations
- `finalizers` (List of String) List of finalizers that will prevent deletion of this object
- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the applicationsets.argoproj.io. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels
- `name` (String) Name of the applicationsets.argoproj.io, must be unique. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names
- `namespace` (String) Namespace of the applicationsets.argoproj.io, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
Expand Down
1 change: 1 addition & 0 deletions docs/resources/project.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ resource "argocd_project" "myproject" {
Optional:

- `annotations` (Map of String) An unstructured key value map stored with the appprojects.argoproj.io that may be used to store arbitrary metadata. More info: http://kubernetes.io/docs/user-guide/annotations
- `finalizers` (List of String) List of finalizers that will prevent deletion of this object
- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the appprojects.argoproj.io. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels
- `name` (String) Name of the appprojects.argoproj.io, must be unique. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names
- `namespace` (String) Namespace of the appprojects.argoproj.io, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
Expand Down
Loading