Przeglądaj źródła

address review

Signed-off-by: Patrik Cyvoct <patrik@ptrk.io>
Patrik Cyvoct 4 lat temu
rodzic
commit
b5e23beaeb
2 zmienionych plików z 2 dodań i 2 usunięć
  1. 1 1
      pkg/cloud/provider.go
  2. 1 1
      pkg/cloud/scalewayprovider.go

+ 1 - 1
pkg/cloud/provider.go

@@ -522,7 +522,7 @@ func getClusterProperties(node *v1.Node) clusterProperties {
 		cp.provider = kubecost.AzureProvider
 		cp.configFileName = "azure.json"
 		cp.accountID = parseAzureSubscriptionID(providerID)
-	} else if strings.HasPrefix(providerID, "scaleway") {
+	} else if strings.HasPrefix(providerID, "scaleway") { // the scaleway provider ID looks like scaleway://instance/<instance_id>
 		cp.provider = kubecost.ScalewayProvider
 		cp.configFileName = "scaleway.json"
 	}

+ 1 - 1
pkg/cloud/scalewayprovider.go

@@ -51,6 +51,7 @@ func (c *Scaleway) DownloadPricingData() error {
 
 	c.Pricing = make(map[string]*ScalewayPricing)
 
+	// The endpoint we are trying to hit does not have authentication, but the scw client needs to be created with some default, hence these dummy values (regex parsing ftw)
 	client, err := scw.NewClient(scw.WithAuth("SCWXXXXXXXXXXXXXXXXX", "00000000-0000-0000-0000-000000000000"), scw.WithDefaultProjectID("00000000-0000-0000-0000-000000000000"))
 	if err != nil {
 		return err
@@ -104,7 +105,6 @@ func (c *Scaleway) NodePricing(key Key) (*Node, error) {
 	split := strings.Split(key.Features(), ",")
 	if pricing, ok := c.Pricing[split[0]]; ok {
 		if info, ok := pricing.NodesInfos[split[1]]; ok {
-			log.Infof("Using features:`%s`", key.Features())
 			return &Node{
 				Cost:        fmt.Sprintf("%f", info.HourlyPrice),
 				PricingType: DefaultPrices,