Skip to content

Commit

Permalink
Add containerinfra nodegroup support (#1364)
Browse files Browse the repository at this point in the history
* Add containerinfra nodegroup resource

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@cern.ch>

* Add containerinfra nodegroup data source

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@cern.ch>

* Add containerinfra cluster zero node count support

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@cern.ch>

* Add containerinfra nodegroup zero node count support

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@cern.ch>

* Add containerinfra nodegroup resize node count support

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@cern.ch>

* Fix containerinfra cluster mergelabels behavior

When you add mergelabels and you actually add labels, the magnum API
will actually return you the complete set of labels under the "labels"
key. It means that if you want to add/override a couple of label while
setting merge_labels the creation will succeed but then terraform will
detect the rest of the labels as changed and will try to rebuid the
cluster.

This commit instead use the keys labels_{added,skipped,overriden}
when merge labels which contains the labels that the user has overriden.

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@cern.ch>

* Add containerinfra nodegroup support for mergelabels

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@cern.ch>

* Fix container infra nodegroup golangci-lint errors

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@cern.ch>

* Fix container infra nodegroup image_id and flavor_id

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@cern.ch>

* Fix containerinfra cluster template image/flavor_id

Previously the code set image_id and flavor_id which doesn't exist
instead of image/flavor. It would be way more meaningful to have argument
image_id and flavor_id instead but for backward compatibility let's not
do that for now.

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@cern.ch>

* Add OS_MAGNUM_IMAGE to containerinfra acceptance tests

As fedora atomic is no more available, we remove it from the code and
add OS_MAGNUM_IMAGE environment variable so that we can a supported
image in the CI later on.

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@cern.ch>

* Make container infra cluster aware of default worker nodegroup

The node_count returned in magnum for the cluster is the sum of all
nodegroup. So once you add a node_count, the correct value is actually
the node_count of the default worker node.

This commit take the node_count of this default worker node group in
priority and if there are any errors it takes the node_count of the
cluster instead.

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@cern.ch>

* Fix container infra nodegroup acceptance tests

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@cern.ch>
  • Loading branch information
MrFreezeex committed Jun 26, 2022
1 parent 9575669 commit f46b612
Show file tree
Hide file tree
Showing 17 changed files with 1,139 additions and 87 deletions.
54 changes: 27 additions & 27 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,61 +3,61 @@ module github.com/terraform-provider-openstack/terraform-provider-openstack
go 1.17

require (
github.com/gophercloud/gophercloud v0.24.0
github.com/gophercloud/gophercloud v0.25.0
github.com/gophercloud/utils v0.0.0-20220307143606-8e7800759d16
github.com/hashicorp/terraform-plugin-sdk/v2 v2.16.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.17.0
github.com/mitchellh/go-homedir v1.1.0
github.com/stretchr/testify v1.7.1
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c // indirect
github.com/stretchr/testify v1.7.2
gopkg.in/yaml.v2 v2.4.0
)

require (
github.com/agext/levenshtein v1.2.2 // indirect
github.com/agext/levenshtein v1.2.3 // indirect
github.com/apparentlymart/go-cidr v1.1.0 // indirect
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fatih/color v1.7.0 // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/go-cmp v0.5.8 // indirect
github.com/hashicorp/errwrap v1.0.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-checkpoint v0.5.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 // indirect
github.com/hashicorp/go-hclog v1.2.0 // indirect
github.com/hashicorp/go-hclog v1.2.1 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-plugin v1.4.3 // indirect
github.com/hashicorp/go-plugin v1.4.4 // indirect
github.com/hashicorp/go-uuid v1.0.3 // indirect
github.com/hashicorp/go-version v1.4.0 // indirect
github.com/hashicorp/go-version v1.5.0 // indirect
github.com/hashicorp/hc-install v0.3.2 // indirect
github.com/hashicorp/hcl/v2 v2.12.0 // indirect
github.com/hashicorp/logutils v1.0.0 // indirect
github.com/hashicorp/terraform-exec v0.16.1 // indirect
github.com/hashicorp/terraform-json v0.13.0 // indirect
github.com/hashicorp/terraform-plugin-go v0.9.0 // indirect
github.com/hashicorp/terraform-plugin-log v0.4.0 // indirect
github.com/hashicorp/terraform-registry-address v0.0.0-20210412075316-9b2996cce896 // indirect
github.com/hashicorp/terraform-json v0.14.0 // indirect
github.com/hashicorp/terraform-plugin-go v0.9.1 // indirect
github.com/hashicorp/terraform-plugin-log v0.4.1 // indirect
github.com/hashicorp/terraform-registry-address v0.0.0-20220510144317-d78f4a47ae27 // indirect
github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 // indirect
github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d // indirect
github.com/mattn/go-colorable v0.1.4 // indirect
github.com/mattn/go-isatty v0.0.10 // indirect
github.com/hashicorp/yamux v0.0.0-20211028200310-0bc27b27de87 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/mitchellh/go-wordwrap v1.0.0 // indirect
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/oklog/run v1.0.0 // indirect
github.com/oklog/run v1.1.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
github.com/vmihailenco/msgpack/v4 v4.3.12 // indirect
github.com/vmihailenco/tagparser v0.1.1 // indirect
github.com/vmihailenco/tagparser v0.1.2 // indirect
github.com/zclconf/go-cty v1.10.0 // indirect
golang.org/x/crypto v0.0.0-20211202192323-5770296d904e // indirect
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 // indirect
golang.org/x/text v0.3.6 // indirect
google.golang.org/appengine v1.6.6 // indirect
google.golang.org/genproto v0.0.0-20200711021454-869866162049 // indirect
google.golang.org/grpc v1.45.0 // indirect
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e // indirect
golang.org/x/net v0.0.0-20220615171555-694bf12d69de // indirect
golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c // indirect
golang.org/x/text v0.3.7 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20220615141314-f1464d18c36b // indirect
google.golang.org/grpc v1.47.0 // indirect
google.golang.org/protobuf v1.28.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

0 comments on commit f46b612

Please sign in to comment.