From 62aa70219bb4acef06dcf5c512ea7763f5d451b1 Mon Sep 17 00:00:00 2001 From: dongqingcc Date: Thu, 26 Feb 2026 17:10:28 +0800 Subject: [PATCH 01/55] Add e2e test case for PR 9255 Signed-off-by: dongqingcc --- test/e2e/e2e_suite_test.go | 5 + .../resource-filtering/wildcard_namespaces.go | 127 ++++++++++++++++++ 2 files changed, 132 insertions(+) create mode 100644 test/e2e/resource-filtering/wildcard_namespaces.go diff --git a/test/e2e/e2e_suite_test.go b/test/e2e/e2e_suite_test.go index f0d1c9c2e9..981aeee4c8 100644 --- a/test/e2e/e2e_suite_test.go +++ b/test/e2e/e2e_suite_test.go @@ -494,6 +494,11 @@ var _ = Describe( Label("ResourceFiltering", "IncludeNamespaces", "Restore"), RestoreWithIncludeNamespaces, ) +var _ = Describe( + "Velero test on backup/restore with wildcard namespaces", + Label("ResourceFiltering", "WildcardNamespaces"), + BackupWithWildcardNamespaces, +) var _ = Describe( "Velero test on include resources from the cluster backup", Label("ResourceFiltering", "IncludeResources", "Backup"), diff --git a/test/e2e/resource-filtering/wildcard_namespaces.go b/test/e2e/resource-filtering/wildcard_namespaces.go new file mode 100644 index 0000000000..670d1fe26d --- /dev/null +++ b/test/e2e/resource-filtering/wildcard_namespaces.go @@ -0,0 +1,127 @@ +/* +Copyright the Velero contributors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +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. +*/ + +package filtering + +import ( + "fmt" + + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + apierrors "k8s.io/apimachinery/pkg/api/errors" + + . "github.com/vmware-tanzu/velero/test/e2e/test" + . "github.com/vmware-tanzu/velero/test/util/k8s" +) + +// WildcardNamespaces tests the inclusion and exclusion of namespaces using wildcards +// introduced in PR #9255 (Issue #1874). +type WildcardNamespaces struct { + TestCase + namespacesToInclude []string + namespacesToExclude []string +} + +var BackupWithWildcardNamespaces func() = TestFunc(&WildcardNamespaces{}) + +func (w *WildcardNamespaces) Init() error { + Expect(w.TestCase.Init()).To(Succeed()) + + // Use CaseBaseName as a prefix for all namespaces so that the base + // TestCase.Destroy() and TestCase.Clean() can automatically garbage-collect them. + w.CaseBaseName = "wildcard-ns-" + w.UUIDgen + w.BackupName = "backup-" + w.CaseBaseName + w.RestoreName = "restore-" + w.CaseBaseName + + // Define specific namespaces to test both wildcard include and exclude + w.namespacesToInclude = []string{ + w.CaseBaseName + "-inc-wild-1", // Will be matched by *-inc-wild-* + w.CaseBaseName + "-inc-wild-2", // Will be matched by *-inc-wild-* + w.CaseBaseName + "-exact-inc", // Exact match + } + w.namespacesToExclude = []string{ + w.CaseBaseName + "-exc-wild-1", // Excluded by *-exc-wild-* + w.CaseBaseName + "-exc-wild-2", // Excluded by *-exc-wild-* + } + + w.TestMsg = &TestMSG{ + Desc: "Backup and restore with wildcard namespaces", + Text: "Should correctly backup and restore namespaces matching the include wildcard, and skip the exclude wildcard", + FailedMSG: "Failed to properly filter namespaces using wildcards", + } + + // Construct wildcard strings + incWildcard := fmt.Sprintf("%s-inc-wild-*", w.CaseBaseName) + excWildcard := fmt.Sprintf("%s-exc-wild-*", w.CaseBaseName) + exactInc := fmt.Sprintf("%s-exact-inc", w.CaseBaseName) + + // In backup args, we intentionally include the `excWildcard` in the include-namespaces + // to verify that `exclude-namespaces` correctly overrides it. + w.BackupArgs = []string{ + "create", "--namespace", w.VeleroCfg.VeleroNamespace, "backup", w.BackupName, + "--include-namespaces", fmt.Sprintf("%s,%s,%s", incWildcard, exactInc, excWildcard), + "--exclude-namespaces", excWildcard, + "--default-volumes-to-fs-backup", "--wait", + } + + w.RestoreArgs = []string{ + "create", "--namespace", w.VeleroCfg.VeleroNamespace, "restore", w.RestoreName, + "--from-backup", w.BackupName, "--wait", + } + + return nil +} + +func (w *WildcardNamespaces) CreateResources() error { + allNamespaces := append(w.namespacesToInclude, w.namespacesToExclude...) + + for _, ns := range allNamespaces { + By(fmt.Sprintf("Creating namespace %s", ns), func() { + Expect(CreateNamespace(w.Ctx, w.Client, ns)).To(Succeed(), fmt.Sprintf("Failed to create namespace %s", ns)) + }) + + // Create a ConfigMap in each namespace to verify resource restoration + cmName := "configmap-" + ns + By(fmt.Sprintf("Creating ConfigMap %s in namespace %s", cmName, ns), func() { + _, err := CreateConfigMap(w.Client.ClientGo, ns, cmName, map[string]string{"wildcard-test": "true"}, nil) + Expect(err).To(Succeed(), fmt.Sprintf("Failed to create configmap in namespace %s", ns)) + }) + } + return nil +} + +func (w *WildcardNamespaces) Verify() error { + // 1. Verify included namespaces and their resources were fully restored + for _, ns := range w.namespacesToInclude { + By(fmt.Sprintf("Checking included namespace %s exists", ns), func() { + _, err := GetNamespace(w.Ctx, w.Client, ns) + Expect(err).To(Succeed(), fmt.Sprintf("Included namespace %s should exist after restore", ns)) + + _, err = GetConfigMap(w.Client.ClientGo, ns, "configmap-"+ns) + Expect(err).To(Succeed(), fmt.Sprintf("ConfigMap in included namespace %s should exist", ns)) + }) + } + + // 2. Verify excluded namespaces were NOT restored + for _, ns := range w.namespacesToExclude { + By(fmt.Sprintf("Checking excluded namespace %s does NOT exist", ns), func() { + _, err := GetNamespace(w.Ctx, w.Client, ns) + Expect(err).To(HaveOccurred(), fmt.Sprintf("Excluded namespace %s should NOT exist after restore", ns)) + Expect(apierrors.IsNotFound(err)).To(BeTrue(), "Error should be NotFound") + }) + } + return nil +} From bbec46f6ee2d4bf4c7ca513c45c700f66d032fef Mon Sep 17 00:00:00 2001 From: dongqingcc Date: Thu, 26 Feb 2026 16:38:53 +0800 Subject: [PATCH 02/55] Add e2e test case for PR 9366: Use hookIndex for recording multiple restore exec hooks. Signed-off-by: dongqingcc --- test/e2e/basic/restore_exec_hooks.go | 150 +++++++++++++++++++++++++++ test/e2e/e2e_suite_test.go | 6 ++ 2 files changed, 156 insertions(+) create mode 100644 test/e2e/basic/restore_exec_hooks.go diff --git a/test/e2e/basic/restore_exec_hooks.go b/test/e2e/basic/restore_exec_hooks.go new file mode 100644 index 0000000000..fc1b8ceb8f --- /dev/null +++ b/test/e2e/basic/restore_exec_hooks.go @@ -0,0 +1,150 @@ +/* +Copyright the Velero contributors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +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. +*/ + +package basic + +import ( + "fmt" + "path" + "strings" + + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + + "github.com/vmware-tanzu/velero/test/e2e/test" + . "github.com/vmware-tanzu/velero/test/e2e/test" + "github.com/vmware-tanzu/velero/test/util/common" + . "github.com/vmware-tanzu/velero/test/util/k8s" +) + +// RestoreExecHooks tests that a pod with multiple restore exec hooks does not hang +// at the Finalizing phase during restore (Issue #9359 / PR #9366). +type RestoreExecHooks struct { + TestCase + podName string +} + +var RestoreExecHooksTest func() = test.TestFunc(&RestoreExecHooks{}) + +func (r *RestoreExecHooks) Init() error { + Expect(r.TestCase.Init()).To(Succeed()) + r.CaseBaseName = "restore-exec-hooks-" + r.UUIDgen + r.BackupName = "backup-" + r.CaseBaseName + r.RestoreName = "restore-" + r.CaseBaseName + r.podName = "pod-multiple-hooks" + r.NamespacesTotal = 1 + r.NSIncluded = &[]string{} + + for nsNum := 0; nsNum < r.NamespacesTotal; nsNum++ { + createNSName := fmt.Sprintf("%s-%00000d", r.CaseBaseName, nsNum) + *r.NSIncluded = append(*r.NSIncluded, createNSName) + } + + r.TestMsg = &test.TestMSG{ + Desc: "Restore pod with multiple restore exec hooks", + Text: "Should successfully backup and restore without hanging at Finalizing phase", + FailedMSG: "Failed to successfully backup and restore pod with multiple hooks", + } + + r.BackupArgs = []string{ + "create", "--namespace", r.VeleroCfg.VeleroNamespace, "backup", r.BackupName, + "--include-namespaces", strings.Join(*r.NSIncluded, ","), + "--default-volumes-to-fs-backup", "--wait", + } + + r.RestoreArgs = []string{ + "create", "--namespace", r.VeleroCfg.VeleroNamespace, "restore", r.RestoreName, + "--from-backup", r.BackupName, "--wait", + } + + return nil +} + +func (r *RestoreExecHooks) CreateResources() error { + for nsNum := 0; nsNum < r.NamespacesTotal; nsNum++ { + createNSName := fmt.Sprintf("%s-%00000d", r.CaseBaseName, nsNum) + + By(fmt.Sprintf("Creating namespace %s", createNSName), func() { + Expect(CreateNamespace(r.Ctx, r.Client, createNSName)). + To(Succeed(), fmt.Sprintf("Failed to create namespace %s", createNSName)) + }) + + // Prepare images and commands adaptively for the target OS + imageAddress := LinuxTestImage + initCommand := `["/bin/sh", "-c", "echo init-hook-done"]` + execCommand1 := `["/bin/sh", "-c", "echo hook1"]` + execCommand2 := `["/bin/sh", "-c", "echo hook2"]` + + if r.VeleroCfg.WorkerOS == common.WorkerOSLinux && r.VeleroCfg.ImageRegistryProxy != "" { + imageAddress = path.Join(r.VeleroCfg.ImageRegistryProxy, LinuxTestImage) + } else if r.VeleroCfg.WorkerOS == common.WorkerOSWindows { + imageAddress = WindowTestImage + initCommand = `["cmd", "/c", "echo init-hook-done"]` + execCommand1 = `["cmd", "/c", "echo hook1"]` + execCommand2 = `["cmd", "/c", "echo hook2"]` + } + + // Inject mixing InitContainer hook and multiple Exec post-restore hooks. + // This guarantees that the loop index 'i' mismatched 'hook.hookIndex' (Issue #9359), + // ensuring the bug is properly reproduced and the fix is verified. + ann := map[string]string{ + // Inject InitContainer Restore Hook + "init.hook.restore.velero.io/container-image": imageAddress, + "init.hook.restore.velero.io/container-name": "test-init-hook", + "init.hook.restore.velero.io/command": initCommand, + + // Inject multiple Exec Restore Hooks + "post.hook.restore.velero.io/test1.command": execCommand1, + "post.hook.restore.velero.io/test1.container": r.podName, + "post.hook.restore.velero.io/test2.command": execCommand2, + "post.hook.restore.velero.io/test2.container": r.podName, + } + + By(fmt.Sprintf("Creating pod %s with multiple restore hooks in namespace %s", r.podName, createNSName), func() { + _, err := CreatePod( + r.Client, + createNSName, + r.podName, + "", // No storage class needed + "", // No PVC needed + []string{}, // No volumes + nil, + ann, + r.VeleroCfg.ImageRegistryProxy, + r.VeleroCfg.WorkerOS, + ) + Expect(err).To(Succeed(), fmt.Sprintf("Failed to create pod with hooks in namespace %s", createNSName)) + }) + + By(fmt.Sprintf("Waiting for pod %s to be ready", r.podName), func() { + err := WaitForPods(r.Ctx, r.Client, createNSName, []string{r.podName}) + Expect(err).To(Succeed(), fmt.Sprintf("Failed to wait for pod %s in namespace %s", r.podName, createNSName)) + }) + } + return nil +} + +func (r *RestoreExecHooks) Verify() error { + for nsNum := 0; nsNum < r.NamespacesTotal; nsNum++ { + createNSName := fmt.Sprintf("%s-%00000d", r.CaseBaseName, nsNum) + + By(fmt.Sprintf("Verifying pod %s in namespace %s after restore", r.podName, createNSName), func() { + err := WaitForPods(r.Ctx, r.Client, createNSName, []string{r.podName}) + Expect(err).To(Succeed(), fmt.Sprintf("Failed to verify pod %s in namespace %s after restore", r.podName, createNSName)) + }) + } + return nil +} diff --git a/test/e2e/e2e_suite_test.go b/test/e2e/e2e_suite_test.go index f0d1c9c2e9..c19c2d52f3 100644 --- a/test/e2e/e2e_suite_test.go +++ b/test/e2e/e2e_suite_test.go @@ -440,6 +440,12 @@ var _ = Describe( StorageClasssChangingTest, ) +var _ = Describe( + "Restore phase does not block at Finalizing when a container has multiple exec hooks", + Label("Basic", "Hooks"), + RestoreExecHooksTest, +) + var _ = Describe( "Backup/restore of 2500 namespaces", Label("Scale", "LongTime"), From d315bca32b979f3c01b8c80ecdb81f9a3b9fa3c9 Mon Sep 17 00:00:00 2001 From: dongqingcc Date: Thu, 5 Mar 2026 11:23:57 +0800 Subject: [PATCH 03/55] add namespace wildcard test case for restore Signed-off-by: dongqingcc --- test/e2e/e2e_suite_test.go | 2 +- .../resource-filtering/wildcard_namespaces.go | 84 +++++++++++-------- 2 files changed, 51 insertions(+), 35 deletions(-) diff --git a/test/e2e/e2e_suite_test.go b/test/e2e/e2e_suite_test.go index 981aeee4c8..1632e79eb5 100644 --- a/test/e2e/e2e_suite_test.go +++ b/test/e2e/e2e_suite_test.go @@ -497,7 +497,7 @@ var _ = Describe( var _ = Describe( "Velero test on backup/restore with wildcard namespaces", Label("ResourceFiltering", "WildcardNamespaces"), - BackupWithWildcardNamespaces, + WildcardNamespacesTest, ) var _ = Describe( "Velero test on include resources from the cluster backup", diff --git a/test/e2e/resource-filtering/wildcard_namespaces.go b/test/e2e/resource-filtering/wildcard_namespaces.go index 670d1fe26d..c3cd50071d 100644 --- a/test/e2e/resource-filtering/wildcard_namespaces.go +++ b/test/e2e/resource-filtering/wildcard_namespaces.go @@ -28,65 +28,72 @@ import ( ) // WildcardNamespaces tests the inclusion and exclusion of namespaces using wildcards -// introduced in PR #9255 (Issue #1874). +// introduced in PR #9255 (Issue #1874). It verifies filtering at both Backup and Restore stages. type WildcardNamespaces struct { - TestCase - namespacesToInclude []string - namespacesToExclude []string + TestCase // Inherit from basic TestCase instead of FilteringCase to customize a single flow + restoredNS []string + excludedByBackupNS []string + excludedByRestoreNS []string } -var BackupWithWildcardNamespaces func() = TestFunc(&WildcardNamespaces{}) +// Register as a single E2E test +var WildcardNamespacesTest func() = TestFunc(&WildcardNamespaces{}) func (w *WildcardNamespaces) Init() error { Expect(w.TestCase.Init()).To(Succeed()) - // Use CaseBaseName as a prefix for all namespaces so that the base - // TestCase.Destroy() and TestCase.Clean() can automatically garbage-collect them. w.CaseBaseName = "wildcard-ns-" + w.UUIDgen w.BackupName = "backup-" + w.CaseBaseName w.RestoreName = "restore-" + w.CaseBaseName - // Define specific namespaces to test both wildcard include and exclude - w.namespacesToInclude = []string{ - w.CaseBaseName + "-inc-wild-1", // Will be matched by *-inc-wild-* - w.CaseBaseName + "-inc-wild-2", // Will be matched by *-inc-wild-* - w.CaseBaseName + "-exact-inc", // Exact match - } - w.namespacesToExclude = []string{ - w.CaseBaseName + "-exc-wild-1", // Excluded by *-exc-wild-* - w.CaseBaseName + "-exc-wild-2", // Excluded by *-exc-wild-* - } + // 1. Define namespaces for different filtering lifecycle scenarios + nsIncBoth := w.CaseBaseName + "-inc-both" // Included in both backup and restore + nsExact := w.CaseBaseName + "-exact" // Included exactly without wildcards + nsIncExc := w.CaseBaseName + "-inc-exc" // Included in backup, but excluded during restore + nsBakExc := w.CaseBaseName + "-test-bak" // Excluded during backup + + // Group namespaces for validation + w.restoredNS = []string{nsIncBoth, nsExact} + w.excludedByRestoreNS = []string{nsIncExc} + w.excludedByBackupNS = []string{nsBakExc} w.TestMsg = &TestMSG{ Desc: "Backup and restore with wildcard namespaces", - Text: "Should correctly backup and restore namespaces matching the include wildcard, and skip the exclude wildcard", + Text: "Should correctly filter namespaces using wildcards during both backup and restore stages", FailedMSG: "Failed to properly filter namespaces using wildcards", } - // Construct wildcard strings - incWildcard := fmt.Sprintf("%s-inc-wild-*", w.CaseBaseName) - excWildcard := fmt.Sprintf("%s-exc-wild-*", w.CaseBaseName) - exactInc := fmt.Sprintf("%s-exact-inc", w.CaseBaseName) + // 2. Setup Backup Args + backupIncWildcard1 := fmt.Sprintf("%s-inc-*", w.CaseBaseName) // Matches nsIncBoth, nsIncExc + backupIncWildcard2 := fmt.Sprintf("%s-test-*", w.CaseBaseName) // Matches nsBakExc + backupExcWildcard := fmt.Sprintf("%s-test-bak", w.CaseBaseName) // Excludes nsBakExc + nonExistentWildcard := "non-existent-ns-*" // Tests zero-match boundary condition - // In backup args, we intentionally include the `excWildcard` in the include-namespaces - // to verify that `exclude-namespaces` correctly overrides it. w.BackupArgs = []string{ "create", "--namespace", w.VeleroCfg.VeleroNamespace, "backup", w.BackupName, - "--include-namespaces", fmt.Sprintf("%s,%s,%s", incWildcard, exactInc, excWildcard), - "--exclude-namespaces", excWildcard, + // Use broad wildcards for inclusion to bypass Velero CLI's literal string collision validation + "--include-namespaces", fmt.Sprintf("%s,%s,%s,%s", backupIncWildcard1, backupIncWildcard2, nsExact, nonExistentWildcard), + "--exclude-namespaces", backupExcWildcard, "--default-volumes-to-fs-backup", "--wait", } + // 3. Setup Restore Args + restoreExcWildcard := fmt.Sprintf("%s-*-exc", w.CaseBaseName) // Excludes nsIncExc + w.RestoreArgs = []string{ "create", "--namespace", w.VeleroCfg.VeleroNamespace, "restore", w.RestoreName, - "--from-backup", w.BackupName, "--wait", + "--from-backup", w.BackupName, + "--include-namespaces", fmt.Sprintf("%s,%s,%s", backupIncWildcard1, nsExact, nonExistentWildcard), + "--exclude-namespaces", restoreExcWildcard, + "--wait", } return nil } func (w *WildcardNamespaces) CreateResources() error { - allNamespaces := append(w.namespacesToInclude, w.namespacesToExclude...) + allNamespaces := append(w.restoredNS, w.excludedByRestoreNS...) + allNamespaces = append(allNamespaces, w.excludedByBackupNS...) for _, ns := range allNamespaces { By(fmt.Sprintf("Creating namespace %s", ns), func() { @@ -104,8 +111,8 @@ func (w *WildcardNamespaces) CreateResources() error { } func (w *WildcardNamespaces) Verify() error { - // 1. Verify included namespaces and their resources were fully restored - for _, ns := range w.namespacesToInclude { + // 1. Verify namespaces that should be successfully restored + for _, ns := range w.restoredNS { By(fmt.Sprintf("Checking included namespace %s exists", ns), func() { _, err := GetNamespace(w.Ctx, w.Client, ns) Expect(err).To(Succeed(), fmt.Sprintf("Included namespace %s should exist after restore", ns)) @@ -115,11 +122,20 @@ func (w *WildcardNamespaces) Verify() error { }) } - // 2. Verify excluded namespaces were NOT restored - for _, ns := range w.namespacesToExclude { - By(fmt.Sprintf("Checking excluded namespace %s does NOT exist", ns), func() { + // 2. Verify namespaces excluded during Backup + for _, ns := range w.excludedByBackupNS { + By(fmt.Sprintf("Checking namespace %s excluded by backup does NOT exist", ns), func() { + _, err := GetNamespace(w.Ctx, w.Client, ns) + Expect(err).To(HaveOccurred(), fmt.Sprintf("Namespace %s excluded by backup should NOT exist after restore", ns)) + Expect(apierrors.IsNotFound(err)).To(BeTrue(), "Error should be NotFound") + }) + } + + // 3. Verify namespaces excluded during Restore + for _, ns := range w.excludedByRestoreNS { + By(fmt.Sprintf("Checking namespace %s excluded by restore does NOT exist", ns), func() { _, err := GetNamespace(w.Ctx, w.Client, ns) - Expect(err).To(HaveOccurred(), fmt.Sprintf("Excluded namespace %s should NOT exist after restore", ns)) + Expect(err).To(HaveOccurred(), fmt.Sprintf("Namespace %s excluded by restore should NOT exist after restore", ns)) Expect(apierrors.IsNotFound(err)).To(BeTrue(), "Error should be NotFound") }) } From a9b3cfa062f61970d2980785cd4244d20834fdb0 Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Tue, 10 Mar 2026 15:42:27 +0800 Subject: [PATCH 04/55] Disable Algolia docs search. Revert PR 6105. Signed-off-by: Xun Jiang --- site/algolia-crawler.json | 90 ---------------------------- site/layouts/docs/docs.html | 20 ------- site/layouts/partials/head-docs.html | 2 - 3 files changed, 112 deletions(-) delete mode 100644 site/algolia-crawler.json diff --git a/site/algolia-crawler.json b/site/algolia-crawler.json deleted file mode 100644 index 06dc083d71..0000000000 --- a/site/algolia-crawler.json +++ /dev/null @@ -1,90 +0,0 @@ -new Crawler({ - rateLimit: 8, - maxDepth: 10, - startUrls: ["https://velero.io/docs", "https://velero.io/"], - renderJavaScript: false, - sitemaps: ["https://velero.io/sitemap.xml"], - ignoreCanonicalTo: false, - discoveryPatterns: ["https://velero.io/**"], - schedule: "at 6:39 PM on Friday", - actions: [ - { - indexName: "velero_new", - pathsToMatch: ["https://velero.io/docs**/**"], - recordExtractor: ({ helpers }) => { - return helpers.docsearch({ - recordProps: { - lvl1: ["header h1", "article h1", "main h1", "h1", "head > title"], - content: ["article p, article li", "main p, main li", "p, li"], - lvl0: { - defaultValue: "Documentation", - }, - lvl2: ["article h2", "main h2", "h2"], - lvl3: ["article h3", "main h3", "h3"], - lvl4: ["article h4", "main h4", "h4"], - lvl5: ["article h5", "main h5", "h5"], - lvl6: ["article h6", "main h6", "h6"], - version: "#dropdownMenuButton", - }, - aggregateContent: true, - recordVersion: "v3", - }); - }, - }, - ], - initialIndexSettings: { - velero_new: { - attributesForFaceting: ["type", "lang", "version"], - attributesToRetrieve: [ - "hierarchy", - "content", - "anchor", - "url", - "url_without_anchor", - "type", - "version", - ], - attributesToHighlight: ["hierarchy", "content"], - attributesToSnippet: ["content:10"], - camelCaseAttributes: ["hierarchy", "content"], - searchableAttributes: [ - "unordered(hierarchy.lvl0)", - "unordered(hierarchy.lvl1)", - "unordered(hierarchy.lvl2)", - "unordered(hierarchy.lvl3)", - "unordered(hierarchy.lvl4)", - "unordered(hierarchy.lvl5)", - "unordered(hierarchy.lvl6)", - "content", - ], - distinct: true, - attributeForDistinct: "url", - customRanking: [ - "desc(weight.pageRank)", - "desc(weight.level)", - "asc(weight.position)", - ], - ranking: [ - "words", - "filters", - "typo", - "attribute", - "proximity", - "exact", - "custom", - ], - highlightPreTag: '', - highlightPostTag: "", - minWordSizefor1Typo: 3, - minWordSizefor2Typos: 7, - allowTyposOnNumericTokens: false, - minProximity: 1, - ignorePlurals: true, - advancedSyntax: true, - attributeCriteriaComputedByMinProximity: true, - removeWordsIfNoResults: "allOptional", - }, - }, - appId: "9ASKQJ1HR3", - apiKey: "6392a5916af73b73df2406d3aef5ca45", -}); \ No newline at end of file diff --git a/site/layouts/docs/docs.html b/site/layouts/docs/docs.html index 6d2a3f57f0..11e6cf9e9b 100644 --- a/site/layouts/docs/docs.html +++ b/site/layouts/docs/docs.html @@ -27,16 +27,6 @@

Documentation

{{ .Render "versions" }}
-
- -
{{ .Render "nav" }}
@@ -58,16 +48,6 @@

Documentation

{{ .Render "footer" }}
- - diff --git a/site/layouts/partials/head-docs.html b/site/layouts/partials/head-docs.html index 5ebae8c24c..c92837b2f7 100644 --- a/site/layouts/partials/head-docs.html +++ b/site/layouts/partials/head-docs.html @@ -8,6 +8,4 @@ {{ $styles := resources.Get "styles.scss" | toCSS $options | resources.Fingerprint }} {{/* TODO {% seo %}*/}} - - From a31f4abcb392bdf20d61e2d75602f01b522b8743 Mon Sep 17 00:00:00 2001 From: Shubham Pampattiwar Date: Tue, 10 Mar 2026 10:40:09 -0700 Subject: [PATCH 05/55] Fix DBR stuck when CSI snapshot no longer exists in cloud provider (#9581) * Fix DBR stuck when CSI snapshot no longer exists in cloud provider During backup deletion, VolumeSnapshotContentDeleteItemAction creates a new VSC with the snapshot handle from the backup and polls for readiness. If the underlying snapshot no longer exists (e.g., deleted externally), the CSI driver reports Status.Error but checkVSCReadiness() only checks ReadyToUse, causing it to poll for the full 10-minute timeout instead of failing fast. Additionally, the newly created VSC is never cleaned up on failure, leaving orphaned resources in the cluster. This commit: - Adds Status.Error detection in checkVSCReadiness() to fail immediately on permanent CSI driver errors (e.g., InvalidSnapshot.NotFound) - Cleans up the dangling VSC when readiness polling fails Fixes #9579 Signed-off-by: Shubham Pampattiwar * Add changelog for PR #9581 Signed-off-by: Shubham Pampattiwar * Fix typo in pod_volume_test.go: colume -> volume Signed-off-by: Shubham Pampattiwar --------- Signed-off-by: Shubham Pampattiwar --- .../unreleased/9581-shubham-pampattiwar | 1 + .../csi/volumesnapshotcontent_action.go | 11 ++++++ .../csi/volumesnapshotcontent_action_test.go | 39 +++++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 changelogs/unreleased/9581-shubham-pampattiwar diff --git a/changelogs/unreleased/9581-shubham-pampattiwar b/changelogs/unreleased/9581-shubham-pampattiwar new file mode 100644 index 0000000000..f369a8af55 --- /dev/null +++ b/changelogs/unreleased/9581-shubham-pampattiwar @@ -0,0 +1 @@ +Fix DBR stuck when CSI snapshot no longer exists in cloud provider diff --git a/internal/delete/actions/csi/volumesnapshotcontent_action.go b/internal/delete/actions/csi/volumesnapshotcontent_action.go index d12c7c43a1..7a6724df1e 100644 --- a/internal/delete/actions/csi/volumesnapshotcontent_action.go +++ b/internal/delete/actions/csi/volumesnapshotcontent_action.go @@ -137,6 +137,10 @@ func (p *volumeSnapshotContentDeleteItemAction) Execute( return checkVSCReadiness(ctx, &snapCont, p.crClient) }, ); err != nil { + // Clean up the VSC we created since it can't become ready + if deleteErr := p.crClient.Delete(context.TODO(), &snapCont); deleteErr != nil && !apierrors.IsNotFound(deleteErr) { + p.log.WithError(deleteErr).Errorf("Failed to clean up VolumeSnapshotContent %s", snapCont.Name) + } return errors.Wrapf(err, "fail to wait VolumeSnapshotContent %s becomes ready.", snapCont.Name) } @@ -167,6 +171,13 @@ var checkVSCReadiness = func( return true, nil } + // Fail fast on permanent CSI driver errors (e.g., InvalidSnapshot.NotFound) + if tmpVSC.Status != nil && tmpVSC.Status.Error != nil && tmpVSC.Status.Error.Message != nil { + return false, errors.Errorf( + "VolumeSnapshotContent %s has error: %s", vsc.Name, *tmpVSC.Status.Error.Message, + ) + } + return false, nil } diff --git a/internal/delete/actions/csi/volumesnapshotcontent_action_test.go b/internal/delete/actions/csi/volumesnapshotcontent_action_test.go index 24baccdb26..7dbd6d7ff7 100644 --- a/internal/delete/actions/csi/volumesnapshotcontent_action_test.go +++ b/internal/delete/actions/csi/volumesnapshotcontent_action_test.go @@ -94,6 +94,19 @@ func TestVSCExecute(t *testing.T) { return false, errors.Errorf("test error case") }, }, + { + name: "Error case with CSI error, dangling VSC should be cleaned up", + vsc: builder.ForVolumeSnapshotContent("bar").ObjectMeta(builder.WithLabelsMap(map[string]string{velerov1api.BackupNameLabel: "backup"})).Status(&snapshotv1api.VolumeSnapshotContentStatus{SnapshotHandle: &snapshotHandleStr}).Result(), + backup: builder.ForBackup("velero", "backup").ObjectMeta(builder.WithAnnotationsMap(map[string]string{velerov1api.ResourceTimeoutAnnotation: "5s"})).Result(), + expectErr: true, + function: func( + ctx context.Context, + vsc *snapshotv1api.VolumeSnapshotContent, + client crclient.Client, + ) (bool, error) { + return false, errors.Errorf("VolumeSnapshotContent %s has error: InvalidSnapshot.NotFound", vsc.Name) + }, + }, } for _, test := range tests { @@ -190,6 +203,24 @@ func TestCheckVSCReadiness(t *testing.T) { expectErr: false, ready: false, }, + { + name: "VSC has error from CSI driver", + vsc: &snapshotv1api.VolumeSnapshotContent{ + ObjectMeta: metav1.ObjectMeta{ + Name: "vsc-1", + Namespace: "velero", + }, + Status: &snapshotv1api.VolumeSnapshotContentStatus{ + ReadyToUse: boolPtr(false), + Error: &snapshotv1api.VolumeSnapshotError{ + Message: stringPtr("InvalidSnapshot.NotFound: The snapshot 'snap-0abc123' does not exist."), + }, + }, + }, + createVSC: true, + expectErr: true, + ready: false, + }, } for _, test := range tests { @@ -207,3 +238,11 @@ func TestCheckVSCReadiness(t *testing.T) { }) } } + +func boolPtr(b bool) *bool { + return &b +} + +func stringPtr(s string) *string { + return &s +} From afe7df17d4af4a067eb77ca2af9d0ffbceac9b81 Mon Sep 17 00:00:00 2001 From: Shubham Pampattiwar Date: Tue, 10 Mar 2026 13:12:47 -0700 Subject: [PATCH 06/55] Add itemOperationTimeout to Schedule API type docs (#9599) The itemOperationTimeout field was missing from the Schedule API type documentation even though it is supported in the Schedule CRD template. This led users to believe the field was not available per-schedule. Fixes #9598 Signed-off-by: Shubham Pampattiwar --- site/content/docs/main/api-types/schedule.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/site/content/docs/main/api-types/schedule.md b/site/content/docs/main/api-types/schedule.md index c89fe60d7b..ef3df4324c 100644 --- a/site/content/docs/main/api-types/schedule.md +++ b/site/content/docs/main/api-types/schedule.md @@ -63,6 +63,10 @@ spec: # CSI VolumeSnapshot status turns to ReadyToUse during creation, before # returning error as timeout. The default value is 10 minute. csiSnapshotTimeout: 10m + # ItemOperationTimeout specifies the time used to wait for + # asynchronous BackupItemAction operations + # The default value is 4 hour. + itemOperationTimeout: 4h # resourcePolicy specifies the referenced resource policies that backup should follow # optional resourcePolicy: From 496cdfc869a77e293077d1ee9f4bc6378bf7bf60 Mon Sep 17 00:00:00 2001 From: Daniel Jiang Date: Wed, 23 Aug 2023 15:13:34 +0800 Subject: [PATCH 07/55] skip subresource in resource discovery (#6688) Signed-off-by: lou Co-authored-by: lou --- changelogs/unreleased/6688-27149chen | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelogs/unreleased/6688-27149chen diff --git a/changelogs/unreleased/6688-27149chen b/changelogs/unreleased/6688-27149chen new file mode 100644 index 0000000000..229d6e075a --- /dev/null +++ b/changelogs/unreleased/6688-27149chen @@ -0,0 +1 @@ +Fixes #6636, skip subresource in resource discovery \ No newline at end of file From bffa59cbb07e1bcc14817dca3de05e084b1474d5 Mon Sep 17 00:00:00 2001 From: Lyndon-Li Date: Tue, 5 Sep 2023 10:38:39 +0800 Subject: [PATCH 08/55] fix issue 6753 Signed-off-by: Lyndon-Li --- changelogs/unreleased/6758-Lyndon-Li | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelogs/unreleased/6758-Lyndon-Li diff --git a/changelogs/unreleased/6758-Lyndon-Li b/changelogs/unreleased/6758-Lyndon-Li new file mode 100644 index 0000000000..1e095ee673 --- /dev/null +++ b/changelogs/unreleased/6758-Lyndon-Li @@ -0,0 +1 @@ +Fix issue #6753, remove the check for read-only BSL in restore async operation controller since Velero cannot fully support read-only mode BSL in restore at present \ No newline at end of file From f7e4857c18a3d189000fde66a01872e1435085ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wenkai=20Yin=28=E5=B0=B9=E6=96=87=E5=BC=80=29?= Date: Wed, 6 Sep 2023 08:38:45 +0800 Subject: [PATCH 09/55] Update restore controller logic for restore deletion (#6761) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Skip deleting the restore files from storage if the backup/BSL is not found 2. Allow deleting the restore files from storage even though the BSL is readonly Signed-off-by: Wenkai Yin(尹文开) --- changelogs/unreleased/6761-ywk253100 | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelogs/unreleased/6761-ywk253100 diff --git a/changelogs/unreleased/6761-ywk253100 b/changelogs/unreleased/6761-ywk253100 new file mode 100644 index 0000000000..6e55ffcd49 --- /dev/null +++ b/changelogs/unreleased/6761-ywk253100 @@ -0,0 +1 @@ +Update restore controller logic for restore deletion \ No newline at end of file From 0d404d3d51555df62698cafc90da4950e9d6ca3a Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Tue, 5 Sep 2023 10:50:20 +0800 Subject: [PATCH 10/55] Fix #6752: add namespace exclude check. Add PSA audit and warn labels. Signed-off-by: Xun Jiang --- changelogs/unreleased/6762-blackpiglet | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelogs/unreleased/6762-blackpiglet diff --git a/changelogs/unreleased/6762-blackpiglet b/changelogs/unreleased/6762-blackpiglet new file mode 100644 index 0000000000..db9b5a118c --- /dev/null +++ b/changelogs/unreleased/6762-blackpiglet @@ -0,0 +1 @@ +Fix #6752: add namespace exclude check. \ No newline at end of file From 945eda66dc9104df65f9503faa85eff2185d8837 Mon Sep 17 00:00:00 2001 From: Lyndon-Li Date: Fri, 8 Sep 2023 17:49:42 +0800 Subject: [PATCH 11/55] add csi snapshot data movement doc Signed-off-by: Lyndon-Li --- changelogs/unreleased/6793-Lyndon-Li | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelogs/unreleased/6793-Lyndon-Li diff --git a/changelogs/unreleased/6793-Lyndon-Li b/changelogs/unreleased/6793-Lyndon-Li new file mode 100644 index 0000000000..b816b976bc --- /dev/null +++ b/changelogs/unreleased/6793-Lyndon-Li @@ -0,0 +1 @@ +Add CSI snapshot data movement doc \ No newline at end of file From 78c180d6ba09e70a609d4a158fbed02969529dee Mon Sep 17 00:00:00 2001 From: allenxu404 Date: Tue, 19 Sep 2023 17:21:35 +0800 Subject: [PATCH 12/55] Modify changelogs for v1.12 Signed-off-by: allenxu404 --- changelogs/CHANGELOG-1.12.md | 8 ++++++++ changelogs/unreleased/6688-27149chen | 1 - changelogs/unreleased/6758-Lyndon-Li | 1 - changelogs/unreleased/6761-ywk253100 | 1 - changelogs/unreleased/6762-blackpiglet | 1 - changelogs/unreleased/6793-Lyndon-Li | 1 - 6 files changed, 8 insertions(+), 5 deletions(-) delete mode 100644 changelogs/unreleased/6688-27149chen delete mode 100644 changelogs/unreleased/6758-Lyndon-Li delete mode 100644 changelogs/unreleased/6761-ywk253100 delete mode 100644 changelogs/unreleased/6762-blackpiglet delete mode 100644 changelogs/unreleased/6793-Lyndon-Li diff --git a/changelogs/CHANGELOG-1.12.md b/changelogs/CHANGELOG-1.12.md index 4b980641ae..4472cc77d2 100644 --- a/changelogs/CHANGELOG-1.12.md +++ b/changelogs/CHANGELOG-1.12.md @@ -51,6 +51,7 @@ To fix CVEs and keep pace with Golang, Velero made changes as follows: * Prior to v1.12, the parameter `uploader-type` for Velero installation had a default value of "restic". However, starting from this version, the default value has been changed to "kopia". This means that Velero will now use Kopia as the default path for file system backup. * The ways of setting CSI snapshot time have changed in v1.12. First, the sync waiting time for creating a snapshot handle in the CSI plugin is changed from the fixed 10 minutes into backup.Spec.CSISnapshotTimeout. The second, the async waiting time for VolumeSnapshot and VolumeSnapshotContent's status turning into `ReadyToUse` in operation uses the operation's timeout. The default value is 4 hours. * As from [Velero helm chart v4.0.0](https://github.com/vmware-tanzu/helm-charts/releases/tag/velero-4.0.0), it supports multiple BSL and VSL, and the BSL and VSL have changed from the map into a slice, and[ this breaking change](https://github.com/vmware-tanzu/helm-charts/pull/413) is not backward compatible. So it would be best to change the BSL and VSL configuration into slices before the Upgrade. +* Prior to v1.12, deleting the Velero namespace would easily remove all the resources within it. However, with the introduction of finalizers attached to the Velero CR including `restore`, `dataupload`, and `datadownload` in this version, directly deleting Velero namespace may get stuck indefinitely because the pods responsible for handling the finalizers might be deleted before the resources attached to the finalizers. To avoid this issue, please use the command `velero uninstall` to delete all the Velero resources or ensure that you handle the finalizer appropriately before deleting the Velero namespace. ### Limitations/Known issues @@ -132,3 +133,10 @@ prior PVC restores with CSI (#6111, @eemcmullan) * Make GetPluginConfig accessible from other packages. (#6151, @tkaovila) * Ignore not found error during patching managedFields (#6136, @ywk253100) * Fix the goreleaser issues and add a new goreleaser action (#6109, @blackpiglet) +* Add CSI snapshot data movement doc (#6793, @Lyndon-Li) +* Use old(origin) namespace in resource modifier conditions in case namespace may change during restore (#6724, @27149chen) +* Fix #6752: add namespace exclude check. (#6762, @blackpiglet) +* Update restore controller logic for restore deletion (#6761, @ywk253100) +* Fix issue #6753, remove the check for read-only BSL in restore async operation controller since Velero cannot fully support read-only mode BSL in restore at present (#6758, @Lyndon-Li) +* Fixes #6636, skip subresource in resource discovery (#6688, @27149chen) +* This pr made some improvements in Resource Modifiers:1. add label selector 2. change the field name from groupKind to groupResource (#6704, @27149chen) diff --git a/changelogs/unreleased/6688-27149chen b/changelogs/unreleased/6688-27149chen deleted file mode 100644 index 229d6e075a..0000000000 --- a/changelogs/unreleased/6688-27149chen +++ /dev/null @@ -1 +0,0 @@ -Fixes #6636, skip subresource in resource discovery \ No newline at end of file diff --git a/changelogs/unreleased/6758-Lyndon-Li b/changelogs/unreleased/6758-Lyndon-Li deleted file mode 100644 index 1e095ee673..0000000000 --- a/changelogs/unreleased/6758-Lyndon-Li +++ /dev/null @@ -1 +0,0 @@ -Fix issue #6753, remove the check for read-only BSL in restore async operation controller since Velero cannot fully support read-only mode BSL in restore at present \ No newline at end of file diff --git a/changelogs/unreleased/6761-ywk253100 b/changelogs/unreleased/6761-ywk253100 deleted file mode 100644 index 6e55ffcd49..0000000000 --- a/changelogs/unreleased/6761-ywk253100 +++ /dev/null @@ -1 +0,0 @@ -Update restore controller logic for restore deletion \ No newline at end of file diff --git a/changelogs/unreleased/6762-blackpiglet b/changelogs/unreleased/6762-blackpiglet deleted file mode 100644 index db9b5a118c..0000000000 --- a/changelogs/unreleased/6762-blackpiglet +++ /dev/null @@ -1 +0,0 @@ -Fix #6752: add namespace exclude check. \ No newline at end of file diff --git a/changelogs/unreleased/6793-Lyndon-Li b/changelogs/unreleased/6793-Lyndon-Li deleted file mode 100644 index b816b976bc..0000000000 --- a/changelogs/unreleased/6793-Lyndon-Li +++ /dev/null @@ -1 +0,0 @@ -Add CSI snapshot data movement doc \ No newline at end of file From 4c0c1dc8be560654f43ac4da16c2140a7f2d7679 Mon Sep 17 00:00:00 2001 From: Lyndon-Li Date: Wed, 13 Sep 2023 16:11:35 +0800 Subject: [PATCH 13/55] issue 6786:always delete VSC regardless of the deletion policy Signed-off-by: Lyndon-Li --- changelogs/unreleased/6873-Lyndon-Li | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelogs/unreleased/6873-Lyndon-Li diff --git a/changelogs/unreleased/6873-Lyndon-Li b/changelogs/unreleased/6873-Lyndon-Li new file mode 100644 index 0000000000..1aac387e08 --- /dev/null +++ b/changelogs/unreleased/6873-Lyndon-Li @@ -0,0 +1 @@ +Fix issue #6786, always delete VSC regardless of the deletion policy \ No newline at end of file From 8328422bd0bffa1f30753fac8a75c0c57276aa3e Mon Sep 17 00:00:00 2001 From: Lyndon-Li Date: Tue, 26 Sep 2023 16:21:46 +0800 Subject: [PATCH 14/55] issue: move plugin depdending podvolume functions to util pkg Signed-off-by: Lyndon-Li --- changelogs/unreleased/6877-Lyndon-Li | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelogs/unreleased/6877-Lyndon-Li diff --git a/changelogs/unreleased/6877-Lyndon-Li b/changelogs/unreleased/6877-Lyndon-Li new file mode 100644 index 0000000000..8d11bca2c9 --- /dev/null +++ b/changelogs/unreleased/6877-Lyndon-Li @@ -0,0 +1 @@ +Fix issue #6859, move plugin depending podvolume functions to util pkg, so as to remove the dependencies to unnecessary repository packages like kopia, azure, etc. \ No newline at end of file From cf67628fba1b97ecafe59421745ce65635024da5 Mon Sep 17 00:00:00 2001 From: Lyndon-Li Date: Thu, 28 Sep 2023 10:28:49 +0800 Subject: [PATCH 15/55] issue 6880: set ParallelUploadAboveSize as MaxInt64 Signed-off-by: Lyndon-Li --- changelogs/unreleased/6886-Lyndon-Li | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelogs/unreleased/6886-Lyndon-Li diff --git a/changelogs/unreleased/6886-Lyndon-Li b/changelogs/unreleased/6886-Lyndon-Li new file mode 100644 index 0000000000..f879897c0e --- /dev/null +++ b/changelogs/unreleased/6886-Lyndon-Li @@ -0,0 +1 @@ +Set ParallelUploadAboveSize as MaxInt64 and flush repo after setting up policy so that policy is retrieved correctly by TreeForSource \ No newline at end of file From d9774147e6dcb4daec8b23eb3c4e1a90b05300b6 Mon Sep 17 00:00:00 2001 From: Tiger Kaovilai Date: Mon, 28 Aug 2023 10:45:55 -0400 Subject: [PATCH 16/55] changelog Signed-off-by: Tiger Kaovilai --- changelogs/unreleased/6713-kaovilai | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelogs/unreleased/6713-kaovilai diff --git a/changelogs/unreleased/6713-kaovilai b/changelogs/unreleased/6713-kaovilai new file mode 100644 index 0000000000..e597187560 --- /dev/null +++ b/changelogs/unreleased/6713-kaovilai @@ -0,0 +1 @@ +Kubernetes 1.27 new job label batch.kubernetes.io/controller-uid are deleted during restore per https://github.com/kubernetes/kubernetes/pull/114930 \ No newline at end of file From 91eb583b15de332c1d400e6e560d4390eb6c602e Mon Sep 17 00:00:00 2001 From: David Zaninovic <74072514+dzaninovic@users.noreply.github.com> Date: Fri, 29 Sep 2023 15:28:35 -0400 Subject: [PATCH 17/55] Add support for block volumes (#6680) (#6897) (cherry picked from commit 8e01d1b9be31d30f88e90003af6c4ce15c64ee65) Signed-off-by: David Zaninovic --- changelogs/unreleased/6897-dzaninovic | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelogs/unreleased/6897-dzaninovic diff --git a/changelogs/unreleased/6897-dzaninovic b/changelogs/unreleased/6897-dzaninovic new file mode 100644 index 0000000000..b4d735d145 --- /dev/null +++ b/changelogs/unreleased/6897-dzaninovic @@ -0,0 +1 @@ +Add support for block volumes with Kopia \ No newline at end of file From 76f682d6e8d202a00dc8dbacb36ea66f1ef8df22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wenkai=20Yin=28=E5=B0=B9=E6=96=87=E5=BC=80=29?= Date: Wed, 27 Sep 2023 20:09:51 +0800 Subject: [PATCH 18/55] Replace the base image with paketobuildpacks image MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace the base image with paketobuildpacks image Fixes #6851 Signed-off-by: Wenkai Yin(尹文开) --- changelogs/unreleased/6934-ywk253100 | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelogs/unreleased/6934-ywk253100 diff --git a/changelogs/unreleased/6934-ywk253100 b/changelogs/unreleased/6934-ywk253100 new file mode 100644 index 0000000000..bc8d80b92e --- /dev/null +++ b/changelogs/unreleased/6934-ywk253100 @@ -0,0 +1 @@ +Replace the base image with paketobuildpacks image \ No newline at end of file From 6071d313d3f941eeb1f7f892245cc9fba0462597 Mon Sep 17 00:00:00 2001 From: Lyndon-Li Date: Tue, 10 Oct 2023 11:04:04 +0800 Subject: [PATCH 19/55] issue 6734: spread backup pod evenly Signed-off-by: Lyndon-Li --- changelogs/unreleased/6935-Lyndon-Li | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelogs/unreleased/6935-Lyndon-Li diff --git a/changelogs/unreleased/6935-Lyndon-Li b/changelogs/unreleased/6935-Lyndon-Li new file mode 100644 index 0000000000..b14c4f3cce --- /dev/null +++ b/changelogs/unreleased/6935-Lyndon-Li @@ -0,0 +1 @@ +Partially fix #6734, guide Kubernetes' scheduler to spread backup pods evenly across nodes as much as possible, so that data mover backup could achieve better parallelism \ No newline at end of file From 952a00e3d5a4934fb271c6fed479cf6542cd8e43 Mon Sep 17 00:00:00 2001 From: allenxu404 Date: Thu, 28 Sep 2023 14:27:20 +0800 Subject: [PATCH 20/55] Add doc links for new features to release note Signed-off-by: allenxu404 --- changelogs/CHANGELOG-1.12.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/changelogs/CHANGELOG-1.12.md b/changelogs/CHANGELOG-1.12.md index 4472cc77d2..a987cb405e 100644 --- a/changelogs/CHANGELOG-1.12.md +++ b/changelogs/CHANGELOG-1.12.md @@ -23,17 +23,17 @@ CSI Snapshot Data Movement is useful in below scenarios: * For on-premises users, the storage usually doesn't support durable snapshots, so it is impossible/less efficient/cost ineffective to keep volume snapshots by the storage This feature helps to move the snapshot data to a storage with lower cost and larger scale for long time preservation. * For public cloud users, this feature helps users to fulfill the multiple cloud strategy. It allows users to back up volume snapshots from one cloud provider and preserve or restore the data to another cloud provider. Then users will be free to flow their business data across cloud providers based on Velero backup and restore -CSI Snapshot Data Movement is built according to the Volume Snapshot Data Movement design ([Volume Snapshot Data Movement](https://github.com/vmware-tanzu/velero/blob/main/design/Implemented/unified-repo-and-kopia-integration/unified-repo-and-kopia-integration.md)). More details can be found in the design. +CSI Snapshot Data Movement is built according to the Volume Snapshot Data Movement design ([Volume Snapshot Data Movement design](https://github.com/vmware-tanzu/velero/blob/main/design/volume-snapshot-data-movement/volume-snapshot-data-movement.md)). Additionally, guidance on how to use the feature can be found in the Volume Snapshot Data Movement doc([Volume Snapshot Data Movement doc](https://velero.io/docs/v1.12/csi-snapshot-data-movement)). #### Resource Modifiers In many use cases, customers often need to substitute specific values in Kubernetes resources during the restoration process like changing the namespace, changing the storage class, etc. -To address this need, Resource Modifiers (also known as JSON Substitutions) offer a generic solution in the restore workflow. It allows the user to define filters for specific resources and then specify a JSON patch (operator, path, value) to apply to the resource. This feature simplifies the process of making substitutions without requiring the implementation of a new RestoreItemAction plugin. More details can be found in Volume Snapshot Resource Modifiers design ([Resource Modifiers](https://github.com/vmware-tanzu/velero/blob/main/design/Implemented/json-substitution-action-design.md)). +To address this need, Resource Modifiers (also known as JSON Substitutions) offer a generic solution in the restore workflow. It allows the user to define filters for specific resources and then specify a JSON patch (operator, path, value) to apply to the resource. This feature simplifies the process of making substitutions without requiring the implementation of a new RestoreItemAction plugin. More design details can be found in Resource Modifiers design ([Resource Modifiers design](https://github.com/vmware-tanzu/velero/blob/main/design/Implemented/json-substitution-action-design.md)). For instructions on how to use the feature, please refer to Resource Modifiers doc([Resource Modifiers doc](https://velero.io/docs/v1.12/restore-resource-modifiers)). #### Multiple VolumeSnapshotClasses Prior to version 1.12, the Velero CSI plugin would choose the VolumeSnapshotClass in the cluster based on matching driver names and the presence of the "velero.io/csi-volumesnapshot-class" label. However, this approach proved inadequate for many user scenarios. -With the introduction of version 1.12, Velero now offers support for multiple VolumeSnapshotClasses in the CSI Plugin, enabling users to select a specific class for a particular backup. More details can be found in Multiple VolumeSnapshotClasses design ([Multiple VolumeSnapshotClasses](https://github.com/vmware-tanzu/velero/blob/main/design/Implemented/multiple-csi-volumesnapshotclass-support.md)). +With the introduction of version 1.12, Velero now offers support for multiple VolumeSnapshotClasses in the CSI Plugin, enabling users to select a specific class for a particular backup. More design details can be found in Multiple VolumeSnapshotClasses design ([Multiple VolumeSnapshotClasses design](https://github.com/vmware-tanzu/velero/blob/main/design/Implemented/multiple-csi-volumesnapshotclass-support.md)). For instructions on how to use the feature, please refer to Multiple VolumeSnapshotClasses doc ([Multiple VolumeSnapshotClasses doc](https://velero.io/docs/v1.12/csi/#implementation-choices)). #### Restore Finalizer Before v1.12, the restore controller would only delete restore resources but wouldn’t delete restore data from the backup storage location when the command `velero restore delete` was executed. The only chance Velero deletes restores data from the backup storage location is when the associated backup is deleted. @@ -56,6 +56,7 @@ To fix CVEs and keep pace with Golang, Velero made changes as follows: ### Limitations/Known issues * The Azure plugin supports Azure AD Workload identity way, but it only works for Velero native snapshots. It cannot support filesystem backup and snapshot data mover scenarios. +* File System backup under Kopia path and CSI Snapshot Data Movement backup fail to back up files that are large the 2GiB due to issue https://github.com/vmware-tanzu/velero/issues/6668. ### All Changes From 2c59e0cc98347baa137a9b1396528f798e4b8bd5 Mon Sep 17 00:00:00 2001 From: Lyndon-Li Date: Mon, 28 Aug 2023 10:56:56 +0800 Subject: [PATCH 21/55] fix issue 6647 Signed-off-by: Lyndon-Li --- changelogs/unreleased/6940-Lyndon-Li | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelogs/unreleased/6940-Lyndon-Li diff --git a/changelogs/unreleased/6940-Lyndon-Li b/changelogs/unreleased/6940-Lyndon-Li new file mode 100644 index 0000000000..6f614cb681 --- /dev/null +++ b/changelogs/unreleased/6940-Lyndon-Li @@ -0,0 +1 @@ +Fix issue #6647, add the --default-snapshot-move-data parameter to Velero install, so that users don't need to specify --snapshot-move-data per backup when they want to move snapshot data for all backups \ No newline at end of file From bb9702114f2d72b69ec2fefe430e564f4d5920e1 Mon Sep 17 00:00:00 2001 From: Scott Seago Date: Mon, 21 Aug 2023 11:36:46 -0400 Subject: [PATCH 22/55] Perf improvements for existing resource restore Use informer cache with dynamic client for Get calls on restore When enabled, also make the Get call before create. Add server and install parameter to allow disabling this feature, but enable by default Signed-off-by: Scott Seago --- changelogs/unreleased/6948-sseago | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelogs/unreleased/6948-sseago diff --git a/changelogs/unreleased/6948-sseago b/changelogs/unreleased/6948-sseago new file mode 100644 index 0000000000..c971d27dcc --- /dev/null +++ b/changelogs/unreleased/6948-sseago @@ -0,0 +1 @@ +Perf improvements for existing resource restore From 50c64394f76e6fc42d358a75d5c2c02c965bff3a Mon Sep 17 00:00:00 2001 From: Scott Seago Date: Wed, 13 Sep 2023 13:24:09 -0400 Subject: [PATCH 23/55] issue #6807: Retry failed create when using generateName When creating resources with generateName, apimachinery does not guarantee uniqueness when it appends the random suffix to the generateName stub, so if it fails with already exists error, we need to retry. Signed-off-by: Scott Seago --- changelogs/unreleased/6943-sseago | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelogs/unreleased/6943-sseago diff --git a/changelogs/unreleased/6943-sseago b/changelogs/unreleased/6943-sseago new file mode 100644 index 0000000000..2055df15a2 --- /dev/null +++ b/changelogs/unreleased/6943-sseago @@ -0,0 +1 @@ +Retry failed create when using generateName From 48cd50b2ce756228b73e3d6b0df66bc5e01c895a Mon Sep 17 00:00:00 2001 From: Sebastian Glab Date: Thu, 12 Oct 2023 15:40:29 +0200 Subject: [PATCH 24/55] Import auth provider plugins Signed-off-by: Sebastian Glab --- changelogs/unreleased/6970-0x113 | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelogs/unreleased/6970-0x113 diff --git a/changelogs/unreleased/6970-0x113 b/changelogs/unreleased/6970-0x113 new file mode 100644 index 0000000000..1cf76eb51a --- /dev/null +++ b/changelogs/unreleased/6970-0x113 @@ -0,0 +1 @@ +Import auth provider plugins From dab1ddda9440702f54ce292c8e99193e472b0be8 Mon Sep 17 00:00:00 2001 From: allenxu404 Date: Fri, 20 Oct 2023 11:15:25 +0800 Subject: [PATCH 25/55] Add v1.12.1 changelog Signed-off-by: allenxu404 --- changelogs/CHANGELOG-1.12.md | 29 +++++++++++++++++++++++++++ changelogs/unreleased/6713-kaovilai | 1 - changelogs/unreleased/6873-Lyndon-Li | 1 - changelogs/unreleased/6877-Lyndon-Li | 1 - changelogs/unreleased/6886-Lyndon-Li | 1 - changelogs/unreleased/6897-dzaninovic | 1 - changelogs/unreleased/6934-ywk253100 | 1 - changelogs/unreleased/6935-Lyndon-Li | 1 - changelogs/unreleased/6940-Lyndon-Li | 1 - changelogs/unreleased/6943-sseago | 1 - changelogs/unreleased/6948-sseago | 1 - changelogs/unreleased/6970-0x113 | 1 - 12 files changed, 29 insertions(+), 11 deletions(-) delete mode 100644 changelogs/unreleased/6713-kaovilai delete mode 100644 changelogs/unreleased/6873-Lyndon-Li delete mode 100644 changelogs/unreleased/6877-Lyndon-Li delete mode 100644 changelogs/unreleased/6886-Lyndon-Li delete mode 100644 changelogs/unreleased/6897-dzaninovic delete mode 100644 changelogs/unreleased/6934-ywk253100 delete mode 100644 changelogs/unreleased/6935-Lyndon-Li delete mode 100644 changelogs/unreleased/6940-Lyndon-Li delete mode 100644 changelogs/unreleased/6943-sseago delete mode 100644 changelogs/unreleased/6948-sseago delete mode 100644 changelogs/unreleased/6970-0x113 diff --git a/changelogs/CHANGELOG-1.12.md b/changelogs/CHANGELOG-1.12.md index a987cb405e..16b5cdaef6 100644 --- a/changelogs/CHANGELOG-1.12.md +++ b/changelogs/CHANGELOG-1.12.md @@ -1,3 +1,32 @@ +## v1.12.1 +### 2023-10-20 + +### Download +https://github.com/vmware-tanzu/velero/releases/tag/v1.12.1 + +### Container Image +`velero/velero:v1.12.1` + +### Documentation +https://velero.io/docs/v1.12/ + +### Upgrading +https://velero.io/docs/v1.12/upgrade-to-1.12/ + +### All changes +* Import auth provider plugins (#6970, @0x113) +* Perf improvements for existing resource restore (#6948, @sseago) +* Retry failed create when using generateName (#6943, @sseago) +* Fix issue #6647, add the --default-snapshot-move-data parameter to Velero install, so that users don't need to specify --snapshot-move-data per backup when they want to move snapshot data for all backups (#6940, @Lyndon-Li) +* Partially fix #6734, guide Kubernetes' scheduler to spread backup pods evenly across nodes as much as possible, so that data mover backup could achieve better parallelism (#6935, @Lyndon-Li) +* Replace the base image with paketobuildpacks image (#6934, @ywk253100) +* Add support for block volumes with Kopia (#6897, @dzaninovic) +* Set ParallelUploadAboveSize as MaxInt64 and flush repo after setting up policy so that policy is retrieved correctly by TreeForSource (#6886, @Lyndon-Li) +* Kubernetes 1.27 new job label batch.kubernetes.io/controller-uid are deleted during restore per https://github.com/kubernetes/kubernetes/pull/114930 (#6713, @kaovilai) +* Add `orLabelSelectors` for backup, restore commands (#6881, @nilesh-akhade) +* Fix issue #6859, move plugin depending podvolume functions to util pkg, so as to remove the dependencies to unnecessary repository packages like kopia, azure, etc. (#6877, @Lyndon-Li) +* Fix issue #6786, always delete VSC regardless of the deletion policy (#6873, @Lyndon-Li) + ## v1.12 ### 2023-08-18 diff --git a/changelogs/unreleased/6713-kaovilai b/changelogs/unreleased/6713-kaovilai deleted file mode 100644 index e597187560..0000000000 --- a/changelogs/unreleased/6713-kaovilai +++ /dev/null @@ -1 +0,0 @@ -Kubernetes 1.27 new job label batch.kubernetes.io/controller-uid are deleted during restore per https://github.com/kubernetes/kubernetes/pull/114930 \ No newline at end of file diff --git a/changelogs/unreleased/6873-Lyndon-Li b/changelogs/unreleased/6873-Lyndon-Li deleted file mode 100644 index 1aac387e08..0000000000 --- a/changelogs/unreleased/6873-Lyndon-Li +++ /dev/null @@ -1 +0,0 @@ -Fix issue #6786, always delete VSC regardless of the deletion policy \ No newline at end of file diff --git a/changelogs/unreleased/6877-Lyndon-Li b/changelogs/unreleased/6877-Lyndon-Li deleted file mode 100644 index 8d11bca2c9..0000000000 --- a/changelogs/unreleased/6877-Lyndon-Li +++ /dev/null @@ -1 +0,0 @@ -Fix issue #6859, move plugin depending podvolume functions to util pkg, so as to remove the dependencies to unnecessary repository packages like kopia, azure, etc. \ No newline at end of file diff --git a/changelogs/unreleased/6886-Lyndon-Li b/changelogs/unreleased/6886-Lyndon-Li deleted file mode 100644 index f879897c0e..0000000000 --- a/changelogs/unreleased/6886-Lyndon-Li +++ /dev/null @@ -1 +0,0 @@ -Set ParallelUploadAboveSize as MaxInt64 and flush repo after setting up policy so that policy is retrieved correctly by TreeForSource \ No newline at end of file diff --git a/changelogs/unreleased/6897-dzaninovic b/changelogs/unreleased/6897-dzaninovic deleted file mode 100644 index b4d735d145..0000000000 --- a/changelogs/unreleased/6897-dzaninovic +++ /dev/null @@ -1 +0,0 @@ -Add support for block volumes with Kopia \ No newline at end of file diff --git a/changelogs/unreleased/6934-ywk253100 b/changelogs/unreleased/6934-ywk253100 deleted file mode 100644 index bc8d80b92e..0000000000 --- a/changelogs/unreleased/6934-ywk253100 +++ /dev/null @@ -1 +0,0 @@ -Replace the base image with paketobuildpacks image \ No newline at end of file diff --git a/changelogs/unreleased/6935-Lyndon-Li b/changelogs/unreleased/6935-Lyndon-Li deleted file mode 100644 index b14c4f3cce..0000000000 --- a/changelogs/unreleased/6935-Lyndon-Li +++ /dev/null @@ -1 +0,0 @@ -Partially fix #6734, guide Kubernetes' scheduler to spread backup pods evenly across nodes as much as possible, so that data mover backup could achieve better parallelism \ No newline at end of file diff --git a/changelogs/unreleased/6940-Lyndon-Li b/changelogs/unreleased/6940-Lyndon-Li deleted file mode 100644 index 6f614cb681..0000000000 --- a/changelogs/unreleased/6940-Lyndon-Li +++ /dev/null @@ -1 +0,0 @@ -Fix issue #6647, add the --default-snapshot-move-data parameter to Velero install, so that users don't need to specify --snapshot-move-data per backup when they want to move snapshot data for all backups \ No newline at end of file diff --git a/changelogs/unreleased/6943-sseago b/changelogs/unreleased/6943-sseago deleted file mode 100644 index 2055df15a2..0000000000 --- a/changelogs/unreleased/6943-sseago +++ /dev/null @@ -1 +0,0 @@ -Retry failed create when using generateName diff --git a/changelogs/unreleased/6948-sseago b/changelogs/unreleased/6948-sseago deleted file mode 100644 index c971d27dcc..0000000000 --- a/changelogs/unreleased/6948-sseago +++ /dev/null @@ -1 +0,0 @@ -Perf improvements for existing resource restore diff --git a/changelogs/unreleased/6970-0x113 b/changelogs/unreleased/6970-0x113 deleted file mode 100644 index 1cf76eb51a..0000000000 --- a/changelogs/unreleased/6970-0x113 +++ /dev/null @@ -1 +0,0 @@ -Import auth provider plugins From 1ce62e7c48e02e25f7aa84b055cf32fc363953f7 Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Fri, 20 Oct 2023 15:43:42 +0800 Subject: [PATCH 26/55] Make Windows build skip BlockMode code. PVC block mode backup and restore introduced some OS specific system calls. Those calls are not available for Windows, so add both non Windows version and Windows version code, and return error for block mode on the Windows platform. Signed-off-by: Xun Jiang --- changelogs/unreleased/6986-blackpiglet | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelogs/unreleased/6986-blackpiglet diff --git a/changelogs/unreleased/6986-blackpiglet b/changelogs/unreleased/6986-blackpiglet new file mode 100644 index 0000000000..4eae63eaee --- /dev/null +++ b/changelogs/unreleased/6986-blackpiglet @@ -0,0 +1 @@ +Add both non-Windows version and Windows version code for PVC block mode logic. \ No newline at end of file From fd51c88dc1608eb7ff4f2d33daaec70fb96e53c0 Mon Sep 17 00:00:00 2001 From: Lyndon-Li Date: Fri, 20 Oct 2023 18:37:07 +0800 Subject: [PATCH 27/55] udmrepo use region specified in BSL when s3URL is empty Signed-off-by: Lyndon-Li --- changelogs/unreleased/6991-Lyndon-Li | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelogs/unreleased/6991-Lyndon-Li diff --git a/changelogs/unreleased/6991-Lyndon-Li b/changelogs/unreleased/6991-Lyndon-Li new file mode 100644 index 0000000000..6f79e1c9d2 --- /dev/null +++ b/changelogs/unreleased/6991-Lyndon-Li @@ -0,0 +1 @@ +Fix #6988, always get region from BSL if it is not empty \ No newline at end of file From caff6efef0c457c529f9d58c77b2f26bb4ce2ee9 Mon Sep 17 00:00:00 2001 From: allenxu404 Date: Fri, 20 Oct 2023 20:47:00 +0800 Subject: [PATCH 28/55] Change v1.12.1 changelog Signed-off-by: allenxu404 --- changelogs/CHANGELOG-1.12.md | 16 ++++++++++++++++ changelogs/unreleased/6986-blackpiglet | 1 - changelogs/unreleased/6991-Lyndon-Li | 1 - 3 files changed, 16 insertions(+), 2 deletions(-) delete mode 100644 changelogs/unreleased/6986-blackpiglet delete mode 100644 changelogs/unreleased/6991-Lyndon-Li diff --git a/changelogs/CHANGELOG-1.12.md b/changelogs/CHANGELOG-1.12.md index 16b5cdaef6..8182b3e8af 100644 --- a/changelogs/CHANGELOG-1.12.md +++ b/changelogs/CHANGELOG-1.12.md @@ -13,6 +13,20 @@ https://velero.io/docs/v1.12/ ### Upgrading https://velero.io/docs/v1.12/upgrade-to-1.12/ +### Highlights + +#### Data Mover Adds Support for Block Mode Volumes +For PersistentVolumes with volumeMode set as Block, the volumes are mounted as raw block devices in pods, in 1.12.1, Velero CSI snapshot data movement supports to backup and restore this kind of volumes under linux based Kubernetes clusters. + +#### New Parameter in Installation to Enable Data Mover +The `velero install` sub-command now includes a new parameter,`--default-snapshot-move-data`, which configures Velero server to move data by default for all snapshots supporting data movement. This feature is useful for users who will always want to use VBDM for backups instead of plain CSI , as they no longer need to specify the `--snapshot-move-data` flag for each individual backup. + +#### Velero Base Image change +The base image previously used by Velero was `distroless`, which contains several CVEs cannot be addressed quickly. As a result, Velero will now use `paketobuildpacks` image starting from this new version. + +### Limitations/Known issues +* The data mover's support for block mode volumes is currently only applicable to Linux environments. + ### All changes * Import auth provider plugins (#6970, @0x113) * Perf improvements for existing resource restore (#6948, @sseago) @@ -26,6 +40,8 @@ https://velero.io/docs/v1.12/upgrade-to-1.12/ * Add `orLabelSelectors` for backup, restore commands (#6881, @nilesh-akhade) * Fix issue #6859, move plugin depending podvolume functions to util pkg, so as to remove the dependencies to unnecessary repository packages like kopia, azure, etc. (#6877, @Lyndon-Li) * Fix issue #6786, always delete VSC regardless of the deletion policy (#6873, @Lyndon-Li) +* Fix #6988, always get region from BSL if it is not empty (#6991, @Lyndon-Li) +* Add both non-Windows version and Windows version code for PVC block mode logic. (#6986, @blackpiglet) ## v1.12 ### 2023-08-18 diff --git a/changelogs/unreleased/6986-blackpiglet b/changelogs/unreleased/6986-blackpiglet deleted file mode 100644 index 4eae63eaee..0000000000 --- a/changelogs/unreleased/6986-blackpiglet +++ /dev/null @@ -1 +0,0 @@ -Add both non-Windows version and Windows version code for PVC block mode logic. \ No newline at end of file diff --git a/changelogs/unreleased/6991-Lyndon-Li b/changelogs/unreleased/6991-Lyndon-Li deleted file mode 100644 index 6f79e1c9d2..0000000000 --- a/changelogs/unreleased/6991-Lyndon-Li +++ /dev/null @@ -1 +0,0 @@ -Fix #6988, always get region from BSL if it is not empty \ No newline at end of file From 5b36df9d7a9232973cfe72d52180eb2d0c17beda Mon Sep 17 00:00:00 2001 From: Dylan Murray Date: Mon, 29 Jun 2020 13:49:38 -0400 Subject: [PATCH 29/55] Dockerfile.ubi/travis local files add UBI dockerfiles Use numeric user for velero-restic-restore-helper Enable multiarch builds (#135) Use arm64-graviton2 for arm builds (#137) Add required keys for arm builds (#139) Update Travis build job to work w/o changes on new branches Use a full VM for arm Use numeric non-root user for nonroot SCC compatibility --- .travis.yml | 78 ++++++++++++++++++++++++++++ Dockerfile-velero-restore-helper.ubi | 14 +++++ Dockerfile.ubi | 23 ++++++++ 3 files changed, 115 insertions(+) create mode 100644 .travis.yml create mode 100644 Dockerfile-velero-restore-helper.ubi create mode 100644 Dockerfile.ubi diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000..13365b48a5 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,78 @@ +os: linux +services: docker +dist: focal +language: go +go: stable + +env: + global: + - IMAGE1: quay.io/konveyor/velero + - IMAGE2: quay.io/konveyor/velero-restore-helper + - DEFAULT_BRANCH: konveyor-dev + - DOCKERFILE1: Dockerfile.ubi + - DOCKERFILE2: Dockerfile-velero-restore-helper.ubi + - DOCKER_CLI_EXPERIMENTAL: enabled + - GOPROXY: https://goproxy.io,direct + +before_install: +- | + if [ "${TRAVIS_BRANCH}" == "${DEFAULT_BRANCH}" ]; then + export TAG=latest + else + export TAG="${TRAVIS_BRANCH}" + fi + +# Builds routinely fail due to download failures inside alternate arch docker containers +# Here we are downloading outside the docker container and copying the deps in +# Also use -v for downloads/builds to stop no output failures from lxd env buffering. +before_script: +- go mod vendor -v +- git clone https://github.com/konveyor/restic -b ${TRAVIS_BRANCH} +- pushd restic; go mod vendor -v; popd +- sed -i 's|-mod=mod|-mod=vendor|g' ${DOCKERFILE1} +- sed -i 's|-mod=mod|-mod=vendor|g' ${DOCKERFILE2} +- sed -i 's|go build|go build -v|g' ${DOCKERFILE1} +- sed -i 's|go build|go build -v|g' ${DOCKERFILE2} +- sed -i 's|^RUN mkdir -p \$APP_ROOT/src/github.com/restic \\$|COPY --chown=1001 restic/ $APP_ROOT/src/github.com/restic/restic|g' ${DOCKERFILE1} +- sed -i 's|&& cd \$APP_ROOT/src/github.com/restic \\$||g' ${DOCKERFILE1} +- sed -i 's|&& git clone https://github.com/konveyor/restic -b .*$||g' ${DOCKERFILE1} + +script: +- docker build -t ${IMAGE1}:${TAG}-${TRAVIS_ARCH} -f ${DOCKERFILE1} . +- docker build -t ${IMAGE2}:${TAG}-${TRAVIS_ARCH} -f ${DOCKERFILE2} . +- if [ -n "${QUAY_ROBOT}" ]; then docker login quay.io -u "${QUAY_ROBOT}" -p ${QUAY_TOKEN}; fi +- if [ -n "${QUAY_ROBOT}" ]; then docker push ${IMAGE1}:${TAG}-${TRAVIS_ARCH}; fi +- if [ -n "${QUAY_ROBOT}" ]; then docker push ${IMAGE2}:${TAG}-${TRAVIS_ARCH}; fi + +jobs: + include: + - stage: build images + arch: ppc64le + - arch: s390x + - arch: arm64-graviton2 + virt: vm + group: edge + - arch: amd64 + - stage: push manifest + language: shell + arch: amd64 + before_script: [] + script: + - | + if [ -n "${QUAY_ROBOT}" ]; then + docker login quay.io -u "${QUAY_ROBOT}" -p ${QUAY_TOKEN} + docker manifest create \ + ${IMAGE1}:${TAG} \ + ${IMAGE1}:${TAG}-amd64 \ + ${IMAGE1}:${TAG}-ppc64le \ + ${IMAGE1}:${TAG}-s390x \ + ${IMAGE1}:${TAG}-aarch64 + docker manifest create \ + ${IMAGE2}:${TAG} \ + ${IMAGE2}:${TAG}-amd64 \ + ${IMAGE2}:${TAG}-ppc64le \ + ${IMAGE2}:${TAG}-s390x \ + ${IMAGE2}:${TAG}-aarch64 + docker manifest push ${IMAGE1}:${TAG} + docker manifest push ${IMAGE2}:${TAG} + fi diff --git a/Dockerfile-velero-restore-helper.ubi b/Dockerfile-velero-restore-helper.ubi new file mode 100644 index 0000000000..6ba5c1c33d --- /dev/null +++ b/Dockerfile-velero-restore-helper.ubi @@ -0,0 +1,14 @@ +FROM quay.io/konveyor/builder:latest AS builder +ENV GOPATH=$APP_ROOT +COPY . $APP_ROOT/src/github.com/vmware-tanzu/velero +WORKDIR $APP_ROOT/src/github.com/vmware-tanzu/velero +RUN CGO_ENABLED=0 GOOS=linux go build -a -mod=mod -ldflags '-extldflags "-static"' -o $APP_ROOT/src/velero-restore-helper github.com/vmware-tanzu/velero/cmd/velero-restore-helper + +FROM registry.access.redhat.com/ubi8-minimal +RUN microdnf -y update && microdnf clean all + +COPY --from=builder /opt/app-root/src/velero-restore-helper velero-restore-helper + +USER 65534:65534 + +ENTRYPOINT [ "/velero-restore-helper" ] diff --git a/Dockerfile.ubi b/Dockerfile.ubi new file mode 100644 index 0000000000..3f4999b7e6 --- /dev/null +++ b/Dockerfile.ubi @@ -0,0 +1,23 @@ +# TODO! Find a real ubi8 image for golang 1.16 +FROM quay.io/konveyor/builder:latest AS builder +ENV GOPATH=$APP_ROOT +COPY . /go/src/github.com/vmware-tanzu/velero +WORKDIR /go/src/github.com/vmware-tanzu/velero +RUN CGO_ENABLED=0 GOOS=linux go build -a -mod=mod -ldflags '-extldflags "-static" -X github.com/vmware-tanzu/velero/pkg/buildinfo.Version=konveyor-dev' -o /go/src/velero github.com/vmware-tanzu/velero/cmd/velero + +FROM quay.io/konveyor/builder:latest AS restic-builder +ENV GOPATH=$APP_ROOT +RUN mkdir -p $APP_ROOT/src/github.com/restic \ +&& cd $APP_ROOT/src/github.com/restic \ +&& git clone https://github.com/konveyor/restic -b konveyor-dev +WORKDIR $APP_ROOT/src/github.com/restic/restic +RUN CGO_ENABLED=0 GOOS=linux go build -a -mod=mod -ldflags '-extldflags "-static"' -o $APP_ROOT/src/restic github.com/restic/restic/cmd/restic + +FROM registry.access.redhat.com/ubi8-minimal +RUN microdnf -y update && microdnf -y install nmap-ncat && microdnf clean all +COPY --from=builder /go/src/velero velero +COPY --from=restic-builder /opt/app-root/src/restic /usr/bin/restic + +USER 65534:65534 + +ENTRYPOINT ["/velero"] From c0b58688500e5405f676ec3e66d18a831be853db Mon Sep 17 00:00:00 2001 From: RayfordJ Date: Thu, 28 Jan 2021 14:24:08 -0600 Subject: [PATCH 30/55] Add BZ + Publish automation to repo (#82) (cherry picked from commit ccb545fbcf293e0e7595a91763481cf4fa7e0d45) Update PR-BZ automation mapping (#84) (cherry picked from commit aa2b019366b98b64c46244e0a697540e7c4d5d2b) Update PR-BZ automation (#92) Co-authored-by: Rayford Johnson (cherry picked from commit ecc563f90324d9924318618f7a4a167f6ea231bf) Add publish workflow (#108) (cherry picked from commit f87b779eb243fa5b37731761613ea962103a5956) --- .github/workflows/bz-pr-action.yml | 38 +++++++++++++++++++ .github/workflows/pr-merge.yml | 37 ++++++++++++++++++ .github/workflows/publish.yml | 61 ++++++++++++++++++++++++++++++ 3 files changed, 136 insertions(+) create mode 100644 .github/workflows/bz-pr-action.yml create mode 100644 .github/workflows/pr-merge.yml create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/bz-pr-action.yml b/.github/workflows/bz-pr-action.yml new file mode 100644 index 0000000000..c1558ca482 --- /dev/null +++ b/.github/workflows/bz-pr-action.yml @@ -0,0 +1,38 @@ +# This is a basic workflow to help you get started with Actions + +name: BZ PR Creation + +# Controls when the action will run. +on: + # Triggers the workflow on push or pull request events but only for the main branch + pull_request_target: + branches: + - "*" + types: + - opened + - edited + - reopened + - synchronize + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + bz-on-pr-create: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: docker://quay.io/konveyor/pr-bz-github-action + name: update bugzilla with posted pr + with: + org_repo: ${{ github.repository }} + pr_number: ${{ github.event.pull_request.number }} + bz_product: "Migration Toolkit for Containers" + title: ${{ github.event.pull_request.title }} + github_token: ${{ secrets.GITHUB_TOKEN }} + bugzilla_token: ${{ secrets.BUGZILLA_TOKEN }} diff --git a/.github/workflows/pr-merge.yml b/.github/workflows/pr-merge.yml new file mode 100644 index 0000000000..3c4ae6ee0f --- /dev/null +++ b/.github/workflows/pr-merge.yml @@ -0,0 +1,37 @@ +# This is a basic workflow to help you get started with Actions + +name: BZ Merge + +# Controls when the action will run. +on: + # Triggers the workflow on push or pull request events but only for the main branch + pull_request_target: + branches: + - "*" + types: + - closed + + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in pnamearallel +jobs: + # This workflow contains a single job called "build" + bz-on-pr-merge: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + - uses: docker://quay.io/konveyor/pr-merge-github-action + name: update bugzilla to modified + with: + bugzilla_token: ${{ secrets.BUGZILLA_TOKEN }} + org_repo: ${{ github.repository }} + pr_number: ${{ github.event.pull_request.number }} + bz_product: "Migration Toolkit for Containers" + title: ${{ github.event.pull_request.title }} + github_token: ${{ secrets.GITHUB_TOKEN }} + branch_to_release: "release-1.4.4:1.4.4,release-1.4.3:1.4.3,konveyor-1.5.2:1.4.0,release-1.4.5:1.4.5,release-1.5.0:1.5.0,konveyor-dev:1.5.z" + base_branch: ${{ github.base_ref }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000000..f5817915f5 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,61 @@ +name: Publish Images + +on: + push: + branches: + - konveyor-dev + - 'release-*.*.*' + - 'sprint-*' + tags: + - 'release-*.*.*' + workflow_dispatch: + +env: + REGISTRY: quay.io + IMAGE_NAME: konveyor/velero + HELPER_IMAGE_NAME: konveyor/velero-restore-helper +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Extract branch name + shell: bash + run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" + id: extract_branch + + - name: Build container image + run: docker build . --file Dockerfile.ubi --tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.extract_branch.outputs.branch }} + + - name: Build helper image + run: docker build . --file Dockerfile-velero-restore-helper.ubi --tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.extract_branch.outputs.branch }} + + - name: Log into registry + run: echo "${{ secrets.QUAY_PUBLISH_TOKEN }}" | docker login quay.io -u ${{ secrets.QUAY_PUBLISH_ROBOT }} --password-stdin + + - name: Push container image + run: docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.extract_branch.outputs.branch }} + + - name: Push helper image + run: docker push ${{ env.REGISTRY }}/${{ env.HELPER_IMAGE_NAME }}:${{ steps.extract_branch.outputs.branch }} + + - name: Retag container image + run: docker tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.extract_branch.outputs.branch }} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest + if: ${{ github.ref == 'refs/heads/konveyor-dev' }} + + - name: Retag helper image + run: docker tag ${{ env.REGISTRY }}/${{ env.HELPER_IMAGE_NAME }}:${{ steps.extract_branch.outputs.branch }} ${{ env.REGISTRY }}/${{ env.HELPER_IMAGE_NAME }}:latest + if: ${{ github.ref == 'refs/heads/konveyor-dev' }} + + - name: push retagged container image + run: docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest + if: ${{ github.ref == 'refs/heads/konveyor-dev' }} + + - name: push retagged helper image + run: docker push ${{ env.REGISTRY }}/${{ env.HELPER_IMAGE_NAME }}:latest + if: ${{ github.ref == 'refs/heads/konveyor-dev' }} From d4b0b87279985c5338c1e1fb09944f9cb72f9066 Mon Sep 17 00:00:00 2001 From: Scott Seago Date: Fri, 4 Nov 2022 10:30:32 -0400 Subject: [PATCH 31/55] remove dependabot config from fork --- .github/dependabot.yml | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 45332806b9..0000000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,21 +0,0 @@ -version: 2 -updates: - # Dependencies listed in .github/workflows - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "weekly" - labels: - - "Dependencies" - - "github_actions" - - "kind/changelog-not-required" - # Dependencies listed in go.mod - - package-ecosystem: "gomod" - directory: "/" # Location of package manifests - schedule: - interval: "weekly" - labels: - - "kind/changelog-not-required" - ignore: - - dependency-name: "*" - update-types: ["version-update:semver-major", "version-update:semver-minor", "version-update:semver-patch"] From 52e9325cd7085d40e5df1d64be5b3c1127c392a0 Mon Sep 17 00:00:00 2001 From: Tiger Kaovilai Date: Wed, 5 Apr 2023 11:22:54 -0400 Subject: [PATCH 32/55] Create Makefile.prow Code-gen no longer required on verify due to https://github.com/vmware-tanzu/velero/pull/6039 Signed-off-by: Tiger Kaovilai oadp-1.2: Update Makefile.prow to velero-restore-helper --- Makefile.prow | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 Makefile.prow diff --git a/Makefile.prow b/Makefile.prow new file mode 100644 index 0000000000..b29dfc1d99 --- /dev/null +++ b/Makefile.prow @@ -0,0 +1,92 @@ +# warning: verify this inside a container with following: +# docker run -it --rm -v `pwd`:`pwd` -w `pwd` golang:1.18 bash -c "make -f Makefile.prow ci" +# +# otherwise unintended system changes may include, replacing your currently installed kubectl, binaries in GOBIN, files in GOPATH/src +# +# If formatting needs updating you can run +# GOFLAGS=-mod=mod make update + +GOFLAGS=-mod=mod +CONGEN_VERSION=0.7.0 +CODEGEN_VERSION=0.22.2 +PROWBIN=/tmp/prowbin +# Name of this Makefile +MAKEFILE=Makefile.prow +# emulate as close as possible upstream ci target +# upstream ci target: verify-modules verify all test +# we only need to modify verify, test, all to avoid docker usage +.PHONY: ci +ci: + @echo "go version is: $(shell go version)" + GOFLAGS=$(GOFLAGS) make verify-modules + make -f $(MAKEFILE) verify all test + +.PHONY: verify +verify: goimports controller-gen kubectl #code-generator +# add PROWBIN to PATH + @echo Verifying with PATH=$(PROWBIN):$(PATH) +# Per +# https://github.com/vmware-tanzu/velero/blob/dd660882d0db96d430547f39dc3694d1c1bc19f3/Makefile#L160-L163 +# code-generator tools require project to be in heirarchy such as github.com/vmware-tanzu/velero +# so we need to copy the project to GOPATH/src/github.com/vmware-tanzu/velero +# and then run verify from there +# otherwise the code-generator tools will fail + mkdir -p $(GOSRC)/github.com/vmware-tanzu/ + cp -r . $(GOSRC)/github.com/vmware-tanzu/velero + cd $(GOSRC)/github.com/vmware-tanzu/velero && \ + PATH=$(PROWBIN):$(PATH) GOFLAGS=$(GOFLAGS) hack/verify-all.sh + +.PHONY: all +all: + GOFLAGS=$(GOFLAGS) make local + GOFLAGS=$(GOFLAGS) BIN=velero-restore-helper make local + +.PHONY: test +# our test is modified to avoid docker usage +test: envtest + @echo Testing with KUBEBUILDER_ASSETS=$(KUBEBUILDER_ASSETS) + KUBEBUILDER_ASSETS=$(KUBEBUILDER_ASSETS) GOFLAGS=$(GOFLAGS) hack/test.sh + +GOPATH:=$(shell go env GOPATH) +GOBIN:=$(GOPATH)/bin +GOSRC:=$(GOPATH)/src +# if KUBEBUILDER_ASSETS contains space, escape it +KUBEBUILDER_ASSETS=$(shell echo $(shell $(GOBIN)/setup-envtest use -p path) | sed 's/ /\\ /g') +.PHONY: envtest +envtest: $(GOBIN)/setup-envtest + $(GOBIN)/setup-envtest use -p path + +$(GOBIN)/setup-envtest: + @echo Installing envtest tools + GOFLAGS= go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest + @echo Installed envtest tools + +.PHONY: goimports +goimports: $(GOBIN)/goimports + +$(GOBIN)/goimports: + @echo Installing goimports + go install golang.org/x/tools/cmd/goimports@latest + @echo Installed goimports + +.PHONY: code-generator +code-generator: $(GOSRC)/k8s.io/code-generator + +$(GOSRC)/k8s.io/code-generator: + mkdir -p $(GOSRC)/k8s.io/ + cd $(GOSRC)/k8s.io/ && git clone -b v$(CODEGEN_VERSION) https://github.com/kubernetes/code-generator + +.PHONY: controller-gen +controller-gen: $(GOBIN)/controller-gen + +$(GOBIN)/controller-gen: + go install sigs.k8s.io/controller-tools/cmd/controller-gen@v$(CONGEN_VERSION) + +.PHONY: kubectl +kubectl: $(PROWBIN)/kubectl + +$(PROWBIN)/kubectl: + curl -LO "https://dl.k8s.io/release/$(shell curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" + chmod +x ./kubectl + mkdir -p $(PROWBIN) + mv ./kubectl $(PROWBIN) From 70ce3dcb8346eb9d6c22893aae607fe1661dbad4 Mon Sep 17 00:00:00 2001 From: Scott Seago Date: Tue, 25 Jul 2023 16:57:14 -0400 Subject: [PATCH 33/55] set HOME in velero image for kopia, update controller-gen for CI (#280) Signed-off-by: Scott Seago --- Dockerfile.ubi | 4 ++++ Makefile.prow | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Dockerfile.ubi b/Dockerfile.ubi index 3f4999b7e6..f250eb5cfa 100644 --- a/Dockerfile.ubi +++ b/Dockerfile.ubi @@ -18,6 +18,10 @@ RUN microdnf -y update && microdnf -y install nmap-ncat && microdnf clean all COPY --from=builder /go/src/velero velero COPY --from=restic-builder /opt/app-root/src/restic /usr/bin/restic +RUN mkdir -p /home/velero +RUN chmod -R 777 /home/velero + USER 65534:65534 +ENV HOME=/home/velero ENTRYPOINT ["/velero"] diff --git a/Makefile.prow b/Makefile.prow index b29dfc1d99..7e43d0b8c2 100644 --- a/Makefile.prow +++ b/Makefile.prow @@ -7,7 +7,7 @@ # GOFLAGS=-mod=mod make update GOFLAGS=-mod=mod -CONGEN_VERSION=0.7.0 +CONGEN_VERSION=0.12.0 CODEGEN_VERSION=0.22.2 PROWBIN=/tmp/prowbin # Name of this Makefile From 4d5b3eef517b1ca9624b94d9c826e327772f7aed Mon Sep 17 00:00:00 2001 From: Scott Seago Date: Wed, 16 Aug 2023 10:56:28 -0400 Subject: [PATCH 34/55] build velero-helper binary for datamover pod --- Dockerfile.ubi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile.ubi b/Dockerfile.ubi index f250eb5cfa..602dd61b35 100644 --- a/Dockerfile.ubi +++ b/Dockerfile.ubi @@ -4,6 +4,7 @@ ENV GOPATH=$APP_ROOT COPY . /go/src/github.com/vmware-tanzu/velero WORKDIR /go/src/github.com/vmware-tanzu/velero RUN CGO_ENABLED=0 GOOS=linux go build -a -mod=mod -ldflags '-extldflags "-static" -X github.com/vmware-tanzu/velero/pkg/buildinfo.Version=konveyor-dev' -o /go/src/velero github.com/vmware-tanzu/velero/cmd/velero +RUN CGO_ENABLED=0 GOOS=linux go build -a -mod=mod -ldflags '-extldflags "-static"' -o /go/src/velero-helper github.com/vmware-tanzu/velero/cmd/velero-helper FROM quay.io/konveyor/builder:latest AS restic-builder ENV GOPATH=$APP_ROOT @@ -16,6 +17,7 @@ RUN CGO_ENABLED=0 GOOS=linux go build -a -mod=mod -ldflags '-extldflags "-static FROM registry.access.redhat.com/ubi8-minimal RUN microdnf -y update && microdnf -y install nmap-ncat && microdnf clean all COPY --from=builder /go/src/velero velero +COPY --from=builder /go/src/velero-helper velero-helper COPY --from=restic-builder /opt/app-root/src/restic /usr/bin/restic RUN mkdir -p /home/velero From e7e3a0f257246aef365d32a02599d9d3749f8b6d Mon Sep 17 00:00:00 2001 From: Tiger Kaovilai Date: Mon, 23 Oct 2023 13:29:17 -0400 Subject: [PATCH 35/55] restore: Use warning when Create IsAlreadyExist and Get error Signed-off-by: Tiger Kaovilai --- changelogs/unreleased/7004-kaovilai | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelogs/unreleased/7004-kaovilai diff --git a/changelogs/unreleased/7004-kaovilai b/changelogs/unreleased/7004-kaovilai new file mode 100644 index 0000000000..3b85df1962 --- /dev/null +++ b/changelogs/unreleased/7004-kaovilai @@ -0,0 +1 @@ +restore: Use warning when Create IsAlreadyExist and Get error \ No newline at end of file From 2d237a7dd2cc88e871e61e07a1a3f057981c1a2c Mon Sep 17 00:00:00 2001 From: Tiger Kaovilai Date: Fri, 20 Oct 2023 14:01:26 -0400 Subject: [PATCH 36/55] kopia/repository/config/aws.go: Set session.Options profile from config Signed-off-by: Tiger Kaovilai --- changelogs/unreleased/6997-kaovilai | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelogs/unreleased/6997-kaovilai diff --git a/changelogs/unreleased/6997-kaovilai b/changelogs/unreleased/6997-kaovilai new file mode 100644 index 0000000000..ef3ab94066 --- /dev/null +++ b/changelogs/unreleased/6997-kaovilai @@ -0,0 +1 @@ +Fix unified repository (kopia) s3 credentials profile selection \ No newline at end of file From 8d1da9e7ce63af0f42890e9cbd0a4af4029be2d5 Mon Sep 17 00:00:00 2001 From: Scott Seago Date: Thu, 23 May 2024 11:40:40 -0400 Subject: [PATCH 37/55] use ubi9-latest to build --- Dockerfile.ubi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile.ubi b/Dockerfile.ubi index 602dd61b35..24ad19abc8 100644 --- a/Dockerfile.ubi +++ b/Dockerfile.ubi @@ -1,12 +1,12 @@ # TODO! Find a real ubi8 image for golang 1.16 -FROM quay.io/konveyor/builder:latest AS builder +FROM quay.io/konveyor/builder:ubi9-latest AS builder ENV GOPATH=$APP_ROOT COPY . /go/src/github.com/vmware-tanzu/velero WORKDIR /go/src/github.com/vmware-tanzu/velero RUN CGO_ENABLED=0 GOOS=linux go build -a -mod=mod -ldflags '-extldflags "-static" -X github.com/vmware-tanzu/velero/pkg/buildinfo.Version=konveyor-dev' -o /go/src/velero github.com/vmware-tanzu/velero/cmd/velero RUN CGO_ENABLED=0 GOOS=linux go build -a -mod=mod -ldflags '-extldflags "-static"' -o /go/src/velero-helper github.com/vmware-tanzu/velero/cmd/velero-helper -FROM quay.io/konveyor/builder:latest AS restic-builder +FROM quay.io/konveyor/builder:ubi9-latest AS restic-builder ENV GOPATH=$APP_ROOT RUN mkdir -p $APP_ROOT/src/github.com/restic \ && cd $APP_ROOT/src/github.com/restic \ @@ -14,7 +14,7 @@ RUN mkdir -p $APP_ROOT/src/github.com/restic \ WORKDIR $APP_ROOT/src/github.com/restic/restic RUN CGO_ENABLED=0 GOOS=linux go build -a -mod=mod -ldflags '-extldflags "-static"' -o $APP_ROOT/src/restic github.com/restic/restic/cmd/restic -FROM registry.access.redhat.com/ubi8-minimal +FROM registry.access.redhat.com/ubi9-minimal RUN microdnf -y update && microdnf -y install nmap-ncat && microdnf clean all COPY --from=builder /go/src/velero velero COPY --from=builder /go/src/velero-helper velero-helper From 2c5b3991ff861c330e680686399644f8dad8c163 Mon Sep 17 00:00:00 2001 From: Scott Seago Date: Wed, 5 Jun 2024 10:28:00 -0400 Subject: [PATCH 38/55] OADP-4225: add tzdata to Dockerfile.ubi --- Dockerfile.ubi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile.ubi b/Dockerfile.ubi index 24ad19abc8..18e5dfad04 100644 --- a/Dockerfile.ubi +++ b/Dockerfile.ubi @@ -15,7 +15,7 @@ WORKDIR $APP_ROOT/src/github.com/restic/restic RUN CGO_ENABLED=0 GOOS=linux go build -a -mod=mod -ldflags '-extldflags "-static"' -o $APP_ROOT/src/restic github.com/restic/restic/cmd/restic FROM registry.access.redhat.com/ubi9-minimal -RUN microdnf -y update && microdnf -y install nmap-ncat && microdnf clean all +RUN microdnf -y update && microdnf -y install nmap-ncat && microdnf -y reinstall tzdata && microdnf clean all COPY --from=builder /go/src/velero velero COPY --from=builder /go/src/velero-helper velero-helper COPY --from=restic-builder /opt/app-root/src/restic /usr/bin/restic From 12da1cf9db008e3dfe15d03d62df14d76af10e41 Mon Sep 17 00:00:00 2001 From: Mateus Oliveira Date: Mon, 17 Jun 2024 16:51:47 -0300 Subject: [PATCH 39/55] fix: CI (#316) Signed-off-by: Mateus Oliveira --- Makefile.prow | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.prow b/Makefile.prow index 7e43d0b8c2..a658fe2981 100644 --- a/Makefile.prow +++ b/Makefile.prow @@ -7,7 +7,7 @@ # GOFLAGS=-mod=mod make update GOFLAGS=-mod=mod -CONGEN_VERSION=0.12.0 +CONGEN_VERSION=0.14.0 CODEGEN_VERSION=0.22.2 PROWBIN=/tmp/prowbin # Name of this Makefile From a33060b0dc931f495a93d0679d915a78754340eb Mon Sep 17 00:00:00 2001 From: Mateus Oliveira Date: Tue, 6 Aug 2024 14:11:15 -0300 Subject: [PATCH 40/55] fix: ARM images (#332) * fix: ARM images Signed-off-by: Mateus Oliveira * fixup! fix: ARM images Signed-off-by: Mateus Oliveira --------- Signed-off-by: Mateus Oliveira --- Dockerfile-velero-restore-helper.ubi | 12 +++++++++--- Dockerfile.ubi | 23 +++++++++++++++++------ 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/Dockerfile-velero-restore-helper.ubi b/Dockerfile-velero-restore-helper.ubi index 6ba5c1c33d..7c168c05ed 100644 --- a/Dockerfile-velero-restore-helper.ubi +++ b/Dockerfile-velero-restore-helper.ubi @@ -1,10 +1,16 @@ -FROM quay.io/konveyor/builder:latest AS builder +FROM quay.io/konveyor/builder:ubi9-latest AS builder +ARG TARGETOS +ARG TARGETARCH + ENV GOPATH=$APP_ROOT + COPY . $APP_ROOT/src/github.com/vmware-tanzu/velero + WORKDIR $APP_ROOT/src/github.com/vmware-tanzu/velero -RUN CGO_ENABLED=0 GOOS=linux go build -a -mod=mod -ldflags '-extldflags "-static"' -o $APP_ROOT/src/velero-restore-helper github.com/vmware-tanzu/velero/cmd/velero-restore-helper -FROM registry.access.redhat.com/ubi8-minimal +RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -mod=mod -ldflags '-extldflags "-static"' -o $APP_ROOT/src/velero-restore-helper github.com/vmware-tanzu/velero/cmd/velero-restore-helper + +FROM registry.access.redhat.com/ubi9-minimal RUN microdnf -y update && microdnf clean all COPY --from=builder /opt/app-root/src/velero-restore-helper velero-restore-helper diff --git a/Dockerfile.ubi b/Dockerfile.ubi index 18e5dfad04..74a1899240 100644 --- a/Dockerfile.ubi +++ b/Dockerfile.ubi @@ -1,18 +1,29 @@ -# TODO! Find a real ubi8 image for golang 1.16 FROM quay.io/konveyor/builder:ubi9-latest AS builder +ARG TARGETOS +ARG TARGETARCH + ENV GOPATH=$APP_ROOT + COPY . /go/src/github.com/vmware-tanzu/velero + WORKDIR /go/src/github.com/vmware-tanzu/velero -RUN CGO_ENABLED=0 GOOS=linux go build -a -mod=mod -ldflags '-extldflags "-static" -X github.com/vmware-tanzu/velero/pkg/buildinfo.Version=konveyor-dev' -o /go/src/velero github.com/vmware-tanzu/velero/cmd/velero -RUN CGO_ENABLED=0 GOOS=linux go build -a -mod=mod -ldflags '-extldflags "-static"' -o /go/src/velero-helper github.com/vmware-tanzu/velero/cmd/velero-helper + +RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -mod=mod -ldflags '-extldflags "-static" -X github.com/vmware-tanzu/velero/pkg/buildinfo.Version=konveyor-dev' -o /go/src/velero github.com/vmware-tanzu/velero/cmd/velero +RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -mod=mod -ldflags '-extldflags "-static"' -o /go/src/velero-helper github.com/vmware-tanzu/velero/cmd/velero-helper FROM quay.io/konveyor/builder:ubi9-latest AS restic-builder +ARG TARGETOS +ARG TARGETARCH + ENV GOPATH=$APP_ROOT + RUN mkdir -p $APP_ROOT/src/github.com/restic \ -&& cd $APP_ROOT/src/github.com/restic \ -&& git clone https://github.com/konveyor/restic -b konveyor-dev + && cd $APP_ROOT/src/github.com/restic \ + && git clone https://github.com/konveyor/restic -b konveyor-dev + WORKDIR $APP_ROOT/src/github.com/restic/restic -RUN CGO_ENABLED=0 GOOS=linux go build -a -mod=mod -ldflags '-extldflags "-static"' -o $APP_ROOT/src/restic github.com/restic/restic/cmd/restic + +RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -mod=mod -ldflags '-extldflags "-static"' -o $APP_ROOT/src/restic github.com/restic/restic/cmd/restic FROM registry.access.redhat.com/ubi9-minimal RUN microdnf -y update && microdnf -y install nmap-ncat && microdnf -y reinstall tzdata && microdnf clean all From cd452ed5cbeed959785ff6e1e84978f8cf19ad84 Mon Sep 17 00:00:00 2001 From: Tiger Kaovilai Date: Mon, 12 Aug 2024 17:44:49 -0400 Subject: [PATCH 41/55] ubi: BUILDPLATFORM to build stage to enable cross compile. (#336) Signed-off-by: Tiger Kaovilai --- Dockerfile-velero-restore-helper.ubi | 3 ++- Dockerfile.ubi | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Dockerfile-velero-restore-helper.ubi b/Dockerfile-velero-restore-helper.ubi index 7c168c05ed..9470ed75db 100644 --- a/Dockerfile-velero-restore-helper.ubi +++ b/Dockerfile-velero-restore-helper.ubi @@ -1,4 +1,5 @@ -FROM quay.io/konveyor/builder:ubi9-latest AS builder +FROM --platform=$BUILDPLATFORM quay.io/konveyor/builder:ubi9-latest AS builder +ARG BUILDPLATFORM ARG TARGETOS ARG TARGETARCH diff --git a/Dockerfile.ubi b/Dockerfile.ubi index 74a1899240..4b2f524849 100644 --- a/Dockerfile.ubi +++ b/Dockerfile.ubi @@ -1,4 +1,5 @@ -FROM quay.io/konveyor/builder:ubi9-latest AS builder +FROM --platform=$BUILDPLATFORM quay.io/konveyor/builder:ubi9-latest AS builder +ARG BUILDPLATFORM ARG TARGETOS ARG TARGETARCH @@ -11,7 +12,8 @@ WORKDIR /go/src/github.com/vmware-tanzu/velero RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -mod=mod -ldflags '-extldflags "-static" -X github.com/vmware-tanzu/velero/pkg/buildinfo.Version=konveyor-dev' -o /go/src/velero github.com/vmware-tanzu/velero/cmd/velero RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -mod=mod -ldflags '-extldflags "-static"' -o /go/src/velero-helper github.com/vmware-tanzu/velero/cmd/velero-helper -FROM quay.io/konveyor/builder:ubi9-latest AS restic-builder +FROM --platform=$BUILDPLATFORM quay.io/konveyor/builder:ubi9-latest AS restic-builder +ARG BUILDPLATFORM ARG TARGETOS ARG TARGETARCH From 94e330a71fd85d97e7c9869bc02d04a20c1c5f1a Mon Sep 17 00:00:00 2001 From: Michal Pryc Date: Fri, 16 Aug 2024 19:34:39 +0200 Subject: [PATCH 42/55] OADP-4640: Downstream only to allow override kopia default algorithms (#334) (#338) add missing unit test for kopia hashing algo (#337) Introduction of downstream only option to override Kopia default: - hashing algorithm - splitting algorithm - encryption algorithm With introduction of 3 environment variables it is possible to override Kopia algorithms used by Velero: KOPIA_HASHING_ALGORITHM KOPIA_SPLITTER_ALGORITHM KOPIA_ENCRYPTION_ALGORITHM If the env algorithms are not set or they are not within Kopia SupportedAlgorithms, the default algorithm will be used. This behavior is consistent with current behavior without this change. Signed-off-by: Michal Pryc Signed-off-by: Shubham Pampattiwar --- .../udmrepo/kopialib/backend/common.go | 20 ++- .../backend/common_kopia_algorithms_test.go | 160 ++++++++++++++++++ 2 files changed, 177 insertions(+), 3 deletions(-) create mode 100644 pkg/repository/udmrepo/kopialib/backend/common_kopia_algorithms_test.go diff --git a/pkg/repository/udmrepo/kopialib/backend/common.go b/pkg/repository/udmrepo/kopialib/backend/common.go index 7af0612049..f2693330b5 100644 --- a/pkg/repository/udmrepo/kopialib/backend/common.go +++ b/pkg/repository/udmrepo/kopialib/backend/common.go @@ -18,6 +18,8 @@ package backend import ( "context" + "os" + "slices" "time" "github.com/kopia/kopia/repo" @@ -47,16 +49,28 @@ func setupLimits(ctx context.Context, flags map[string]string) throttling.Limits } } +// Helper function to choose between environment variable and default kopia algorithm value +func getKopiaAlgorithm(key, envKey string, flags map[string]string, supportedAlgorithms []string, defaultValue string) string { + algorithm := os.Getenv(envKey) + if len(algorithm) > 0 { + if slices.Contains(supportedAlgorithms, algorithm) { + return algorithm + } + } + + return optionalHaveStringWithDefault(key, flags, defaultValue) +} + // SetupNewRepositoryOptions setups the options when creating a new Kopia repository func SetupNewRepositoryOptions(ctx context.Context, flags map[string]string) repo.NewRepositoryOptions { return repo.NewRepositoryOptions{ BlockFormat: format.ContentFormat{ - Hash: optionalHaveStringWithDefault(udmrepo.StoreOptionGenHashAlgo, flags, hashing.DefaultAlgorithm), - Encryption: optionalHaveStringWithDefault(udmrepo.StoreOptionGenEncryptAlgo, flags, encryption.DefaultAlgorithm), + Hash: getKopiaAlgorithm(udmrepo.StoreOptionGenHashAlgo, "KOPIA_HASHING_ALGORITHM", flags, hashing.SupportedAlgorithms(), hashing.DefaultAlgorithm), + Encryption: getKopiaAlgorithm(udmrepo.StoreOptionGenEncryptAlgo, "KOPIA_ENCRYPTION_ALGORITHM", flags, encryption.SupportedAlgorithms(false), encryption.DefaultAlgorithm), }, ObjectFormat: format.ObjectFormat{ - Splitter: optionalHaveStringWithDefault(udmrepo.StoreOptionGenSplitAlgo, flags, splitter.DefaultAlgorithm), + Splitter: getKopiaAlgorithm(udmrepo.StoreOptionGenSplitAlgo, "KOPIA_SPLITTER_ALGORITHM", flags, splitter.SupportedAlgorithms(), splitter.DefaultAlgorithm), }, RetentionMode: blob.RetentionMode(optionalHaveString(udmrepo.StoreOptionGenRetentionMode, flags)), diff --git a/pkg/repository/udmrepo/kopialib/backend/common_kopia_algorithms_test.go b/pkg/repository/udmrepo/kopialib/backend/common_kopia_algorithms_test.go new file mode 100644 index 0000000000..969ea111d1 --- /dev/null +++ b/pkg/repository/udmrepo/kopialib/backend/common_kopia_algorithms_test.go @@ -0,0 +1,160 @@ +/* +Copyright the Velero contributors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +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. +*/ + +package backend + +import ( + "context" + "testing" + + "github.com/kopia/kopia/repo" + "github.com/kopia/kopia/repo/encryption" + "github.com/kopia/kopia/repo/format" + "github.com/kopia/kopia/repo/hashing" + "github.com/kopia/kopia/repo/splitter" + "github.com/stretchr/testify/assert" + + "github.com/vmware-tanzu/velero/pkg/repository/udmrepo" +) + +func TestSetupNewRepoAlgorithms(t *testing.T) { + + testCases := []struct { + name string + envVars map[string]string + flags map[string]string + expected repo.NewRepositoryOptions + }{ + { + name: "with valid non-default hash algo from env", + envVars: map[string]string{ + "KOPIA_HASHING_ALGORITHM": "HMAC-SHA3-224", + }, + flags: map[string]string{}, + expected: repo.NewRepositoryOptions{ + BlockFormat: format.ContentFormat{ + Hash: "HMAC-SHA3-224", + Encryption: encryption.DefaultAlgorithm, + }, + ObjectFormat: format.ObjectFormat{ + Splitter: splitter.DefaultAlgorithm, + }, + }, + }, + { + name: "with valid non-default encryption algo from env", + envVars: map[string]string{ + "KOPIA_HASHING_ALGORITHM": "", + "KOPIA_SPLITTER_ALGORITHM": "", + "KOPIA_ENCRYPTION_ALGORITHM": "CHACHA20-POLY1305-HMAC-SHA256", + }, + flags: map[string]string{}, + expected: repo.NewRepositoryOptions{ + BlockFormat: format.ContentFormat{ + Hash: hashing.DefaultAlgorithm, + Encryption: "CHACHA20-POLY1305-HMAC-SHA256", + }, + ObjectFormat: format.ObjectFormat{ + Splitter: splitter.DefaultAlgorithm, + }, + }, + }, + { + name: "with valid non-default splitter algo from env", + envVars: map[string]string{"KOPIA_SPLITTER_ALGORITHM": "FIXED-512K"}, + flags: map[string]string{}, + expected: repo.NewRepositoryOptions{ + BlockFormat: format.ContentFormat{ + Hash: hashing.DefaultAlgorithm, + Encryption: encryption.DefaultAlgorithm, + }, + ObjectFormat: format.ObjectFormat{ + Splitter: "FIXED-512K", + }, + }, + }, + { + name: "with valid non-default splitter and hashing algo from env, invalid encryption from env", + envVars: map[string]string{"KOPIA_SPLITTER_ALGORITHM": "FIXED-512K", "KOPIA_HASHING_ALGORITHM": "HMAC-SHA3-224", "KOPIA_ENCRYPTION_ALGORITHM": "NON-EXISTING-SHA256"}, + flags: map[string]string{}, + expected: repo.NewRepositoryOptions{ + BlockFormat: format.ContentFormat{ + Hash: "HMAC-SHA3-224", + Encryption: encryption.DefaultAlgorithm, + }, + ObjectFormat: format.ObjectFormat{ + Splitter: "FIXED-512K", + }, + }, + }, + { + name: "with unsupported hash algo in env, fallback to default", + envVars: map[string]string{"KOPIA_HASHING_ALGORITHM": "unsupported-hash"}, + flags: map[string]string{}, + expected: repo.NewRepositoryOptions{ + BlockFormat: format.ContentFormat{ + Hash: hashing.DefaultAlgorithm, + Encryption: encryption.DefaultAlgorithm, + }, + ObjectFormat: format.ObjectFormat{ + Splitter: splitter.DefaultAlgorithm, + }, + }, + }, + { + name: "hash in StoreOptionGenHashAlgo and env, env wins", + envVars: map[string]string{"KOPIA_HASHING_ALGORITHM": "HMAC-SHA3-224"}, + flags: map[string]string{ + udmrepo.StoreOptionGenHashAlgo: "HMAC-SHA3-256", + }, + expected: repo.NewRepositoryOptions{ + BlockFormat: format.ContentFormat{ + Hash: "HMAC-SHA3-224", + Encryption: encryption.DefaultAlgorithm, + }, + ObjectFormat: format.ObjectFormat{ + Splitter: splitter.DefaultAlgorithm, + }, + }, + }, + { + name: "hash in StoreOptionGenHashAlgo and invalid in env, StoreOptionGenHashAlgo takes precedence", + envVars: map[string]string{"KOPIA_HASHING_ALGORITHM": "INVALID"}, + flags: map[string]string{ + udmrepo.StoreOptionGenHashAlgo: "HMAC-SHA3-256", + }, + expected: repo.NewRepositoryOptions{ + BlockFormat: format.ContentFormat{ + Hash: "HMAC-SHA3-256", + Encryption: encryption.DefaultAlgorithm, + }, + ObjectFormat: format.ObjectFormat{ + Splitter: splitter.DefaultAlgorithm, + }, + }, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + for key, value := range tc.envVars { + t.Setenv(key, value) + } + ret := SetupNewRepositoryOptions(context.Background(), tc.flags) + assert.Equal(t, tc.expected, ret) + }) + } +} From 9ca44bc3ec9722c8f31376e9dd1c704c6f6aa484 Mon Sep 17 00:00:00 2001 From: Michal Pryc Date: Wed, 4 Sep 2024 09:35:32 +0200 Subject: [PATCH 43/55] Downstream only: Rework of Makefile and incusion of lint The rework of Makefile to make it more readable and inclusion of lint as a target as well extract golangci-lint version from the upstream Dockerfile, so we test in PROW or locally on the same version as upstream. Signed-off-by: Michal Pryc --- Makefile.prow | 132 +++++++++++++++++++++++++------------------------- 1 file changed, 65 insertions(+), 67 deletions(-) diff --git a/Makefile.prow b/Makefile.prow index a658fe2981..1b00872675 100644 --- a/Makefile.prow +++ b/Makefile.prow @@ -1,92 +1,90 @@ -# warning: verify this inside a container with following: -# docker run -it --rm -v `pwd`:`pwd` -w `pwd` golang:1.18 bash -c "make -f Makefile.prow ci" -# -# otherwise unintended system changes may include, replacing your currently installed kubectl, binaries in GOBIN, files in GOPATH/src -# -# If formatting needs updating you can run +# Warning: Verify this inside a container with the following command: +# podman run -it --rm -v `pwd`:`pwd`:Z -w `pwd` quay.io/konveyor/builder:ubi9-v1.22.2 bash -c "make -f Makefile.prow ci" +# podman run -it --rm -v `pwd`:`pwd`:Z -w `pwd` quay.io/konveyor/builder:ubi9-v1.22.2 bash -c "make -f Makefile.prow lint" +# +# Otherwise, unintended system changes may occur, including replacing your +# currently installed binaries in GOBIN, files in GOPATH/src +# +# To update formatting, run: # GOFLAGS=-mod=mod make update -GOFLAGS=-mod=mod -CONGEN_VERSION=0.14.0 -CODEGEN_VERSION=0.22.2 -PROWBIN=/tmp/prowbin -# Name of this Makefile -MAKEFILE=Makefile.prow -# emulate as close as possible upstream ci target +# Configuration Variables +GOFLAGS := -mod=mod +CONGEN_VERSION := 0.14.0 +CODEGEN_VERSION := 0.22.2 +PROWBIN := /tmp/prowbin + +# GOPATH Setup +GOPATH := $(shell go env GOPATH) +GOBIN := $(GOPATH)/bin +GOSRC := $(GOPATH)/src + + # upstream ci target: verify-modules verify all test -# we only need to modify verify, test, all to avoid docker usage +# we need to modify verify, test, all to avoid usage of docker CLI .PHONY: ci -ci: - @echo "go version is: $(shell go version)" - GOFLAGS=$(GOFLAGS) make verify-modules - make -f $(MAKEFILE) verify all test +ci: verify-modules verify all test + +.PHONY: verify-modules +verify-modules: + @echo "verify-modules target: calls upstream Makefile verify-modules" + PATH=$(PROWBIN):$(PATH) GOFLAGS=$(GOFLAGS) make verify-modules .PHONY: verify -verify: goimports controller-gen kubectl #code-generator -# add PROWBIN to PATH - @echo Verifying with PATH=$(PROWBIN):$(PATH) -# Per -# https://github.com/vmware-tanzu/velero/blob/dd660882d0db96d430547f39dc3694d1c1bc19f3/Makefile#L160-L163 -# code-generator tools require project to be in heirarchy such as github.com/vmware-tanzu/velero -# so we need to copy the project to GOPATH/src/github.com/vmware-tanzu/velero -# and then run verify from there -# otherwise the code-generator tools will fail - mkdir -p $(GOSRC)/github.com/vmware-tanzu/ - cp -r . $(GOSRC)/github.com/vmware-tanzu/velero - cd $(GOSRC)/github.com/vmware-tanzu/velero && \ +verify: setup-env goimports controller-gen + @echo "Running verification scripts" PATH=$(PROWBIN):$(PATH) GOFLAGS=$(GOFLAGS) hack/verify-all.sh +# Build targets .PHONY: all all: - GOFLAGS=$(GOFLAGS) make local - GOFLAGS=$(GOFLAGS) BIN=velero-restore-helper make local + @echo "Running all targets" + PATH=$(PROWBIN):$(PATH) GOFLAGS=$(GOFLAGS) make local + PATH=$(PROWBIN):$(PATH) GOFLAGS=$(GOFLAGS) BIN=velero-restore-helper make local .PHONY: test -# our test is modified to avoid docker usage -test: envtest - @echo Testing with KUBEBUILDER_ASSETS=$(KUBEBUILDER_ASSETS) +test: setup-env + # Kubebuilder Setup + @echo "Setting up Kubebuilder assets..." + $(eval KUBEBUILDER_ASSETS := $(shell $(GOBIN)/setup-envtest use -p path | sed 's/ /\\ /g')) + @echo "KUBEBUILDER_ASSETS is set to $(KUBEBUILDER_ASSETS)" + @echo "Running tests..." KUBEBUILDER_ASSETS=$(KUBEBUILDER_ASSETS) GOFLAGS=$(GOFLAGS) hack/test.sh -GOPATH:=$(shell go env GOPATH) -GOBIN:=$(GOPATH)/bin -GOSRC:=$(GOPATH)/src -# if KUBEBUILDER_ASSETS contains space, escape it -KUBEBUILDER_ASSETS=$(shell echo $(shell $(GOBIN)/setup-envtest use -p path) | sed 's/ /\\ /g') -.PHONY: envtest -envtest: $(GOBIN)/setup-envtest +.PHONY: lint +lint: golangci-lint + @echo "Running lint" + PATH=$(PROWBIN):$(PATH) GOFLAGS=$(GOFLAGS) hack/lint.sh + +# Setup the environment for testing +.PHONY: setup-env +setup-env: setup-envtest + @echo "Setting up envtest tools" $(GOBIN)/setup-envtest use -p path -$(GOBIN)/setup-envtest: - @echo Installing envtest tools - GOFLAGS= go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest - @echo Installed envtest tools +# Installations of dependencies +.PHONY: goimports controller-gen golangci-lint kubectl setup-envtest -.PHONY: goimports -goimports: $(GOBIN)/goimports +goimports: $(GOBIN)/goimports +controller-gen: $(GOBIN)/controller-gen +golangci-lint: $(GOBIN)/golangci-lint +kubectl: $(PROWBIN)/kubectl +setup-envtest: $(GOBIN)/setup-envtest $(GOBIN)/goimports: - @echo Installing goimports + @echo "Installing goimports" go install golang.org/x/tools/cmd/goimports@latest - @echo Installed goimports - -.PHONY: code-generator -code-generator: $(GOSRC)/k8s.io/code-generator - -$(GOSRC)/k8s.io/code-generator: - mkdir -p $(GOSRC)/k8s.io/ - cd $(GOSRC)/k8s.io/ && git clone -b v$(CODEGEN_VERSION) https://github.com/kubernetes/code-generator - -.PHONY: controller-gen -controller-gen: $(GOBIN)/controller-gen $(GOBIN)/controller-gen: + @echo "Installing controller-gen" go install sigs.k8s.io/controller-tools/cmd/controller-gen@v$(CONGEN_VERSION) -.PHONY: kubectl -kubectl: $(PROWBIN)/kubectl +$(GOBIN)/golangci-lint: + @echo "Extracting golangci-lint version from hack/build-image/Dockerfile" + GOLANGCI_VERSION=$$(grep -oP 'golangci-lint/master/install.sh.*\Kv[0-9]+\.[0-9]+\.[0-9]+' hack/build-image/Dockerfile); \ + echo "Installing golangci-lint version: $$GOLANGCI_VERSION"; \ + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOBIN) $$GOLANGCI_VERSION -$(PROWBIN)/kubectl: - curl -LO "https://dl.k8s.io/release/$(shell curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" - chmod +x ./kubectl - mkdir -p $(PROWBIN) - mv ./kubectl $(PROWBIN) +$(GOBIN)/setup-envtest: + @echo "Installing envtest tools" + go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest From fbff507d36c7e6b0c8cb6cae10a67b6554df1424 Mon Sep 17 00:00:00 2001 From: Michal Pryc Date: Thu, 5 Sep 2024 16:15:42 +0200 Subject: [PATCH 44/55] Downstream only - fix lint error in downtream change (#343) This fixes the PR #334 where one additional line was in the code. This was not exposed previously as we did not had downstream CI Lint jobs. Signed-off-by: Michal Pryc --- .../udmrepo/kopialib/backend/common_kopia_algorithms_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg/repository/udmrepo/kopialib/backend/common_kopia_algorithms_test.go b/pkg/repository/udmrepo/kopialib/backend/common_kopia_algorithms_test.go index 969ea111d1..8c11961633 100644 --- a/pkg/repository/udmrepo/kopialib/backend/common_kopia_algorithms_test.go +++ b/pkg/repository/udmrepo/kopialib/backend/common_kopia_algorithms_test.go @@ -31,7 +31,6 @@ import ( ) func TestSetupNewRepoAlgorithms(t *testing.T) { - testCases := []struct { name string envVars map[string]string From dbfeb19d2e3870887e0b38c5aa3b77f4f5ea5db6 Mon Sep 17 00:00:00 2001 From: Wesley Hayutin <138787+weshayutin@users.noreply.github.com> Date: Thu, 17 Oct 2024 05:39:22 -0600 Subject: [PATCH 45/55] run oadp-operator e2e test from the velero repo (#353) * run oadp-operator e2e test from the velero repo execute openshift/oadp-operator e2e tests directly against the velero repo locally or via prow ci Signed-off-by: Wesley Hayutin * update variable names, add a cleanup * make sure env variable overrides default velero_image Signed-off-by: Wesley Hayutin * add options to build, push, and only test Signed-off-by: Wesley Hayutin * add arch to name Signed-off-by: Wesley Hayutin * remove duplicated clean/rm operator checkout * simplify by dropping export var and use a oneliner Co-authored-by: Tiger Kaovilai * drop export and use oneliner Co-authored-by: Tiger Kaovilai * just in case, allow oadp to be deployed from makefile Signed-off-by: Wesley Hayutin * Update Makefile.prow Co-authored-by: Tiger Kaovilai --------- Signed-off-by: Wesley Hayutin Co-authored-by: Tiger Kaovilai --- Makefile.prow | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/Makefile.prow b/Makefile.prow index 1b00872675..88aa9d5715 100644 --- a/Makefile.prow +++ b/Makefile.prow @@ -19,6 +19,17 @@ GOPATH := $(shell go env GOPATH) GOBIN := $(GOPATH)/bin GOSRC := $(GOPATH)/src +# Prow settings for e2e tests +OADP_E2E_DIR := /tmp/oadp-operator +OADP_E2E_BRANCH := master +VELERO_IMAGE ?= quay.io/konveyor/velero:latest +CLUSTER_ARCH ?= $(shell oc get nodes -o jsonpath='{.items[0].status.nodeInfo.architecture}') +CLUSTER_OS ?= $(shell oc get node -o jsonpath='{.items[0].status.nodeInfo.operatingSystem}') +DOCKER_BUILD_ARGS = --platform=$(CLUSTER_OS)/$(CLUSTER_ARCH) +GINKGO_ARGS ?= "" # by default (empty) run all tests, otherwise specify a test to run +LOCAL_BUILT_IMAGE=ttl.sh/velero-$(CLUSTER_ARCH)-$(shell git rev-parse --short HEAD):1h + + # upstream ci target: verify-modules verify all test # we need to modify verify, test, all to avoid usage of docker CLI @@ -88,3 +99,50 @@ $(GOBIN)/golangci-lint: $(GOBIN)/setup-envtest: @echo "Installing envtest tools" go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest + +.PHONY: clone-oadp-operator +clone-oadp-operator: clean-oadp-operator + @echo "Cloning oadp-operator" + git clone --depth 1 --single-branch --branch $(OADP_E2E_BRANCH) https://github.com/openshift/oadp-operator.git $(OADP_E2E_DIR) + +.PHONY: clean-oadp-operator +clean-oadp-operator: + @echo "Cleaning oadp-operator" + rm -rf $(OADP_E2E_DIR) + +# build the Dockerfile.ubi +.PHONY: build +build: + @echo "Building Dockerfile.ubi with tag: $(LOCAL_BUILT_IMAGE)" + docker build -t $(LOCAL_BUILT_IMAGE) -f Dockerfile.ubi . $(DOCKER_BUILD_ARGS) + +# push the image to ttl.sh +.PHONY: push +push: + @echo "Pushing image: $(LOCAL_BUILT_IMAGE)" + docker push $(LOCAL_BUILT_IMAGE) + +# deploy oadp-operator, potentially used by prow jobs +.PHONY: deploy-olm +deploy-olm: clone-oadp-operator + @echo "Deploying oadp-operator" + pushd $(OADP_E2E_DIR) && make deploy-olm && popd + +# test-e2e is to be used by prow. +.PHONY: test-e2e +test-e2e: clone-oadp-operator + @echo "Running oadp-operator e2e tests" + pushd $(OADP_E2E_DIR) && VELERO_IMAGE=$(VELERO_IMAGE) make test-e2e && popd + +# build and test locally +.PHONY: local-build-test-e2e +local-build-test-e2e: build push clone-oadp-operator + @echo "Building Velero and Running oadp-operator e2e tests locally" + pushd $(OADP_E2E_DIR) && VELERO_IMAGE=$(LOCAL_BUILT_IMAGE) OPENSHIFT_CI=false make test-e2e && popd + +# to run just one test, export GINKGO_ARGS="--ginkgo.focus='MySQL application CSI'" +# do NOT build, test locally +.PHONY: local-test-e2e +local-test-e2e: clone-oadp-operator + @echo "Running oadp-operator e2e tests locally" + pushd $(OADP_E2E_DIR) && VELERO_IMAGE=$(LOCAL_BUILT_IMAGE) OPENSHIFT_CI=false GINKGO_ARGS=$(GINKGO_ARGS) make test-e2e && popd \ No newline at end of file From 8145c80ed3c691464803eb72d5a05e12851a745b Mon Sep 17 00:00:00 2001 From: Tiger Kaovilai Date: Thu, 13 Mar 2025 09:53:47 -0500 Subject: [PATCH 46/55] DS Owners --- DOWNSTREAM_OWNERS | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 DOWNSTREAM_OWNERS diff --git a/DOWNSTREAM_OWNERS b/DOWNSTREAM_OWNERS new file mode 100644 index 0000000000..e812b19e6d --- /dev/null +++ b/DOWNSTREAM_OWNERS @@ -0,0 +1,17 @@ +approvers: + - jwmatthews + - sseago + - jmontleon + - shawn-hurley + - rayfordj + - dymurray + - shubham-pampattiwar + - kaovilai + - eemcmullan + - savitharaghunathan +reviewers: + - sseago + - shubham-pampattiwar + - kaovilai + - eemcmullan + - savitharaghunathan From be04120fed405932c6479879eea906af61e9096b Mon Sep 17 00:00:00 2001 From: Scott Seago Date: Thu, 13 Mar 2025 12:03:06 -0400 Subject: [PATCH 47/55] updated controller-gen version --- Makefile.prow | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.prow b/Makefile.prow index 88aa9d5715..dcdbae18c4 100644 --- a/Makefile.prow +++ b/Makefile.prow @@ -10,7 +10,7 @@ # Configuration Variables GOFLAGS := -mod=mod -CONGEN_VERSION := 0.14.0 +CONGEN_VERSION := 0.16.5 CODEGEN_VERSION := 0.22.2 PROWBIN := /tmp/prowbin @@ -145,4 +145,4 @@ local-build-test-e2e: build push clone-oadp-operator .PHONY: local-test-e2e local-test-e2e: clone-oadp-operator @echo "Running oadp-operator e2e tests locally" - pushd $(OADP_E2E_DIR) && VELERO_IMAGE=$(LOCAL_BUILT_IMAGE) OPENSHIFT_CI=false GINKGO_ARGS=$(GINKGO_ARGS) make test-e2e && popd \ No newline at end of file + pushd $(OADP_E2E_DIR) && VELERO_IMAGE=$(LOCAL_BUILT_IMAGE) OPENSHIFT_CI=false GINKGO_ARGS=$(GINKGO_ARGS) make test-e2e && popd From a33bea5f5f8274d0d3712769de073e6d40aa50f9 Mon Sep 17 00:00:00 2001 From: Scott Seago Date: Tue, 1 Apr 2025 15:11:50 -0400 Subject: [PATCH 48/55] Include velero-restore-helper binary in velero image (#374) --- Dockerfile.ubi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile.ubi b/Dockerfile.ubi index 4b2f524849..45f8eeae1f 100644 --- a/Dockerfile.ubi +++ b/Dockerfile.ubi @@ -10,6 +10,7 @@ COPY . /go/src/github.com/vmware-tanzu/velero WORKDIR /go/src/github.com/vmware-tanzu/velero RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -mod=mod -ldflags '-extldflags "-static" -X github.com/vmware-tanzu/velero/pkg/buildinfo.Version=konveyor-dev' -o /go/src/velero github.com/vmware-tanzu/velero/cmd/velero +RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -mod=mod -ldflags '-extldflags "-static"' -o /go/src/velero-restore-helper github.com/vmware-tanzu/velero/cmd/velero-restore-helper RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -mod=mod -ldflags '-extldflags "-static"' -o /go/src/velero-helper github.com/vmware-tanzu/velero/cmd/velero-helper FROM --platform=$BUILDPLATFORM quay.io/konveyor/builder:ubi9-latest AS restic-builder @@ -30,6 +31,7 @@ RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -mod= FROM registry.access.redhat.com/ubi9-minimal RUN microdnf -y update && microdnf -y install nmap-ncat && microdnf -y reinstall tzdata && microdnf clean all COPY --from=builder /go/src/velero velero +COPY --from=builder /go/src/velero-restore-helper velero-restore-helper COPY --from=builder /go/src/velero-helper velero-helper COPY --from=restic-builder /opt/app-root/src/restic /usr/bin/restic From 11ecfd45744f6406a5bc954d967008fa8a393439 Mon Sep 17 00:00:00 2001 From: Scott Seago Date: Tue, 19 Aug 2025 17:30:17 -0400 Subject: [PATCH 49/55] Fix restic checkout in Dockerfile.ubi to get default branch (#436) Signed-off-by: Scott Seago --- Dockerfile.ubi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile.ubi b/Dockerfile.ubi index 45f8eeae1f..fadb930fb3 100644 --- a/Dockerfile.ubi +++ b/Dockerfile.ubi @@ -22,7 +22,7 @@ ENV GOPATH=$APP_ROOT RUN mkdir -p $APP_ROOT/src/github.com/restic \ && cd $APP_ROOT/src/github.com/restic \ - && git clone https://github.com/konveyor/restic -b konveyor-dev + && git clone https://github.com/openshift/restic WORKDIR $APP_ROOT/src/github.com/restic/restic From b2df20309a6c4aff3c542f51197a8b71092910cb Mon Sep 17 00:00:00 2001 From: oadp-team-rebase-bot Date: Fri, 12 Sep 2025 12:55:57 +0200 Subject: [PATCH 50/55] UPSTREAM: : Updating go modules --- go.mod | 2 +- go.sum | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 388bdde67d..27129651d5 100644 --- a/go.mod +++ b/go.mod @@ -198,4 +198,4 @@ require ( sigs.k8s.io/structured-merge-diff/v4 v4.6.0 // indirect ) -replace github.com/kopia/kopia => github.com/project-velero/kopia v0.0.0-20251230033609-d946b1e75197 +replace github.com/kopia/kopia => github.com/migtools/kopia v0.0.0-20250814081930-848859b500ac diff --git a/go.sum b/go.sum index 7167cd1ea6..96d81ea4fb 100644 --- a/go.sum +++ b/go.sum @@ -533,8 +533,10 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/minio/crc64nvme v1.1.0 h1:e/tAguZ+4cw32D+IO/8GSf5UVr9y+3eJcxZI2WOO/7Q= -github.com/minio/crc64nvme v1.1.0/go.mod h1:eVfm2fAzLlxMdUGc0EEBGSMmPwmXD5XiNRpnu9J3bvg= +github.com/migtools/kopia v0.0.0-20250814081930-848859b500ac h1:vKTxg91LDteSvyGRA67Yd+n9nj9mknFX7KgDSs+eZrk= +github.com/migtools/kopia v0.0.0-20250814081930-848859b500ac/go.mod h1:qlSnPHrsV8eEeU4l4zqEw8mJ5CUeXr7PDiJNI4r4Bus= +github.com/minio/crc64nvme v1.0.1 h1:DHQPrYPdqK7jQG/Ls5CTBZWeex/2FMS3G5XGkycuFrY= +github.com/minio/crc64nvme v1.0.1/go.mod h1:eVfm2fAzLlxMdUGc0EEBGSMmPwmXD5XiNRpnu9J3bvg= github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34= github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM= github.com/minio/minio-go/v7 v7.0.97 h1:lqhREPyfgHTB/ciX8k2r8k0D93WaFqxbJX36UZq5occ= @@ -615,8 +617,6 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= -github.com/project-velero/kopia v0.0.0-20251230033609-d946b1e75197 h1:iGkfuELGvFCqW+zcrhf2GsOwNH1nWYBsC69IOc57KJk= -github.com/project-velero/kopia v0.0.0-20251230033609-d946b1e75197/go.mod h1:RL4KehCNKEIDNltN7oruSa3ldwBNVPmQbwmN3Schbjc= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.23.2 h1:Je96obch5RDVy3FDMndoUsjAhG5Edi49h0RJWRi/o0o= From d05cde3eac35184f3f619d439ace4f2265f1674e Mon Sep 17 00:00:00 2001 From: oadp-team-rebase-bot Date: Fri, 12 Sep 2025 12:56:03 +0200 Subject: [PATCH 51/55] UPSTREAM: : update restic @ 8c4c3fbfe (branch oadp-dev) --- .gitmodules | 4 ++++ restic | 1 + 2 files changed, 5 insertions(+) create mode 100644 .gitmodules create mode 160000 restic diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000000..421c20dea9 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "restic"] + path = restic + url = https://github.com/openshift/restic + branch = oadp-dev diff --git a/restic b/restic new file mode 160000 index 0000000000..8c4c3fbfe0 --- /dev/null +++ b/restic @@ -0,0 +1 @@ +Subproject commit 8c4c3fbfe03e831fe1e81bb8ec486aae94bfeabb From eb44257ec4ccdb1507f669130653022f884671c8 Mon Sep 17 00:00:00 2001 From: oadp-team-rebase-bot Date: Fri, 12 Sep 2025 13:01:11 +0200 Subject: [PATCH 52/55] UPSTREAM: Use context from test for the kopia algorithms Fixes linting error. Signed-off-by: oadp-team-rebase-bot --- .../udmrepo/kopialib/backend/common_kopia_algorithms_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/repository/udmrepo/kopialib/backend/common_kopia_algorithms_test.go b/pkg/repository/udmrepo/kopialib/backend/common_kopia_algorithms_test.go index 8c11961633..7dddf0e43f 100644 --- a/pkg/repository/udmrepo/kopialib/backend/common_kopia_algorithms_test.go +++ b/pkg/repository/udmrepo/kopialib/backend/common_kopia_algorithms_test.go @@ -17,7 +17,6 @@ limitations under the License. package backend import ( - "context" "testing" "github.com/kopia/kopia/repo" @@ -152,7 +151,7 @@ func TestSetupNewRepoAlgorithms(t *testing.T) { for key, value := range tc.envVars { t.Setenv(key, value) } - ret := SetupNewRepositoryOptions(context.Background(), tc.flags) + ret := SetupNewRepositoryOptions(t.Context(), tc.flags) assert.Equal(t, tc.expected, ret) }) } From 47a6d55fd81caee0425bc0f3ed538b247d131a4a Mon Sep 17 00:00:00 2001 From: oadp-team-rebase-bot Date: Thu, 12 Feb 2026 02:12:14 +0000 Subject: [PATCH 53/55] UPSTREAM: : Updating go modules --- go.mod | 2 +- go.sum | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 27129651d5..ad037372bc 100644 --- a/go.mod +++ b/go.mod @@ -198,4 +198,4 @@ require ( sigs.k8s.io/structured-merge-diff/v4 v4.6.0 // indirect ) -replace github.com/kopia/kopia => github.com/migtools/kopia v0.0.0-20250814081930-848859b500ac +replace github.com/kopia/kopia => github.com/migtools/kopia v0.0.0-20260211121325-b68c22afd36d diff --git a/go.sum b/go.sum index 96d81ea4fb..2be6a56e4d 100644 --- a/go.sum +++ b/go.sum @@ -533,10 +533,10 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/migtools/kopia v0.0.0-20250814081930-848859b500ac h1:vKTxg91LDteSvyGRA67Yd+n9nj9mknFX7KgDSs+eZrk= -github.com/migtools/kopia v0.0.0-20250814081930-848859b500ac/go.mod h1:qlSnPHrsV8eEeU4l4zqEw8mJ5CUeXr7PDiJNI4r4Bus= -github.com/minio/crc64nvme v1.0.1 h1:DHQPrYPdqK7jQG/Ls5CTBZWeex/2FMS3G5XGkycuFrY= -github.com/minio/crc64nvme v1.0.1/go.mod h1:eVfm2fAzLlxMdUGc0EEBGSMmPwmXD5XiNRpnu9J3bvg= +github.com/migtools/kopia v0.0.0-20260211121325-b68c22afd36d h1:kkllNsWVL/W60AYZDV8V0yLMBQtZJZNTmAeiIXPRCYs= +github.com/migtools/kopia v0.0.0-20260211121325-b68c22afd36d/go.mod h1:RL4KehCNKEIDNltN7oruSa3ldwBNVPmQbwmN3Schbjc= +github.com/minio/crc64nvme v1.1.0 h1:e/tAguZ+4cw32D+IO/8GSf5UVr9y+3eJcxZI2WOO/7Q= +github.com/minio/crc64nvme v1.1.0/go.mod h1:eVfm2fAzLlxMdUGc0EEBGSMmPwmXD5XiNRpnu9J3bvg= github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34= github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM= github.com/minio/minio-go/v7 v7.0.97 h1:lqhREPyfgHTB/ciX8k2r8k0D93WaFqxbJX36UZq5occ= From dd9cc04572e8e6cbca2c2f633e76fb1503c5b17c Mon Sep 17 00:00:00 2001 From: Michal Pryc Date: Thu, 12 Feb 2026 11:55:26 +0100 Subject: [PATCH 54/55] UPSTREAM: : Fix golangci-lint configuration for v2.x Fix golangci-lint version extraction and disable concat-loop check. Signed-off-by: Michal Pryc --- .golangci.yaml | 1 + Makefile.prow | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.golangci.yaml b/.golangci.yaml index 7ab8bdeaf4..505f1e01aa 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -196,6 +196,7 @@ linters: sprintf1: false errorf: false int-conversion: true + concat-loop: false revive: rules: diff --git a/Makefile.prow b/Makefile.prow index dcdbae18c4..4697b22db7 100644 --- a/Makefile.prow +++ b/Makefile.prow @@ -92,7 +92,7 @@ $(GOBIN)/controller-gen: $(GOBIN)/golangci-lint: @echo "Extracting golangci-lint version from hack/build-image/Dockerfile" - GOLANGCI_VERSION=$$(grep -oP 'golangci-lint/master/install.sh.*\Kv[0-9]+\.[0-9]+\.[0-9]+' hack/build-image/Dockerfile); \ + GOLANGCI_VERSION=$$(grep -oP 'golangci-lint/(master|HEAD)/install.sh.*\Kv[0-9]+\.[0-9]+\.[0-9]+' hack/build-image/Dockerfile); \ echo "Installing golangci-lint version: $$GOLANGCI_VERSION"; \ curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOBIN) $$GOLANGCI_VERSION From 26e68c0609960ad6a1c855799f16c40c7e8d3901 Mon Sep 17 00:00:00 2001 From: oadp-team-rebase-bot Date: Tue, 10 Mar 2026 10:22:11 +0100 Subject: [PATCH 55/55] UPSTREAM: : Fix malformed unicode characters in filenames --- .../unreleased/9533-Lyndon-Li | 0 .../unreleased/9560-Lyndon-Li | 0 .../unreleased/9561-Lyndon-Li | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename "changelogs/unreleased/9533-Lyndon-Li\342\200\216\342\200\216" => changelogs/unreleased/9533-Lyndon-Li (100%) rename "changelogs/unreleased/9560-Lyndon-Li\342\200\216\342\200\216" => changelogs/unreleased/9560-Lyndon-Li (100%) rename "changelogs/unreleased/9561-Lyndon-Li\342\200\216\342\200\216" => changelogs/unreleased/9561-Lyndon-Li (100%) diff --git "a/changelogs/unreleased/9533-Lyndon-Li\342\200\216\342\200\216" b/changelogs/unreleased/9533-Lyndon-Li similarity index 100% rename from "changelogs/unreleased/9533-Lyndon-Li\342\200\216\342\200\216" rename to changelogs/unreleased/9533-Lyndon-Li diff --git "a/changelogs/unreleased/9560-Lyndon-Li\342\200\216\342\200\216" b/changelogs/unreleased/9560-Lyndon-Li similarity index 100% rename from "changelogs/unreleased/9560-Lyndon-Li\342\200\216\342\200\216" rename to changelogs/unreleased/9560-Lyndon-Li diff --git "a/changelogs/unreleased/9561-Lyndon-Li\342\200\216\342\200\216" b/changelogs/unreleased/9561-Lyndon-Li similarity index 100% rename from "changelogs/unreleased/9561-Lyndon-Li\342\200\216\342\200\216" rename to changelogs/unreleased/9561-Lyndon-Li