mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-11 07:20:22 +00:00
Compare commits
28 Commits
v1.12.2-rc
...
release-1.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
18ee078dff | ||
|
|
6d33b18bad | ||
|
|
a814e855f2 | ||
|
|
0f3a2eb2fd | ||
|
|
6e6c9cfe79 | ||
|
|
316d860257 | ||
|
|
81d91dbb97 | ||
|
|
6f6998a343 | ||
|
|
79f27bf33a | ||
|
|
cfc6eef0a8 | ||
|
|
1506913f75 | ||
|
|
e00ea7c11a | ||
|
|
94b41f727c | ||
|
|
a818c97dde | ||
|
|
106f8a0376 | ||
|
|
3c636760af | ||
|
|
de1722b001 | ||
|
|
0ceb3850e7 | ||
|
|
ae4cfa9e0e | ||
|
|
796913c3cc | ||
|
|
4a8d2b00fb | ||
|
|
ccf699171d | ||
|
|
c11b682ec4 | ||
|
|
1d656a0aec | ||
|
|
764143da8d | ||
|
|
dbce8a2e90 | ||
|
|
1a8e660ea3 | ||
|
|
3607bf0f72 |
4
.github/workflows/push.yml
vendored
4
.github/workflows/push.yml
vendored
@@ -2,7 +2,9 @@ name: Main CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
branches:
|
||||
- 'main'
|
||||
- 'release-**'
|
||||
tags:
|
||||
- '*'
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
FROM --platform=$BUILDPLATFORM golang:1.17 as builder-env
|
||||
FROM --platform=$BUILDPLATFORM golang:1.17.8 as builder-env
|
||||
|
||||
ARG GOPROXY
|
||||
ARG PKG
|
||||
@@ -50,7 +50,8 @@ RUN mkdir -p /output/usr/bin && \
|
||||
go build -o /output/${BIN} \
|
||||
-ldflags "${LDFLAGS}" ${PKG}/cmd/${BIN}
|
||||
|
||||
FROM gcr.io/distroless/base-debian10:nonroot
|
||||
# The digest for tag 'nonroot' at the time of the release
|
||||
FROM gcr.io/distroless/base-debian10@sha256:6dc8ca7c3bbdb1a00fd8f1229b1b8c88986a5818b830e3a42d4946982dbbf18b
|
||||
|
||||
LABEL maintainer="Nolan Brubaker <brubakern@vmware.com>"
|
||||
|
||||
|
||||
@@ -1,3 +1,23 @@
|
||||
## v1.8.1
|
||||
### 2022-03-04
|
||||
|
||||
### Download
|
||||
https://github.com/vmware-tanzu/velero/releases/tag/v1.8.1
|
||||
|
||||
### Container Image
|
||||
`velero/velero:v1.8.1`
|
||||
|
||||
### Documentation
|
||||
https://velero.io/docs/v1.8
|
||||
|
||||
### Upgrading
|
||||
https://velero.io/docs/v1.8/upgrade-to-1.8/
|
||||
|
||||
### All changes
|
||||
* Bypass the remap CRD version plugin when v1beta1 CRD is not supported (#4706, @reasonerjt)
|
||||
* Support regional pv for GKE (#4691, @jxun)
|
||||
* Bump up golang to 1.17.8 (#4721, @ywk253100)
|
||||
|
||||
## v1.8.0
|
||||
### 2022-01-14
|
||||
|
||||
@@ -31,6 +51,8 @@ Starting v1.8 velero will only support v1 CRD, therefore, it will only run on Ku
|
||||
|
||||
### All changes
|
||||
|
||||
* E2E SSR test add retry mechanism and logs (#4594, @mqiu)
|
||||
* Update doc for v1.8 (#4517, @reasonerjt)
|
||||
* E2E test on ssr object with controller namespace mix-ups (#4521, @mqiu)
|
||||
* Check whether the volume is provisioned by CSI driver or not by the annotation as well (#4513, @ywk253100)
|
||||
* Initialize the labels field of `velero backup-location create` option to avoid #4484 (#4491, @ywk253100)
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
Update doc for v1.8
|
||||
@@ -12,7 +12,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
FROM golang:1.17
|
||||
FROM golang:1.17.8
|
||||
|
||||
ARG GOPROXY
|
||||
|
||||
|
||||
@@ -56,26 +56,24 @@ elif [[ "$triggeredBy" == "tags" ]]; then
|
||||
TAG=$(echo $GITHUB_REF | cut -d / -f 3)
|
||||
fi
|
||||
|
||||
if [[ "$BRANCH" == "main" ]]; then
|
||||
VERSION="$BRANCH"
|
||||
elif [[ ! -z "$TAG" ]]; then
|
||||
TAG_LATEST=false
|
||||
if [[ ! -z "$TAG" ]]; then
|
||||
echo "We're building tag $TAG"
|
||||
VERSION="$TAG"
|
||||
# Explicitly checkout tags when building from a git tag.
|
||||
# This is not needed when building from main
|
||||
git fetch --tags
|
||||
# Calculate the latest release if there's a tag.
|
||||
highest_release
|
||||
VERSION="$TAG"
|
||||
if [[ "$TAG" == "$HIGHEST" ]]; then
|
||||
TAG_LATEST=true
|
||||
fi
|
||||
else
|
||||
echo "We're not on main and we're not building a tag, exit early."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Assume we're not tagging `latest` by default, and never on main.
|
||||
TAG_LATEST=false
|
||||
if [[ "$BRANCH" == "main" ]]; then
|
||||
echo "Building main, not tagging latest."
|
||||
elif [[ "$TAG" == "$HIGHEST" ]]; then
|
||||
TAG_LATEST=true
|
||||
echo "We're on branch $BRANCH"
|
||||
VERSION="$BRANCH"
|
||||
if [[ "$VERSION" == release-* ]]; then
|
||||
VERSION=${VERSION}-dev
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -z "$BUILDX_PLATFORMS" ]]; then
|
||||
@@ -87,6 +85,7 @@ echo "Highest tag found: $HIGHEST"
|
||||
echo "BRANCH: $BRANCH"
|
||||
echo "TAG: $TAG"
|
||||
echo "TAG_LATEST: $TAG_LATEST"
|
||||
echo "VERSION: $VERSION"
|
||||
echo "BUILDX_PLATFORMS: $BUILDX_PLATFORMS"
|
||||
|
||||
echo "Building and pushing container images."
|
||||
|
||||
@@ -47,6 +47,7 @@ import (
|
||||
"github.com/vmware-tanzu/velero/pkg/plugin/velero"
|
||||
"github.com/vmware-tanzu/velero/pkg/podexec"
|
||||
"github.com/vmware-tanzu/velero/pkg/restic"
|
||||
"github.com/vmware-tanzu/velero/pkg/util/boolptr"
|
||||
"github.com/vmware-tanzu/velero/pkg/util/collections"
|
||||
)
|
||||
|
||||
@@ -200,7 +201,7 @@ func (kb *kubernetesBackupper) BackupWithResolvers(log logrus.FieldLogger,
|
||||
backupRequest.ResourceIncludesExcludes = collections.GetResourceIncludesExcludes(kb.discoveryHelper, backupRequest.Spec.IncludedResources, backupRequest.Spec.ExcludedResources)
|
||||
log.Infof("Including resources: %s", backupRequest.ResourceIncludesExcludes.IncludesString())
|
||||
log.Infof("Excluding resources: %s", backupRequest.ResourceIncludesExcludes.ExcludesString())
|
||||
log.Infof("Backing up all pod volumes using restic: %t", *backupRequest.Backup.Spec.DefaultVolumesToRestic)
|
||||
log.Infof("Backing up all pod volumes using restic: %t", boolptr.IsSetToTrue(backupRequest.Backup.Spec.DefaultVolumesToRestic))
|
||||
|
||||
var err error
|
||||
backupRequest.ResourceHooks, err = getResourceHooks(backupRequest.Spec.Hooks.Resources, kb.discoveryHelper)
|
||||
|
||||
@@ -21,6 +21,7 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
@@ -384,6 +385,7 @@ const (
|
||||
awsEbsCsiZoneKey = "topology.ebs.csi.aws.com/zone"
|
||||
azureCsiZoneKey = "topology.disk.csi.azure.com/zone"
|
||||
gkeCsiZoneKey = "topology.gke.io/zone"
|
||||
gkeZoneSeparator = "__"
|
||||
)
|
||||
|
||||
// takePVSnapshot triggers a snapshot for the volume/disk underlying a PersistentVolume if the provided
|
||||
@@ -539,15 +541,27 @@ func zoneFromPVNodeAffinity(res *corev1api.PersistentVolume, topologyKeys ...str
|
||||
return "", ""
|
||||
}
|
||||
keySet := sets.NewString(topologyKeys...)
|
||||
providerGke := false
|
||||
zones := make([]string, 0)
|
||||
for _, term := range nodeAffinity.Required.NodeSelectorTerms {
|
||||
if term.MatchExpressions == nil {
|
||||
continue
|
||||
}
|
||||
for _, exp := range term.MatchExpressions {
|
||||
if keySet.Has(exp.Key) && exp.Operator == "In" && len(exp.Values) > 0 {
|
||||
return exp.Key, exp.Values[0]
|
||||
if exp.Key == gkeCsiZoneKey {
|
||||
providerGke = true
|
||||
zones = append(zones, exp.Values[0])
|
||||
} else {
|
||||
return exp.Key, exp.Values[0]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if providerGke {
|
||||
return gkeCsiZoneKey, strings.Join(zones, gkeZoneSeparator)
|
||||
}
|
||||
|
||||
return "", ""
|
||||
}
|
||||
|
||||
@@ -131,6 +131,36 @@ func Test_zoneFromPVNodeAffinity(t *testing.T) {
|
||||
wantKey: "topology.disk.csi.azure.com/zone",
|
||||
wantValue: "us-central",
|
||||
},
|
||||
{
|
||||
/* an valid example of node affinity in a GKE's regional PV
|
||||
nodeAffinity:
|
||||
required:
|
||||
nodeSelectorTerms:
|
||||
- matchExpressions:
|
||||
- key: topology.gke.io/zone
|
||||
operator: In
|
||||
values:
|
||||
- us-central1-a
|
||||
- matchExpressions:
|
||||
- key: topology.gke.io/zone
|
||||
operator: In
|
||||
values:
|
||||
- us-central1-c
|
||||
*/
|
||||
name: "Volume with multiple valid keys, and provider is gke, returns all valid entries's first zone value",
|
||||
pv: builder.ForPersistentVolume("multi-matching-pv").NodeAffinityRequired(
|
||||
builder.ForNodeSelector(
|
||||
*builder.NewNodeSelectorTermBuilder().WithMatchExpression("topology.gke.io/zone",
|
||||
"In", "us-central1-c").Result(),
|
||||
*builder.NewNodeSelectorTermBuilder().WithMatchExpression("topology.gke.io/zone",
|
||||
"In", "us-east-2c", "us-east-2b").Result(),
|
||||
*builder.NewNodeSelectorTermBuilder().WithMatchExpression("topology.gke.io/zone",
|
||||
"In", "europe-north1-a").Result(),
|
||||
).Result(),
|
||||
).Result(),
|
||||
wantKey: "topology.gke.io/zone",
|
||||
wantValue: "us-central1-c__us-east-2c__europe-north1-a",
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
|
||||
@@ -30,6 +30,8 @@ import (
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
|
||||
velerodiscovery "github.com/vmware-tanzu/velero/pkg/discovery"
|
||||
|
||||
v1 "github.com/vmware-tanzu/velero/pkg/apis/velero/v1"
|
||||
"github.com/vmware-tanzu/velero/pkg/plugin/velero"
|
||||
)
|
||||
@@ -37,13 +39,14 @@ import (
|
||||
// RemapCRDVersionAction inspects CustomResourceDefinition and decides if it is a v1
|
||||
// CRD that needs to be backed up as v1beta1.
|
||||
type RemapCRDVersionAction struct {
|
||||
logger logrus.FieldLogger
|
||||
betaCRDClient apiextv1beta1client.CustomResourceDefinitionInterface
|
||||
logger logrus.FieldLogger
|
||||
betaCRDClient apiextv1beta1client.CustomResourceDefinitionInterface
|
||||
discoveryHelper velerodiscovery.Helper
|
||||
}
|
||||
|
||||
// NewRemapCRDVersionAction instantiates a new RemapCRDVersionAction plugin.
|
||||
func NewRemapCRDVersionAction(logger logrus.FieldLogger, betaCRDClient apiextv1beta1client.CustomResourceDefinitionInterface) *RemapCRDVersionAction {
|
||||
return &RemapCRDVersionAction{logger: logger, betaCRDClient: betaCRDClient}
|
||||
func NewRemapCRDVersionAction(logger logrus.FieldLogger, betaCRDClient apiextv1beta1client.CustomResourceDefinitionInterface, discoveryHelper velerodiscovery.Helper) *RemapCRDVersionAction {
|
||||
return &RemapCRDVersionAction{logger: logger, betaCRDClient: betaCRDClient, discoveryHelper: discoveryHelper}
|
||||
}
|
||||
|
||||
// AppliesTo selects the resources the plugin should run against. In this case, CustomResourceDefinitions.
|
||||
@@ -68,7 +71,26 @@ func (a *RemapCRDVersionAction) Execute(item runtime.Unstructured, backup *v1.Ba
|
||||
return item, nil, nil
|
||||
}
|
||||
|
||||
// We've got a v1 CRD, so proceed.
|
||||
// This plugin will exit if the CRD was installed via v1beta1 but the cluster does not support v1beta1 CRD
|
||||
supportv1b1 := false
|
||||
CheckVersion:
|
||||
for _, g := range a.discoveryHelper.APIGroups() {
|
||||
if g.Name == apiextv1.GroupName {
|
||||
for _, v := range g.Versions {
|
||||
if v.Version == apiextv1beta1.SchemeGroupVersion.Version {
|
||||
supportv1b1 = true
|
||||
break CheckVersion
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if !supportv1b1 {
|
||||
a.logger.Info("Exiting RemapCRDVersionAction, the cluster does not support v1beta1 CRD")
|
||||
return item, nil, nil
|
||||
}
|
||||
|
||||
// We've got a v1 CRD and the cluster supports v1beta1 CRD, so proceed.
|
||||
var crd apiextv1.CustomResourceDefinition
|
||||
|
||||
// Do not use runtime.DefaultUnstructuredConverter.FromUnstructured here because it has a bug when converting integers/whole
|
||||
|
||||
@@ -32,6 +32,8 @@ import (
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
|
||||
velerodiscovery "github.com/vmware-tanzu/velero/pkg/discovery"
|
||||
|
||||
v1 "github.com/vmware-tanzu/velero/pkg/apis/velero/v1"
|
||||
"github.com/vmware-tanzu/velero/pkg/builder"
|
||||
velerotest "github.com/vmware-tanzu/velero/pkg/test"
|
||||
@@ -48,8 +50,7 @@ func TestRemapCRDVersionAction(t *testing.T) {
|
||||
c := b.Result()
|
||||
_, err := betaClient.Create(context.TODO(), c, metav1.CreateOptions{})
|
||||
require.NoError(t, err)
|
||||
|
||||
a := NewRemapCRDVersionAction(velerotest.NewLogger(), betaClient)
|
||||
a := NewRemapCRDVersionAction(velerotest.NewLogger(), betaClient, fakeDiscoveryHelper())
|
||||
|
||||
t.Run("Test a v1 CRD without any Schema information", func(t *testing.T) {
|
||||
b := builder.ForV1CustomResourceDefinition("test.velero.io")
|
||||
@@ -109,6 +110,33 @@ func TestRemapCRDVersionAction(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, "apiextensions.k8s.io/v1beta1", item.UnstructuredContent()["apiVersion"])
|
||||
})
|
||||
|
||||
t.Run("When the cluster only supports v1 CRD, v1 CRD will be returned even the input has Spec.PreserveUnknownFields set to true (issue 4080)", func(t *testing.T) {
|
||||
a.discoveryHelper = &velerotest.FakeDiscoveryHelper{
|
||||
APIGroupsList: []metav1.APIGroup{
|
||||
{
|
||||
Name: apiextv1.GroupName,
|
||||
Versions: []metav1.GroupVersionForDiscovery{
|
||||
{
|
||||
Version: apiextv1.SchemeGroupVersion.Version,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
b := builder.ForV1CustomResourceDefinition("test.velero.io")
|
||||
b.PreserveUnknownFields(true)
|
||||
c := b.Result()
|
||||
obj, err := runtime.DefaultUnstructuredConverter.ToUnstructured(&c)
|
||||
require.NoError(t, err)
|
||||
|
||||
item, _, err := a.Execute(&unstructured.Unstructured{Object: obj}, backup)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, "apiextensions.k8s.io/v1", item.UnstructuredContent()["apiVersion"])
|
||||
// set it back to the default one
|
||||
a.discoveryHelper = fakeDiscoveryHelper()
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
// TestRemapCRDVersionActionData tests the RemapCRDVersionAction plugin against actual CRD to confirm that the v1beta1 version is returned when the v1 version is passed in to the plugin.
|
||||
@@ -116,8 +144,7 @@ func TestRemapCRDVersionActionData(t *testing.T) {
|
||||
backup := &v1.Backup{}
|
||||
clientset := apiextfakes.NewSimpleClientset()
|
||||
betaClient := clientset.ApiextensionsV1beta1().CustomResourceDefinitions()
|
||||
|
||||
a := NewRemapCRDVersionAction(velerotest.NewLogger(), betaClient)
|
||||
a := NewRemapCRDVersionAction(velerotest.NewLogger(), betaClient, fakeDiscoveryHelper())
|
||||
|
||||
tests := []struct {
|
||||
crd string
|
||||
@@ -192,3 +219,21 @@ func TestRemapCRDVersionActionData(t *testing.T) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func fakeDiscoveryHelper() velerodiscovery.Helper {
|
||||
return &velerotest.FakeDiscoveryHelper{
|
||||
APIGroupsList: []metav1.APIGroup{
|
||||
{
|
||||
Name: apiextv1.GroupName,
|
||||
Versions: []metav1.GroupVersionForDiscovery{
|
||||
{
|
||||
Version: apiextv1beta1.SchemeGroupVersion.Version,
|
||||
},
|
||||
{
|
||||
Version: apiextv1.SchemeGroupVersion.Version,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,7 +110,16 @@ func newRemapCRDVersionAction(f client.Factory) veleroplugin.HandlerInitializer
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return backup.NewRemapCRDVersionAction(logger, client.ApiextensionsV1beta1().CustomResourceDefinitions()), nil
|
||||
clientset, err := f.KubeClient()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
discoveryHelper, err := velerodiscovery.NewHelper(clientset.Discovery(), logger)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return backup.NewRemapCRDVersionAction(logger, client.ApiextensionsV1beta1().CustomResourceDefinitions(), discoveryHelper), nil
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -54,14 +54,10 @@ You will need to give your plugin(s) the full name when registering them by call
|
||||
Velero supports the following kinds of plugins:
|
||||
|
||||
- **Object Store** - persists and retrieves backups, backup logs and restore logs
|
||||
- **Item Snapshotter** - creates snapshots for Kubernetes objects during backup and restores the object from snapshots during restore. ItemSnapshotters
|
||||
are typically used with the [Astrolabe](https://github.com/vmware-tanzu/astrolabe) framework.
|
||||
- **Volume Snapshotter** - creates volume snapshots (during backup) and restores volumes from snapshots (during restore)
|
||||
- **Backup Item Action** - executes arbitrary logic for individual items prior to storing them in a backup file
|
||||
- **Restore Item Action** - executes arbitrary logic for individual items prior to restoring them into a cluster
|
||||
- **Delete Item Action** - executes arbitrary logic based on individual items within a backup prior to deleting the backup
|
||||
## Deprecated plugin kinds
|
||||
- **Volume Snapshotter** - creates volume snapshots (during backup) and restores volumes from snapshots (during restore) VolumeSnapshotters
|
||||
are deprecated and will be replaced with ItemSnapshotter/Astrolabe plugins.
|
||||
|
||||
## Plugin Logging
|
||||
|
||||
@@ -103,8 +99,7 @@ data:
|
||||
# add your configuration data here as key-value pairs
|
||||
```
|
||||
|
||||
Then, in your plugin's implementation, you can read this ConfigMap to fetch the necessary configuration. See the [restic restore action][3]
|
||||
for an example of this -- in particular, the `getPluginConfig(...)` function.
|
||||
Then, in your plugin's implementation, you can read this ConfigMap to fetch the necessary configuration.
|
||||
|
||||
## Feature Flags
|
||||
|
||||
@@ -118,4 +113,3 @@ Velero adds the `LD_LIBRARY_PATH` into the list of environment variables to prov
|
||||
|
||||
[1]: https://github.com/vmware-tanzu/velero-plugin-example
|
||||
[2]: https://github.com/vmware-tanzu/velero/blob/main/pkg/plugin/logger.go
|
||||
[3]: https://github.com/vmware-tanzu/velero/blob/main/pkg/restore/restic_restore_action.go
|
||||
|
||||
@@ -73,16 +73,30 @@ func SSRTest() {
|
||||
fmt.Sprintf("Failed to create an ssr object in %s namespace", VeleroCfg.VeleroNamespace))
|
||||
|
||||
ssrListResp := new(v1.ServerStatusRequestList)
|
||||
|
||||
By(fmt.Sprintf("Check ssr object in %s namespace", VeleroCfg.VeleroNamespace))
|
||||
Expect(client.Kubebuilder.List(ctx, ssrListResp, &kbclient.ListOptions{Namespace: VeleroCfg.VeleroNamespace})).To(Succeed(),
|
||||
fmt.Sprintf("Failed to list ssr object in %s namespace", VeleroCfg.VeleroNamespace))
|
||||
Expect(len(ssrListResp.Items)).To(BeNumerically("==", 1),
|
||||
fmt.Sprintf("Count of ssr object in %s namespace is not 1", VeleroCfg.VeleroNamespace))
|
||||
Expect(ssrListResp.Items[0].Status.ServerVersion).NotTo(BeEmpty(),
|
||||
fmt.Sprintf("ServerVersion of ssr object in %s namespace should not empty", VeleroCfg.VeleroNamespace))
|
||||
Expect(ssrListResp.Items[0].Status.Phase == "Processed").To(BeTrue(),
|
||||
fmt.Sprintf("Phase of ssr object in %s namespace should be Processed", VeleroCfg.VeleroNamespace))
|
||||
err = waitutil.PollImmediate(5*time.Second, time.Minute,
|
||||
func() (bool, error) {
|
||||
if err = client.Kubebuilder.List(ctx, ssrListResp, &kbclient.ListOptions{Namespace: VeleroCfg.VeleroNamespace}); err != nil {
|
||||
return false, fmt.Errorf("failed to list ssr object in %s namespace with err %v", VeleroCfg.VeleroNamespace, err)
|
||||
}
|
||||
if len(ssrListResp.Items) != 1 {
|
||||
return false, fmt.Errorf("count of ssr object in %s namespace is not 1", VeleroCfg.VeleroNamespace)
|
||||
}
|
||||
|
||||
if ssrListResp.Items[0].Status.ServerVersion == "" {
|
||||
fmt.Printf("ServerVersion of ssr object in %s namespace should not empty, current response result %v\n", VeleroCfg.VeleroNamespace, ssrListResp)
|
||||
return false, nil
|
||||
}
|
||||
|
||||
if ssrListResp.Items[0].Status.Phase != "Processed" {
|
||||
return false, fmt.Errorf("phase of ssr object in %s namespace should be Processed but got phase %s", VeleroCfg.VeleroNamespace, ssrListResp.Items[0].Status.Phase)
|
||||
}
|
||||
return true, nil
|
||||
})
|
||||
if err == waitutil.ErrWaitTimeout {
|
||||
fmt.Printf("exceed test case deadline and failed to check ssr object in %s namespace", VeleroCfg.VeleroNamespace)
|
||||
}
|
||||
Expect(err).To(Succeed(), fmt.Sprintf("Failed to check ssr object in %s namespace", VeleroCfg.VeleroNamespace))
|
||||
|
||||
By(fmt.Sprintf("Check ssr object in %s namespace", testNS))
|
||||
Expect(client.Kubebuilder.List(ctx, ssrListResp, &kbclient.ListOptions{Namespace: testNS})).To(Succeed(),
|
||||
|
||||
@@ -70,10 +70,16 @@ var pluginsMatrix = map[string]map[string][]string{
|
||||
"vsphere": {"velero/velero-plugin-for-aws:v1.3.0", "vsphereveleroplugin/velero-plugin-for-vsphere:v1.3.0"},
|
||||
"gcp": {"velero/velero-plugin-for-gcp:v1.3.0"},
|
||||
},
|
||||
"v1.8": {
|
||||
"aws": {"velero/velero-plugin-for-aws:v1.4.0"},
|
||||
"azure": {"velero/velero-plugin-for-microsoft-azure:v1.4.0"},
|
||||
"vsphere": {"velero/velero-plugin-for-aws:v1.4.0", "vsphereveleroplugin/velero-plugin-for-vsphere:v1.3.1"},
|
||||
"gcp": {"velero/velero-plugin-for-gcp:v1.4.0"},
|
||||
},
|
||||
"main": {
|
||||
"aws": {"velero/velero-plugin-for-aws:main"},
|
||||
"azure": {"velero/velero-plugin-for-microsoft-azure:main"},
|
||||
"vsphere": {"velero/velero-plugin-for-aws:main", "vsphereveleroplugin/velero-plugin-for-vsphere:v1.3.0"},
|
||||
"vsphere": {"velero/velero-plugin-for-aws:main", "vsphereveleroplugin/velero-plugin-for-vsphere:v1.3.1"},
|
||||
"gcp": {"velero/velero-plugin-for-gcp:main"},
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user