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

More composite types #742

Merged
merged 2 commits into from
Jun 4, 2019
Merged
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
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.12

require (
cloud.google.com/go v0.37.4 // indirect
github.com/GoogleCloudPlatform/k8s-cloud-provider v0.0.0-20181220005116-f8e995905100
github.com/GoogleCloudPlatform/k8s-cloud-provider v0.0.0-20190604211444-77eedaf646f1
github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/beorn7/perks v1.0.0 // indirect
github.com/emicklei/go-restful v2.9.3+incompatible // indirect
Expand Down Expand Up @@ -50,7 +50,7 @@ require (

replace (
cloud.google.com/go => cloud.google.com/go v0.37.4
github.com/GoogleCloudPlatform/k8s-cloud-provider => github.com/GoogleCloudPlatform/k8s-cloud-provider v0.0.0-20181220005116-f8e995905100
github.com/GoogleCloudPlatform/k8s-cloud-provider => github.com/GoogleCloudPlatform/k8s-cloud-provider v0.0.0-20190604211444-77eedaf646f1
github.com/PuerkitoBio/purell => github.com/PuerkitoBio/purell v1.1.1
github.com/beorn7/perks => github.com/beorn7/perks v1.0.0
github.com/emicklei/go-restful => github.com/emicklei/go-restful v2.9.3+incompatible
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ github.com/BurntSushi/toml v0.3.0/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/GoogleCloudPlatform/k8s-cloud-provider v0.0.0-20181220005116-f8e995905100 h1:EXrpgbxknFeRM6X/OgRqcbVtl5zqUFD5eV8O8M1BLzo=
github.com/GoogleCloudPlatform/k8s-cloud-provider v0.0.0-20181220005116-f8e995905100/go.mod h1:iroGtC8B3tQiqtds1l+mgk/BBOrxbqjH+eUfFQYRc14=
github.com/GoogleCloudPlatform/k8s-cloud-provider v0.0.0-20190604211444-77eedaf646f1 h1:w7gBbODNkd9DYlCfmeW3Af78xmcBCjdPs3l5gDiUN/Q=
github.com/GoogleCloudPlatform/k8s-cloud-provider v0.0.0-20190604211444-77eedaf646f1/go.mod h1:iroGtC8B3tQiqtds1l+mgk/BBOrxbqjH+eUfFQYRc14=
github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ=
github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI=
github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
Expand Down
8 changes: 4 additions & 4 deletions pkg/backends/backends.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func (b *Backends) Create(sp utils.ServicePort, hcLink string) (*composite.Backe
HealthChecks: []string{hcLink},
}
ensureDescription(be, &sp)
if err := composite.CreateBackendService(be, b.cloud); err != nil {
if err := composite.CreateBackendService(be, b.cloud, meta.GlobalKey(be.Name)); err != nil {
return nil, err
}
// Note: We need to perform a GCE call to re-fetch the object we just created
Expand All @@ -87,15 +87,15 @@ func (b *Backends) Create(sp utils.ServicePort, hcLink string) (*composite.Backe
func (b *Backends) Update(be *composite.BackendService) error {
// Ensure the backend service has the proper version before updating.
be.Version = features.VersionFromDescription(be.Description)
if err := composite.UpdateBackendService(be, b.cloud); err != nil {
if err := composite.UpdateBackendService(be, b.cloud, meta.GlobalKey(be.Name)); err != nil {
return err
}
return nil
}

// Get implements Pool.
func (b *Backends) Get(name string, version meta.Version) (*composite.BackendService, error) {
be, err := composite.GetBackendService(name, version, b.cloud)
be, err := composite.GetBackendService(version, b.cloud, meta.GlobalKey(name))
if err != nil {
return nil, err
}
Expand All @@ -104,7 +104,7 @@ func (b *Backends) Get(name string, version meta.Version) (*composite.BackendSer
// the existing backend service.
versionRequired := features.VersionFromDescription(be.Description)
if features.IsLowerVersion(versionRequired, version) {
be, err = composite.GetBackendService(name, versionRequired, b.cloud)
be, err = composite.GetBackendService(versionRequired, b.cloud, meta.GlobalKey(name))
if err != nil {
return nil, err
}
Expand Down
1,898 changes: 1,771 additions & 127 deletions pkg/composite/composite.go

Large diffs are not rendered by default.

Loading