Browse Source

Update Scaleway provider to use v1beta1 API version (#3205)

* feat: update scw secret api to v1beta1

Signed-off-by: Florent Viel <fviel@scaleway.com>

* fix: lint issue

Signed-off-by: Florent Viel <fviel@scaleway.com>

---------

Signed-off-by: Florent Viel <fviel@scaleway.com>
Florent Viel 2 years ago
parent
commit
3bd911b9c1

+ 2 - 2
pkg/provider/scaleway/client.go

@@ -24,7 +24,7 @@ import (
 	"strings"
 	"time"
 
-	smapi "github.com/scaleway/scaleway-sdk-go/api/secret/v1alpha1"
+	smapi "github.com/scaleway/scaleway-sdk-go/api/secret/v1beta1"
 	"github.com/scaleway/scaleway-sdk-go/scw"
 	"github.com/tidwall/gjson"
 	corev1 "k8s.io/api/core/v1"
@@ -336,7 +336,7 @@ func (c *client) GetAllSecrets(ctx context.Context, ref esv1beta1.ExternalSecret
 		}
 
 		totalFetched := uint64(*request.Page-1)*uint64(*request.PageSize) + uint64(len(response.Secrets))
-		done = totalFetched == uint64(response.TotalCount)
+		done = totalFetched == response.TotalCount
 
 		*request.Page++
 

+ 2 - 2
pkg/provider/scaleway/fake_secret_api_test.go

@@ -20,7 +20,7 @@ import (
 	"strconv"
 
 	"github.com/google/uuid"
-	smapi "github.com/scaleway/scaleway-sdk-go/api/secret/v1alpha1"
+	smapi "github.com/scaleway/scaleway-sdk-go/api/secret/v1beta1"
 	"github.com/scaleway/scaleway-sdk-go/scw"
 )
 
@@ -316,7 +316,7 @@ func (f *fakeSecretAPI) ListSecrets(request *smapi.ListSecretsRequest, _ ...scw.
 	// pagination
 
 	response := smapi.ListSecretsResponse{
-		TotalCount: uint32(len(matches)),
+		TotalCount: uint64(len(matches)),
 	}
 
 	if request.Page == nil || request.PageSize == nil {

+ 1 - 1
pkg/provider/scaleway/provider.go

@@ -18,7 +18,7 @@ import (
 	"context"
 	"fmt"
 
-	smapi "github.com/scaleway/scaleway-sdk-go/api/secret/v1alpha1"
+	smapi "github.com/scaleway/scaleway-sdk-go/api/secret/v1beta1"
 	"github.com/scaleway/scaleway-sdk-go/scw"
 	"github.com/scaleway/scaleway-sdk-go/validation"
 	ctrl "sigs.k8s.io/controller-runtime"

+ 1 - 1
pkg/provider/scaleway/secret_api.go

@@ -15,7 +15,7 @@ limitations under the License.
 package scaleway
 
 import (
-	smapi "github.com/scaleway/scaleway-sdk-go/api/secret/v1alpha1"
+	smapi "github.com/scaleway/scaleway-sdk-go/api/secret/v1beta1"
 	"github.com/scaleway/scaleway-sdk-go/scw"
 )