Skip to content

Commit

Permalink
Merge pull request #32 from AlexGacon/master
Browse files Browse the repository at this point in the history
Force attribute sync on update when not using custom attributes
  • Loading branch information
AlexGacon authored Feb 6, 2024
2 parents 15d42f9 + f1b4ee7 commit 7afa8be
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions geoserver/resource_geoserver_featuretype.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func resourceGeoserverFeatureType() *schema.Resource {
}

func resourceGeoserverFeatureTypeCreate(d *schema.ResourceData, meta interface{}) error {
log.Printf("[INFO] Creating Geoserver FeatureType: %s", d.Id())
log.Printf("[INFO] Creating Geoserver FeatureType: %s", d.Get("name").(string))

client := meta.(*Config).GeoserverClient()

Expand Down Expand Up @@ -388,7 +388,8 @@ func resourceGeoserverFeatureTypeUpdate(d *schema.ResourceData, meta interface{}
Metadata: metadata,
}

err := client.UpdateFeatureType(workspaceName, datastoreName, featureTypeName, featureType)
sync_attributes := !d.Get("use_custom_attributes").(bool)
err := client.UpdateFeatureType(workspaceName, datastoreName, featureTypeName, featureType, sync_attributes)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ module github.com/camptocamp/terraform-provider-geoserver
go 1.15

require (
github.com/camptocamp/go-geoserver v0.0.0-20231220144753-e3d59d348b48
github.com/camptocamp/go-geoserver v0.0.0-20240205195341-221dfa93f919
github.com/hashicorp/terraform-plugin-sdk v1.17.2
)
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ github.com/camptocamp/go-geoserver v0.0.0-20231215143954-f99a84dadc4c h1:OUukvFT
github.com/camptocamp/go-geoserver v0.0.0-20231215143954-f99a84dadc4c/go.mod h1:z5s93Ll45psIP40hoVWpQPservcqeX4MOQDLV+Ys4rE=
github.com/camptocamp/go-geoserver v0.0.0-20231220144753-e3d59d348b48 h1:x8yl62xEuSkKCidZi6AtjYVcb704kiW1LAN0j3Xtufo=
github.com/camptocamp/go-geoserver v0.0.0-20231220144753-e3d59d348b48/go.mod h1:z5s93Ll45psIP40hoVWpQPservcqeX4MOQDLV+Ys4rE=
github.com/camptocamp/go-geoserver v0.0.0-20240205195341-221dfa93f919 h1:D+SK80n6S2aJ7zfUhwH7a0wIBLOc+YBlGCB45Q1HxZc=
github.com/camptocamp/go-geoserver v0.0.0-20240205195341-221dfa93f919/go.mod h1:z5s93Ll45psIP40hoVWpQPservcqeX4MOQDLV+Ys4rE=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
Expand Down

0 comments on commit 7afa8be

Please sign in to comment.