Compare commits

...

28 Commits

Author SHA1 Message Date
Wenkai Yin(尹文开)
18ee078dff Merge pull request #4721 from ywk253100/220307_golang_1.8
Bump up golang to 1.17.8
2022-03-07 14:28:14 +08:00
Wenkai Yin(尹文开)
6d33b18bad Bump up golang to 1.17.8
Bump up golang to 1.17.8

Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
2022-03-07 13:52:26 +08:00
qiuming
a814e855f2 Merge pull request #4717 from ywk253100/220304_1.8.1_changelog
Generate the changelog for v1.8.1
2022-03-04 09:45:36 +08:00
Wenkai Yin(尹文开)
0f3a2eb2fd Generate the changelog for v1.8.1
Generate the changelog for v1.8.1

Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
2022-03-04 07:59:05 +08:00
Daniel Jiang
6e6c9cfe79 Bypass the remap CRD version plugin when v1beta1 CRD is not supported (#4706)
When velero is running on clusters that don't support v1beta1 CRD, the
plugin will not try to backup v1beta1 CRD.
The plugin should be kept for backward compatibility.  It will be
removed when velero drop the support for k8s v1.21

Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2022-02-28 19:48:07 +08:00
Wenkai Yin(尹文开)
316d860257 Merge pull request #4676 from ywk253100/220221_push_1.8
[cherry-pick]Enable building and pushing image for release branches
2022-02-28 17:04:23 +08:00
Wenkai Yin(尹文开)
81d91dbb97 Append "-dev" suffix for the image tag of release branches
Append "-dev" suffix for the image tag of release branches: release-1.0-dev

Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
2022-02-28 16:06:25 +08:00
Wenkai Yin(尹文开)
6f6998a343 Enable building and pushing image for release branches
Enable building and pushing image for release branches

Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
2022-02-28 16:06:25 +08:00
Daniel Jiang
79f27bf33a Merge pull request #4691 from blackpiglet/4663-add-regional-disk-support-to-1.8
[cherry-pick] 4663 add regional disk support to 1.8
2022-02-24 15:47:55 +08:00
Xun Jiang
cfc6eef0a8 Modify according to comments
1. rename zoneSeparator to gkeZoneSeparator
2. add example of regional PV's node affinity. modify test case description.

Signed-off-by: Xun Jiang <jxun@vmware.com>
2022-02-23 09:52:20 +08:00
Xun Jiang
1506913f75 [fix] Add regional PV support for GKE
fix #4663.
For GKE pv, when create backup, return all zones retrived from node affinity.

Signed-off-by: Xun Jiang <jxun@vmware.com>
2022-02-23 09:45:55 +08:00
Scott Seago
e00ea7c11a Merge pull request #4675 from ywk253100/220221_nil_value_1.8
[cherry-pick]Check for nil before logging DefaultVolumesToRestic value
2022-02-21 10:36:03 -05:00
Wenkai Yin(尹文开)
94b41f727c Check for nil before logging DefaultVolumesToRestic value
Check for nil before logging DefaultVolumesToRestic value

Fixes #4617

Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
2022-02-21 17:35:16 +08:00
Wenkai Yin(尹文开)
a818c97dde Merge pull request #4602 from reasonerjt/cleanup-changelog-1.8
Clean up the change log for v1.8
2022-01-30 21:55:59 +08:00
Wenkai Yin(尹文开)
106f8a0376 Merge branch 'release-1.8' into cleanup-changelog-1.8 2022-01-30 21:42:43 +08:00
Wenkai Yin(尹文开)
3c636760af Merge pull request #4604 from reasonerjt/custom-plugin-doc-update-1.8
[Cherry pick to 1.8] Undeprecate the volumesnapshot plugin in the doc
2022-01-30 21:41:18 +08:00
Daniel Jiang
de1722b001 Undeprecate the volumesnapshot plugin in the doc
Since Itemsnapshotter plugin is still WIP,
this commit removes the reference and the deprecation of volumeSnapshotter plugin
from the doc to avoid confusion.
We'll update the doc when it's ready and we have a reference
implementation.

Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2022-01-30 16:15:53 +08:00
Daniel Jiang
0ceb3850e7 Clean up the change log
Clean up the cherrypicked changelog files for 1.8 branch

Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2022-01-30 14:35:03 +08:00
qiuming
ae4cfa9e0e Merge pull request #4600 from danfengliu/cherry-pick-change-1.8-e2e-plugins-version-to-release-version
[cherry pick 1.8] Change 1.8 plugins version to release version
2022-01-29 18:30:51 +08:00
danfengl
796913c3cc cherry pick to 1.8 Change 1.8 plugins version to release version
Signed-off-by: danfengl <danfengl@vmware.com>
2022-01-29 10:19:22 +00:00
danfengliu
4a8d2b00fb Merge pull request #4596 from danfengliu/cherry-pick-add-1.8-plugin-to-e2e
[cherry-pick 1.8] Add 1.8 plugins map in e2e test
2022-01-29 17:43:29 +08:00
danfengl
ccf699171d Cherry pick to1.8 - Add 1.8 plugins map in e2e test
Signed-off-by: danfengl <danfengl@vmware.com>
2022-01-29 09:30:32 +00:00
qiuming
c11b682ec4 Merge pull request #4594 from qiuming-best/release-1.8
E2E SSR test add retry mechanism and logs
2022-01-29 17:06:51 +08:00
Ming
1d656a0aec E2E SSR test add retry mechanism and logs
Signed-off-by: Ming <mqiu@vmware.com>
2022-01-29 16:25:01 +08:00
Wenkai Yin(尹文开)
764143da8d Merge pull request #4568 from reasonerjt/fix-custom-plugin-doc-1.8
[Cherrypick-1.8] Remove reference of restic_restore_action.go from the doc
2022-01-26 10:21:01 +08:00
Daniel Jiang
dbce8a2e90 Remove reference of restic_restore_action.go from the doc
fixes #4554

Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2022-01-24 15:26:53 +08:00
danfengliu
1a8e660ea3 Merge pull request #4535 from reasonerjt/pin-img
Pin the base image and golang img for v1.8.0 release
2022-01-17 09:38:46 +08:00
Daniel Jiang
3607bf0f72 Pin the base image and golang img for v1.8.0 release
Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2022-01-16 23:54:59 +08:00
15 changed files with 207 additions and 49 deletions

View File

@@ -2,7 +2,9 @@ name: Main CI
on:
push:
branches: [ main ]
branches:
- 'main'
- 'release-**'
tags:
- '*'

View File

@@ -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>"

View File

@@ -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)

View File

@@ -1 +0,0 @@
Update doc for v1.8

View File

@@ -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

View File

@@ -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."

View File

@@ -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)

View File

@@ -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 "", ""
}

View File

@@ -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) {

View File

@@ -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

View File

@@ -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,
},
},
},
},
}
}

View File

@@ -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
}
}

View File

@@ -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

View File

@@ -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(),

View File

@@ -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"},
},
}