diff --git a/go.mod b/go.mod index 16105dd87..3ff7c10c7 100644 --- a/go.mod +++ b/go.mod @@ -27,8 +27,8 @@ require ( kmodules.xyz/client-go v0.34.3 kmodules.xyz/custom-resources v0.34.0 kmodules.xyz/monitoring-agent-api v0.34.1 - kubedb.dev/apimachinery v0.61.0 - kubedb.dev/db-client-go v0.16.0 + kubedb.dev/apimachinery v0.62.0 + kubedb.dev/db-client-go v0.17.0 kubeops.dev/petset v0.0.15 sigs.k8s.io/controller-runtime v0.22.4 sigs.k8s.io/yaml v1.6.0 @@ -151,7 +151,7 @@ require ( gomodules.xyz/jsonpatch/v2 v2.5.0 // indirect gomodules.xyz/mergo v0.3.13 // indirect gomodules.xyz/password-generator v0.2.9 // indirect - gomodules.xyz/restic v0.1.0 // indirect + gomodules.xyz/restic v0.2.0 // indirect gomodules.xyz/sets v0.2.1 // indirect gomodules.xyz/sync v0.1.0 // indirect gomodules.xyz/wait v0.2.0 // indirect @@ -173,8 +173,8 @@ require ( kubeops.dev/csi-driver-cacerts v0.5.0 // indirect kubeops.dev/operator-shard-manager v0.0.5 // indirect kubeops.dev/sidekick v0.0.12 // indirect - kubestash.dev/apimachinery v0.24.0 // indirect - open-cluster-management.io/api v1.1.1-0.20251222023835-510285203ee6 // indirect + kubestash.dev/apimachinery v0.25.0 // indirect + open-cluster-management.io/api v1.2.0 // indirect sigs.k8s.io/gateway-api v1.4.0 // indirect sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect sigs.k8s.io/kustomize/api v0.20.1 // indirect diff --git a/go.sum b/go.sum index 7326cd9c3..fde70a9f9 100644 --- a/go.sum +++ b/go.sum @@ -643,8 +643,8 @@ gomodules.xyz/password-generator v0.2.9 h1:qYoXoA61+9zs9A1scffefCgcRGpi9Tw1LsTkI gomodules.xyz/password-generator v0.2.9/go.mod h1:TvwYYTx9+P1pPwKQKfZgB/wr2Id9MqAQ3B5auY7reNg= gomodules.xyz/pointer v0.1.0 h1:sG2UKrYVSo6E3r4itAjXfPfe4fuXMi0KdyTHpR3vGCg= gomodules.xyz/pointer v0.1.0/go.mod h1:sPLsC0+yLTRecUiC5yVlyvXhZ6LAGojNCRWNNqoplvo= -gomodules.xyz/restic v0.1.0 h1:CWf2yxPqM6VeNj57ao1QSxrUDEjziv9ewl7YnKe3eB8= -gomodules.xyz/restic v0.1.0/go.mod h1:Api8DksK5irIRJGjnxt7wSxsJ6AsSu3i97bQVRaQ5zs= +gomodules.xyz/restic v0.2.0 h1:6caROiG5Q8s8/ZTcQTnUgSmZXUhrKobMYzs9o9NS+CE= +gomodules.xyz/restic v0.2.0/go.mod h1:Api8DksK5irIRJGjnxt7wSxsJ6AsSu3i97bQVRaQ5zs= gomodules.xyz/runtime v0.3.0 h1:Fgf3fjIE3xY/sswO73iRBeR3mundZAjlY42fQPigPR0= gomodules.xyz/runtime v0.3.0/go.mod h1:lJuiayVYjz8LWDwKhbDqFzUrXqr1btLbJS5/lKDz1YU= gomodules.xyz/sets v0.2.0/go.mod h1:jKgNp01/iDs+svOWXaPk5cKP3VXy0mWUoTF/ore+aMc= @@ -752,10 +752,10 @@ kmodules.xyz/prober v0.34.0 h1:ElZkZYCjLaytAA0M8EH42To7i9gh1IIX+d0qfaIohys= kmodules.xyz/prober v0.34.0/go.mod h1:rsu/fxxfNxY70GDbH6Ju8G66459hi7AhWSSBoiIp8ic= kmodules.xyz/resource-metadata v0.42.4 h1:nFVo+PKmwWdzVwk7U3VZuKBQj3tPo6fyY5BC7gE2OB8= kmodules.xyz/resource-metadata v0.42.4/go.mod h1:++18wSB28Wrw3ZxnOd8o8IVg7oMyWPwaPfuLw21QnPc= -kubedb.dev/apimachinery v0.61.0 h1:gYI8RFr6W9k9+961fwoWz/6DVGmX0NwPXlTzPBYKxB4= -kubedb.dev/apimachinery v0.61.0/go.mod h1:LaumaEPYGkieolZcvmT75qqZxKbcN0mZ4xIuA85TZaY= -kubedb.dev/db-client-go v0.16.0 h1:mvlFoVQfyvzxegVHz07IXbzhTDdYOTz3zsm3PJZ//PE= -kubedb.dev/db-client-go v0.16.0/go.mod h1:W4tETd5ZYrVL5fFM0Kn2uF2wyLWMgllnMqfJADu3Gak= +kubedb.dev/apimachinery v0.62.0 h1:itdRIV6cQ9w8qbYFYyuJHSbmpNk2nR+MAiXTsMBca3g= +kubedb.dev/apimachinery v0.62.0/go.mod h1:O9Lo4Trr/HWs4OX/iLbGJEnD9pev0b6tcTPbjRCjh1A= +kubedb.dev/db-client-go v0.17.0 h1:wmdXM+3zp9hjyq8isCNhHtG4nbCJ7YFgxNtov32mhLk= +kubedb.dev/db-client-go v0.17.0/go.mod h1:3U2oKDZZyWtVjet4mqtPBPDEDsCdcurgQYN+lJzc4mU= kubeops.dev/csi-driver-cacerts v0.5.0 h1:WaKfoIyh7rx9rNZ65wJ3GkzhECkOjxd9dcO0iEx3xKU= kubeops.dev/csi-driver-cacerts v0.5.0/go.mod h1:VNbwC3gTWfmdQCVxd8mkVx+n1+0F1lOA5X3usyZN1rk= kubeops.dev/operator-shard-manager v0.0.5 h1:i7VnyUfIa9u3RQhSTVWNsooXcgmrWWxJyI9gJ10onE8= @@ -764,10 +764,10 @@ kubeops.dev/petset v0.0.15 h1:iwTRFAp0RNw0A87sw2c97UZ6WIA9H/nhJBpDhXLa7fk= kubeops.dev/petset v0.0.15/go.mod h1:sw96WiXfzhpmKpXj4a5AdmEHs0Bx4QMhf+iW15zY4Gg= kubeops.dev/sidekick v0.0.12 h1:pmUjQLZDKxgREiM6z0PogLR1aDbgvkE9jRjbxG6dEt0= kubeops.dev/sidekick v0.0.12/go.mod h1:RU7QH3E8DOLw15rBYlOOJSyczuwAnVVtYyZjJb00UB8= -kubestash.dev/apimachinery v0.24.0 h1:NLPLHAyN/TpPP4kA9NMQT1Lg/CTlCzBqGP/aybVdlN8= -kubestash.dev/apimachinery v0.24.0/go.mod h1:OV3Iq2tVRAW7k7LsukL+R33I5H/gfT2YddBdXo8DTjI= -open-cluster-management.io/api v1.1.1-0.20251222023835-510285203ee6 h1:mfcUKaSOYVDLzuontUOcasesbU9whNnvgrA0qf9trKs= -open-cluster-management.io/api v1.1.1-0.20251222023835-510285203ee6/go.mod h1:YcmA6SpGEekIMxdoeVIIyOaBhMA6ImWRLXP4g8n8T+4= +kubestash.dev/apimachinery v0.25.0 h1:EgseCFUAoNTi8b7SIPGYywe4CtJhApdMk8IZq01os0U= +kubestash.dev/apimachinery v0.25.0/go.mod h1:SM+G8sUhChP+zSfHvoh/S7P0CIcWvennWv770OFGfNk= +open-cluster-management.io/api v1.2.0 h1:+yeQgJiErrur5S4s205UM37EcZ2XbC9pFSm0xgV5/hU= +open-cluster-management.io/api v1.2.0/go.mod h1:YcmA6SpGEekIMxdoeVIIyOaBhMA6ImWRLXP4g8n8T+4= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= sigs.k8s.io/gateway-api v1.4.0 h1:ZwlNM6zOHq0h3WUX2gfByPs2yAEsy/EenYJB78jpQfQ= sigs.k8s.io/gateway-api v1.4.0/go.mod h1:AR5RSqciWP98OPckEjOjh2XJhAe2Na4LHyXD2FUY7Qk= diff --git a/vendor/gomodules.xyz/restic/config.go b/vendor/gomodules.xyz/restic/config.go index 97124c742..76b39ebda 100644 --- a/vendor/gomodules.xyz/restic/config.go +++ b/vendor/gomodules.xyz/restic/config.go @@ -18,6 +18,7 @@ package restic import ( "fmt" + "maps" "os" "path/filepath" "sort" @@ -234,9 +235,7 @@ func (w *ResticWrapper) Copy() *ResticWrapper { out.sh = shell.NewSession() // set values in.sh to out.sh - for k, v := range w.sh.Env { - out.sh.Env[k] = v - } + maps.Copy(out.sh.Env, w.sh.Env) // don't use same stdin, stdout, stderr for each instant to avoid data race. // out.sh.Stdin = in.sh.Stdin // out.sh.Stdout = in.sh.Stdout diff --git a/vendor/gomodules.xyz/restic/setup.go b/vendor/gomodules.xyz/restic/setup.go index e9c2bc719..39fd0395f 100644 --- a/vendor/gomodules.xyz/restic/setup.go +++ b/vendor/gomodules.xyz/restic/setup.go @@ -23,6 +23,7 @@ import ( core "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/util/errors" + "k8s.io/klog/v2" storage "kmodules.xyz/objectstore-api/api/v1" ) @@ -131,9 +132,13 @@ func (w *ResticWrapper) exportSecretKey(secret *core.Secret, key string, require } func (w *ResticWrapper) setEnvFromSecretIfExists(envs map[string]string, secret *core.Secret, key string, required bool) error { - if required && secret == nil { - return fmt.Errorf("storage Secret is Required") + if secret == nil { + if required { + return fmt.Errorf("key %s is required but storage Secret is not provided", key) + } + return nil } + klog.Infof("Setting environment variable %s from secret %s\n", key, secret.Name) v, ok := secret.Data[key] if !ok { if required { diff --git a/vendor/gomodules.xyz/restic/types.go b/vendor/gomodules.xyz/restic/types.go index da2815f21..d78c4cda1 100644 --- a/vendor/gomodules.xyz/restic/types.go +++ b/vendor/gomodules.xyz/restic/types.go @@ -83,7 +83,7 @@ type SnapshotStats struct { // ProcessingTime indicates time taken to process the target data ProcessingTime string `json:"processingTime,omitempty"` // FileStats shows statistics of files of this snapshot - FileStats FileStats `json:"fileStats,omitempty"` + FileStats FileStats `json:"fileStats"` } type FileStats struct { diff --git a/vendor/modules.txt b/vendor/modules.txt index 64c112ae3..d570bef3a 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1960,7 +1960,7 @@ gomodules.xyz/password-generator # gomodules.xyz/pointer v0.1.0 ## explicit; go 1.15 gomodules.xyz/pointer -# gomodules.xyz/restic v0.1.0 +# gomodules.xyz/restic v0.2.0 ## explicit; go 1.25 gomodules.xyz/restic # gomodules.xyz/runtime v0.3.0 @@ -2599,7 +2599,7 @@ kmodules.xyz/prober/api/v1 kmodules.xyz/resource-metadata/apis/node kmodules.xyz/resource-metadata/apis/node/v1alpha1 kmodules.xyz/resource-metadata/crds -# kubedb.dev/apimachinery v0.61.0 +# kubedb.dev/apimachinery v0.62.0 ## explicit; go 1.25.0 kubedb.dev/apimachinery/apis kubedb.dev/apimachinery/apis/archiver/v1alpha1 @@ -2650,7 +2650,7 @@ kubedb.dev/apimachinery/pkg/factory kubedb.dev/apimachinery/pkg/lib kubedb.dev/apimachinery/pkg/utils kubedb.dev/apimachinery/pkg/utils/raft -# kubedb.dev/db-client-go v0.16.0 +# kubedb.dev/db-client-go v0.17.0 ## explicit; go 1.25.5 kubedb.dev/db-client-go/elasticsearch kubedb.dev/db-client-go/redis @@ -2675,13 +2675,13 @@ kubeops.dev/petset/crds kubeops.dev/sidekick/apis/apps kubeops.dev/sidekick/apis/apps/v1alpha1 kubeops.dev/sidekick/crds -# kubestash.dev/apimachinery v0.24.0 +# kubestash.dev/apimachinery v0.25.0 ## explicit; go 1.25.0 kubestash.dev/apimachinery/apis kubestash.dev/apimachinery/apis/core/v1alpha1 kubestash.dev/apimachinery/apis/storage/v1alpha1 kubestash.dev/apimachinery/crds -# open-cluster-management.io/api v1.1.1-0.20251222023835-510285203ee6 +# open-cluster-management.io/api v1.2.0 ## explicit; go 1.25.0 open-cluster-management.io/api/work/v1 # sigs.k8s.io/controller-runtime v0.22.4 => github.com/kmodules/controller-runtime v0.22.5-0.20251227114913-f011264689cd diff --git a/vendor/open-cluster-management.io/api/work/v1/0000_00_work.open-cluster-management.io_manifestworks.crd.yaml b/vendor/open-cluster-management.io/api/work/v1/0000_00_work.open-cluster-management.io_manifestworks.crd.yaml index fbe9005f2..de71427c2 100644 --- a/vendor/open-cluster-management.io/api/work/v1/0000_00_work.open-cluster-management.io_manifestworks.crd.yaml +++ b/vendor/open-cluster-management.io/api/work/v1/0000_00_work.open-cluster-management.io_manifestworks.crd.yaml @@ -269,6 +269,14 @@ spec: - type type: object type: array + feedbackScrapeType: + default: Poll + description: FeedbackScrapeType represents the way to monitor + resource, it could be Poll or Watch + enum: + - Poll + - Watch + type: string resourceIdentifier: description: |- ResourceIdentifier represents the group, resource, name and namespace of a resoure. @@ -453,6 +461,9 @@ spec: - type type: object type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map resourceStatus: description: |- ResourceStatus represents the status of each resource in manifestwork deployed on a @@ -532,6 +543,9 @@ spec: - type type: object type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map resourceMeta: description: ResourceMeta represents the group, version, kind, name and namespace of a resoure. diff --git a/vendor/open-cluster-management.io/api/work/v1/types.go b/vendor/open-cluster-management.io/api/work/v1/types.go index 321203f5f..d45eca581 100644 --- a/vendor/open-cluster-management.io/api/work/v1/types.go +++ b/vendor/open-cluster-management.io/api/work/v1/types.go @@ -117,6 +117,12 @@ type ManifestConfigOption struct { // +listMapKey:=condition // +optional ConditionRules []ConditionRule `json:"conditionRules,omitempty"` + + // FeedbackScrapeType represents the way to monitor resource, it could be Poll or Watch + // +kubebuilder:validation:Enum=Poll;Watch + // +kubebuilder:default=Poll + // +optional + FeedbackScrapeType FeedbackScrapeType `json:"feedbackScrapeType,omitempty"` } // +kubebuilder:validation:XValidation:rule="self.type != 'CEL' || self.condition != \"\"",message="Condition is required for CEL rules" @@ -168,6 +174,17 @@ const ( CelConditionExpressionsType ConditionRuleType = "CEL" ) +// FeedbackScrapeType represents the type of method to monitor resource and feedback +type FeedbackScrapeType string + +const ( + // FeedbackPollType indicates checking resource in polling way + FeedbackPollType FeedbackScrapeType = "Poll" + + // FeedbackWatchType indicates watching resource + FeedbackWatchType FeedbackScrapeType = "Watch" +) + // ManifestWorkExecutor is the executor that applies the resources to the managed cluster. i.e. the // work agent. type ManifestWorkExecutor struct { @@ -470,6 +487,8 @@ type ManifestWorkStatus struct { // 3. Available represents workload in ManifestWork exists on the managed cluster. // 4. Degraded represents the current state of workload does not match the desired // state for a certain period. + // +listType=map + // +listMapKey=type Conditions []metav1.Condition `json:"conditions,omitempty"` // ResourceStatus represents the status of each resource in manifestwork deployed on a @@ -538,6 +557,8 @@ type ManifestCondition struct { // Conditions represents the conditions of this resource on a managed cluster. // +required + // +listType=map + // +listMapKey=type Conditions []metav1.Condition `json:"conditions"` }