remove sendBootSignal in scaleway metadata package

It's now not needed to send a boot signal when booting an instance on
Scaleway, thus the method is not needed anymore.

Signed-off-by: Patrik Cyvoct <patrik@ptrk.io>
This commit is contained in:
Patrik Cyvoct 2019-10-15 09:35:35 +02:00
parent afff608c49
commit 1e1326b40a
No known key found for this signature in database
GPG Key ID: 4334D82B950FB63A

View File

@ -38,27 +38,6 @@ func (p *ProviderScaleway) String() string {
return "Scaleway" return "Scaleway"
} }
func (p *ProviderScaleway) sendBootSignal() error {
var client = &http.Client{
Timeout: time.Second * 2,
}
state := []byte(`{"state_detail": "booted"}`)
req, err := http.NewRequest("PATCH", scalewayMetadataURL+"state", bytes.NewBuffer(state))
if err != nil {
return fmt.Errorf("Scaleway: http.NewRequest failed: %s", err)
}
req.Header.Set("Content-Type", "application/json")
_, err = client.Do(req)
if err != nil {
return fmt.Errorf("Scaleway: Could not contact state service: %s", err)
}
return nil
}
// Probe checks if we are running on Scaleway // Probe checks if we are running on Scaleway
func (p *ProviderScaleway) Probe() bool { func (p *ProviderScaleway) Probe() bool {
// Getting the conf should always work... // Getting the conf should always work...
@ -68,12 +47,6 @@ func (p *ProviderScaleway) Probe() bool {
return false return false
} }
// we are on Scaleway so we need to send a request to tell that the instance has correctly booted
err = p.sendBootSignal()
if err != nil {
log.Printf("Scaleway: Could not signal that the instance booted")
}
return true return true
} }