Skip to content

Commit

Permalink
equinix-metal: drop 'facility' support
Browse files Browse the repository at this point in the history
This is not used since a while but looks like the empty 'facility'
parameter was triggering an error:
```
The 'facility' parameter is not supported for organization xxxxx.
For more details, see https://feedback.equinixmetal.com/changelog/bye-facilities-hello-again-metros "
```

Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
  • Loading branch information
tormath1 committed Apr 3, 2024
1 parent 884aefd commit 95bb662
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 13 deletions.
2 changes: 0 additions & 2 deletions cmd/kola/kola.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ func writeProps() error {
Flavor string `json:"flavor"`
}
type EquinixMetal struct {
Facility string `json:"facility"`
Metro string `json:"metro"`
Plan string `json:"plan"`
InstallerImageBaseURL string `json:"installer"`
Expand Down Expand Up @@ -256,7 +255,6 @@ func writeProps() error {
Flavor: kola.OpenStackOptions.Flavor,
},
EquinixMetal: EquinixMetal{
Facility: kola.EquinixMetalOptions.Facility,
Metro: kola.EquinixMetalOptions.Metro,
Plan: kola.EquinixMetalOptions.Plan,
InstallerImageBaseURL: kola.EquinixMetalOptions.InstallerImageBaseURL,
Expand Down
2 changes: 0 additions & 2 deletions cmd/kola/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ func init() {
sv(&kola.EquinixMetalOptions.Profile, "packet-profile", "", "Packet profile (default \"default\")")
sv(&kola.EquinixMetalOptions.ApiKey, "packet-api-key", "", "Packet API key (overrides config file)")
sv(&kola.EquinixMetalOptions.Project, "packet-project", "", "Packet project UUID (overrides config file)")
sv(&kola.EquinixMetalOptions.Facility, "packet-facility", "sv15", "Packet facility code")
sv(&kola.EquinixMetalOptions.Plan, "packet-plan", "c3.small.x86", "Packet plan slug (default board-dependent, e.g. \"baremetal_0\")")
sv(&kola.EquinixMetalOptions.InstallerImageBaseURL, "packet-installer-image-base-url", "", "Packet installer image base URL, non-https (default board-dependent, e.g. \"http://stable.release.flatcar-linux.net/amd64-usr/current\")")
sv(&kola.EquinixMetalOptions.InstallerImageKernelURL, "packet-installer-image-kernel-url", "", "Packet installer image kernel URL, (default packet-installer-image-base-url/flatcar_production_pxe.vmlinuz)")
Expand All @@ -207,7 +206,6 @@ func init() {
sv(&kola.EquinixMetalOptions.Profile, "equinixmetal-profile", "", "EquinixMetal profile (default \"default\")")
sv(&kola.EquinixMetalOptions.ApiKey, "equinixmetal-api-key", "", "EquinixMetal API key (overrides config file)")
sv(&kola.EquinixMetalOptions.Project, "equinixmetal-project", "", "EquinixMetal project UUID (overrides config file)")
sv(&kola.EquinixMetalOptions.Facility, "equinixmetal-facility", "sv15", "EquinixMetal facility code")
sv(&kola.EquinixMetalOptions.Plan, "equinixmetal-plan", "c3.small.x86", "EquinixMetal plan slug (default board-dependent, e.g. \"baremetal_0\")")
sv(&kola.EquinixMetalOptions.InstallerImageBaseURL, "equinixmetal-installer-image-base-url", "", "EquinixMetal installer image base URL, non-https (default board-dependent, e.g. \"http://stable.release.flatcar-linux.net/amd64-usr/current\")")
sv(&kola.EquinixMetalOptions.InstallerImageKernelURL, "equinixmetal-installer-image-kernel-url", "", "EquinixMetal installer image kernel URL, (default equinixmetal-installer-image-base-url/flatcar_production_pxe.vmlinuz)")
Expand Down
2 changes: 1 addition & 1 deletion cmd/ore/equinixmetal/create-device.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ var (

func init() {
EquinixMetal.AddCommand(cmdCreateDevice)
cmdCreateDevice.Flags().StringVar(&options.Facility, "facility", "sjc1", "facility code")
cmdCreateDevice.Flags().StringVar(&options.Metro, "metro", "DC", "metro code")
cmdCreateDevice.Flags().StringVar(&options.Plan, "plan", "", "plan slug (default board-dependent, e.g. \"baremetal_0\")")
cmdCreateDevice.Flags().StringVar(&options.Board, "board", "amd64-usr", "Container Linux board")
cmdCreateDevice.Flags().StringVar(&options.InstallerImageBaseURL, "installer-image-base-url", "", "installer image base URL, non-https (default board-dependent, e.g. \"http://stable.release.flatcar-linux.net/amd64-usr/current\")")
Expand Down
8 changes: 0 additions & 8 deletions platform/api/equinixmetal/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ type Options struct {
// Project UUID (overrides config profile)
Project string

// EquinixMetal location code
Facility string
// Slug of the device type (e.g. "baremetal_0")
Plan string
// e.g. http://alpha.release.flatcar-linux.net/amd64-usr/current
Expand Down Expand Up @@ -641,15 +639,9 @@ func (a *API) createDevice(hostname, ipxeScriptURL, id string) (*packngo.Device,
plog.Infof("device rebooted: %s", id)
} else {
plog.Infof("Recycling is not possible, creating a new instance")
// if the Metro is set, we set the Facility to empty string in order
// to not conflict with Metro value.
if a.opts.Metro != "" {
a.opts.Facility = ""
}

device, response, err = a.c.Devices.Create(&packngo.DeviceCreateRequest{
ProjectID: a.opts.Project,
Facility: []string{a.opts.Facility},
Plan: a.opts.Plan,
BillingCycle: "hourly",
Hostname: hostname,
Expand Down

0 comments on commit 95bb662

Please sign in to comment.