From f9d656e2bdf36a6b73f0453ddba74cffc71a8613 Mon Sep 17 00:00:00 2001 From: Eliyam Levy Date: Tue, 10 Jan 2023 14:01:47 -0500 Subject: [PATCH 1/2] Added resourceSelector for secrets with resources.cattle.io/backup label --- .../files/default-resourceset-contents/rancher.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/charts/rancher-backup/files/default-resourceset-contents/rancher.yaml b/charts/rancher-backup/files/default-resourceset-contents/rancher.yaml index ba681c5b..1ee2c3e8 100644 --- a/charts/rancher-backup/files/default-resourceset-contents/rancher.yaml +++ b/charts/rancher-backup/files/default-resourceset-contents/rancher.yaml @@ -52,3 +52,11 @@ kindsRegexp: "^clusterrepos$" - apiVersion: "resources.cattle.io/v1" kindsRegexp: "^ResourceSet$" +- apiVersion: "v1" + kindsRegexp: "^secrets$" + namespaceRegexp: "^.*$" + labelSelectors: + matchExpressions: + - key: "resources.cattle.io/backup" + operator: "In" + values: ["true"] From e4f54f891871c68e39170c5dae6515e2d9998502 Mon Sep 17 00:00:00 2001 From: Eliyam Levy Date: Tue, 10 Jan 2023 16:03:11 -0500 Subject: [PATCH 2/2] go generate --- pkg/apis/resources.cattle.io/v1/doc.go | 2 +- pkg/apis/resources.cattle.io/v1/zz_generated_deepcopy.go | 2 +- pkg/apis/resources.cattle.io/v1/zz_generated_list_types.go | 2 +- pkg/apis/resources.cattle.io/v1/zz_generated_register.go | 2 +- pkg/apis/resources.cattle.io/zz_generated_register.go | 2 +- pkg/generated/controllers/resources.cattle.io/factory.go | 2 +- pkg/generated/controllers/resources.cattle.io/interface.go | 2 +- pkg/generated/controllers/resources.cattle.io/v1/backup.go | 2 +- pkg/generated/controllers/resources.cattle.io/v1/interface.go | 2 +- pkg/generated/controllers/resources.cattle.io/v1/resourceset.go | 2 +- pkg/generated/controllers/resources.cattle.io/v1/restore.go | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/pkg/apis/resources.cattle.io/v1/doc.go b/pkg/apis/resources.cattle.io/v1/doc.go index 66cb81b7..8827d09b 100644 --- a/pkg/apis/resources.cattle.io/v1/doc.go +++ b/pkg/apis/resources.cattle.io/v1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2022 Rancher Labs, Inc. +Copyright 2023 Rancher Labs, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/apis/resources.cattle.io/v1/zz_generated_deepcopy.go b/pkg/apis/resources.cattle.io/v1/zz_generated_deepcopy.go index f142f6cd..576c0c7a 100644 --- a/pkg/apis/resources.cattle.io/v1/zz_generated_deepcopy.go +++ b/pkg/apis/resources.cattle.io/v1/zz_generated_deepcopy.go @@ -2,7 +2,7 @@ // +build !ignore_autogenerated /* -Copyright 2022 Rancher Labs, Inc. +Copyright 2023 Rancher Labs, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/apis/resources.cattle.io/v1/zz_generated_list_types.go b/pkg/apis/resources.cattle.io/v1/zz_generated_list_types.go index 67096c3d..1b468bbe 100644 --- a/pkg/apis/resources.cattle.io/v1/zz_generated_list_types.go +++ b/pkg/apis/resources.cattle.io/v1/zz_generated_list_types.go @@ -1,5 +1,5 @@ /* -Copyright 2022 Rancher Labs, Inc. +Copyright 2023 Rancher Labs, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/apis/resources.cattle.io/v1/zz_generated_register.go b/pkg/apis/resources.cattle.io/v1/zz_generated_register.go index dc831e19..66fbd2fd 100644 --- a/pkg/apis/resources.cattle.io/v1/zz_generated_register.go +++ b/pkg/apis/resources.cattle.io/v1/zz_generated_register.go @@ -1,5 +1,5 @@ /* -Copyright 2022 Rancher Labs, Inc. +Copyright 2023 Rancher Labs, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/apis/resources.cattle.io/zz_generated_register.go b/pkg/apis/resources.cattle.io/zz_generated_register.go index af6d3893..f6083f25 100644 --- a/pkg/apis/resources.cattle.io/zz_generated_register.go +++ b/pkg/apis/resources.cattle.io/zz_generated_register.go @@ -1,5 +1,5 @@ /* -Copyright 2022 Rancher Labs, Inc. +Copyright 2023 Rancher Labs, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/generated/controllers/resources.cattle.io/factory.go b/pkg/generated/controllers/resources.cattle.io/factory.go index 4f79deb5..0a8a8f78 100644 --- a/pkg/generated/controllers/resources.cattle.io/factory.go +++ b/pkg/generated/controllers/resources.cattle.io/factory.go @@ -1,5 +1,5 @@ /* -Copyright 2022 Rancher Labs, Inc. +Copyright 2023 Rancher Labs, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/generated/controllers/resources.cattle.io/interface.go b/pkg/generated/controllers/resources.cattle.io/interface.go index 6ad2cc5b..a7d03344 100644 --- a/pkg/generated/controllers/resources.cattle.io/interface.go +++ b/pkg/generated/controllers/resources.cattle.io/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2022 Rancher Labs, Inc. +Copyright 2023 Rancher Labs, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/generated/controllers/resources.cattle.io/v1/backup.go b/pkg/generated/controllers/resources.cattle.io/v1/backup.go index 019fa56a..a5059846 100644 --- a/pkg/generated/controllers/resources.cattle.io/v1/backup.go +++ b/pkg/generated/controllers/resources.cattle.io/v1/backup.go @@ -1,5 +1,5 @@ /* -Copyright 2022 Rancher Labs, Inc. +Copyright 2023 Rancher Labs, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/generated/controllers/resources.cattle.io/v1/interface.go b/pkg/generated/controllers/resources.cattle.io/v1/interface.go index f792d4f2..7dc12f39 100644 --- a/pkg/generated/controllers/resources.cattle.io/v1/interface.go +++ b/pkg/generated/controllers/resources.cattle.io/v1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2022 Rancher Labs, Inc. +Copyright 2023 Rancher Labs, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/generated/controllers/resources.cattle.io/v1/resourceset.go b/pkg/generated/controllers/resources.cattle.io/v1/resourceset.go index 16680db9..e817915a 100644 --- a/pkg/generated/controllers/resources.cattle.io/v1/resourceset.go +++ b/pkg/generated/controllers/resources.cattle.io/v1/resourceset.go @@ -1,5 +1,5 @@ /* -Copyright 2022 Rancher Labs, Inc. +Copyright 2023 Rancher Labs, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/generated/controllers/resources.cattle.io/v1/restore.go b/pkg/generated/controllers/resources.cattle.io/v1/restore.go index df168b6d..e2905591 100644 --- a/pkg/generated/controllers/resources.cattle.io/v1/restore.go +++ b/pkg/generated/controllers/resources.cattle.io/v1/restore.go @@ -1,5 +1,5 @@ /* -Copyright 2022 Rancher Labs, Inc. +Copyright 2023 Rancher Labs, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.