mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
Merge pull request #71537 from davidz627/fix/updateGCE
Create cloud-sa on GCE PD Driver creation
This commit is contained in:
commit
3156df3e80
@ -38,7 +38,6 @@ package drivers
|
||||
import (
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"time"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
storagev1 "k8s.io/api/storage/v1"
|
||||
@ -258,14 +257,8 @@ func (g *gcePDCSIDriver) GetDriverInfo() *DriverInfo {
|
||||
|
||||
func (g *gcePDCSIDriver) SkipUnsupportedTest(pattern testpatterns.TestPattern) {
|
||||
f := g.driverInfo.Framework
|
||||
cs := f.ClientSet
|
||||
config := g.driverInfo.Config
|
||||
framework.SkipUnlessProviderIs("gce", "gke")
|
||||
framework.SkipIfMultizone(cs)
|
||||
|
||||
// TODO(#62561): Use credentials through external pod identity when that goes GA instead of downloading keys.
|
||||
createGCESecrets(cs, config)
|
||||
framework.SkipUnlessSecretExistsAfterWait(cs, "cloud-sa", config.Namespace, 3*time.Minute)
|
||||
framework.SkipIfMultizone(f.ClientSet)
|
||||
}
|
||||
|
||||
func (g *gcePDCSIDriver) GetDynamicProvisionStorageClass(fsType string) *storagev1.StorageClass {
|
||||
@ -292,6 +285,8 @@ func (g *gcePDCSIDriver) CreateDriver() {
|
||||
// DriverContainerName: "gce-driver",
|
||||
// ProvisionerContainerName: "csi-external-provisioner",
|
||||
// }
|
||||
createGCESecrets(g.driverInfo.Framework.ClientSet, g.driverInfo.Config)
|
||||
|
||||
cleanup, err := g.driverInfo.Framework.CreateFromManifests(nil,
|
||||
"test/e2e/testing-manifests/storage-csi/driver-registrar/rbac.yaml",
|
||||
"test/e2e/testing-manifests/storage-csi/external-attacher/rbac.yaml",
|
||||
|
@ -28,6 +28,7 @@ import (
|
||||
"path/filepath"
|
||||
|
||||
"k8s.io/api/core/v1"
|
||||
apierrors "k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/util/uuid"
|
||||
|
||||
@ -115,5 +116,7 @@ func createGCESecrets(client clientset.Interface, config framework.VolumeTestCon
|
||||
}
|
||||
|
||||
_, err = client.CoreV1().Secrets(config.Namespace).Create(s)
|
||||
framework.ExpectNoError(err, "Failed to create Secret %v", s.GetName())
|
||||
if !apierrors.IsAlreadyExists(err) {
|
||||
framework.ExpectNoError(err, "Failed to create Secret %v", s.GetName())
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user