Skip to content

Commit 0269a9a

Browse files
ref: PG affinity_type -> placement_group_type; is_strict -> placement_group_policy (#546)
* Placement Group affinity_type -> placement_group_type; is_strict -> placement_group_strictness * Re-run fixtures oops
1 parent 5a2373b commit 0269a9a

9 files changed

+438
-466
lines changed

go.work.sum

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,45 @@
1+
cloud.google.com/go/compute/metadata v0.3.0 h1:Tz+eQXMEqDIKRsmY3cHTL6FVaynIjX2QxYC4trgAKZc=
12
cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k=
3+
github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46 h1:lsxEuwrXEAokXB9qhlbKWPpo3KMLZQ5WB5WLQRW1uq0=
24
github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ=
5+
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
36
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
7+
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA=
48
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
9+
github.com/creack/pty v1.1.9 h1:uDmaGzcdjhF4i/plgjmEsriH11Y0o7RKapEf/LDaM3w=
10+
github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84=
511
github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
12+
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=
613
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
14+
github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4=
715
github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA=
16+
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
817
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
18+
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM=
919
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
20+
github.com/kisielk/errcheck v1.5.0 h1:e8esj/e4R+SAOwFwN+n3zr0nYeCyeweozKfO23MvHzY=
21+
github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg=
22+
github.com/kr/pty v1.1.1 h1:VkoXIwSboBpnk99O/KFauAEILuNHv5DVFKZMBN/gUgw=
23+
github.com/moby/spdystream v0.2.0 h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8=
1024
github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c=
25+
github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5 h1:8Q0qkMVC/MmWkpIdlvZgcv2o2jrlF6zqVOh7W5YHdMA=
26+
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus=
1127
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
28+
github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI=
1229
github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
30+
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
1331
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
32+
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
1433
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
34+
github.com/yuin/goldmark v1.4.13 h1:fVcFKWvrslecOb/tg+Cc05dkeYx540o0FuFt3nUVDoE=
35+
golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI=
1536
golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM=
16-
golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M=
1737
golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
38+
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
1839
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
40+
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk=
1941
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
42+
google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c=
2043
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
44+
k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01 h1:pWEwq4Asjm4vjW7vcsmijwBhOr1/shsbSYiWXmNGlks=
2145
k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E=

instances.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,10 @@ type InstanceTransfer struct {
108108
// InstancePlacementGroup represents information about the placement group
109109
// this Linode is a part of.
110110
type InstancePlacementGroup struct {
111-
ID int `json:"id"`
112-
Label string `json:"label"`
113-
AffinityType PlacementGroupAffinityType `json:"affinity_type"`
114-
IsStrict bool `json:"is_strict"`
111+
ID int `json:"id"`
112+
Label string `json:"label"`
113+
PlacementGroupType PlacementGroupType `json:"placement_group_type"`
114+
PlacementGroupPolicy PlacementGroupPolicy `json:"placement_group_policy"`
115115
}
116116

117117
// InstanceMetadataOptions specifies various Instance creation fields

placement_groups.go

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,21 @@ package linodego
22

33
import "context"
44

5-
// PlacementGroupAffinityType is an enum that determines the affinity policy
5+
// PlacementGroupType is an enum that determines the affinity policy
66
// for Linodes in a placement group.
7-
type PlacementGroupAffinityType string
7+
type PlacementGroupType string
88

99
const (
10-
AffinityTypeAntiAffinityLocal PlacementGroupAffinityType = "anti_affinity:local"
10+
PlacementGroupTypeAntiAffinityLocal PlacementGroupType = "anti_affinity:local"
11+
)
12+
13+
// PlacementGroupPolicy is an enum for the policy that determines whether a
14+
// Linode can be assigned to a Placement Group.
15+
type PlacementGroupPolicy string
16+
17+
const (
18+
PlacementGroupPolicyStrict PlacementGroupPolicy = "strict"
19+
PlacementGroupPolicyFlexible PlacementGroupPolicy = "flexible"
1120
)
1221

1322
// PlacementGroupMember represents a single Linode assigned to a
@@ -20,22 +29,22 @@ type PlacementGroupMember struct {
2029
// PlacementGroup represents a Linode placement group.
2130
// NOTE: Placement Groups may not currently be available to all users.
2231
type PlacementGroup struct {
23-
ID int `json:"id"`
24-
Label string `json:"label"`
25-
Region string `json:"region"`
26-
AffinityType PlacementGroupAffinityType `json:"affinity_type"`
27-
IsCompliant bool `json:"is_compliant"`
28-
IsStrict bool `json:"is_strict"`
29-
Members []PlacementGroupMember `json:"members"`
32+
ID int `json:"id"`
33+
Label string `json:"label"`
34+
Region string `json:"region"`
35+
PlacementGroupType PlacementGroupType `json:"placement_group_type"`
36+
PlacementGroupPolicy PlacementGroupPolicy `json:"placement_group_policy"`
37+
IsCompliant bool `json:"is_compliant"`
38+
Members []PlacementGroupMember `json:"members"`
3039
}
3140

3241
// PlacementGroupCreateOptions represents the options to use
3342
// when creating a placement group.
3443
type PlacementGroupCreateOptions struct {
35-
Label string `json:"label"`
36-
Region string `json:"region"`
37-
AffinityType PlacementGroupAffinityType `json:"affinity_type"`
38-
IsStrict bool `json:"is_strict"`
44+
Label string `json:"label"`
45+
Region string `json:"region"`
46+
PlacementGroupType PlacementGroupType `json:"placement_group_type"`
47+
PlacementGroupPolicy PlacementGroupPolicy `json:"placement_group_policy"`
3948
}
4049

4150
// PlacementGroupUpdateOptions represents the options to use

0 commit comments

Comments
 (0)