Skip to content

Commit

Permalink
Update for release KubeStash@v2025.2.10 (#1397)
Browse files Browse the repository at this point in the history
ProductLine: KubeStash
Release: v2025.2.10
Signed-off-by: 1gtm <1gtm@appscode.com>
  • Loading branch information
1gtm authored Feb 11, 2025
1 parent 023d2f6 commit 00ea2f0
Show file tree
Hide file tree
Showing 23 changed files with 54 additions and 28 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ require (
k8s.io/kube-openapi v0.0.0-20240726031636-6f6746feab9c
k8s.io/metrics v0.30.2
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8
kmodules.xyz/client-go v0.30.44
kmodules.xyz/client-go v0.30.45
kmodules.xyz/crd-schema-fuzz v0.29.1
kmodules.xyz/custom-resources v0.30.0
kmodules.xyz/monitoring-agent-api v0.30.2
Expand All @@ -48,7 +48,7 @@ require (
kubeops.dev/csi-driver-cacerts v0.1.0
kubeops.dev/petset v0.0.7
kubeops.dev/sidekick v0.0.10
kubestash.dev/apimachinery v0.16.0-rc.0
kubestash.dev/apimachinery v0.16.0
sigs.k8s.io/controller-runtime v0.18.4
sigs.k8s.io/yaml v1.4.0
stash.appscode.dev/apimachinery v0.38.0
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -654,8 +654,8 @@ k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
kmodules.xyz/apiversion v0.2.0 h1:vAQYqZFm4xu4pbB1cAdHbFEPES6EQkcR4wc06xdTOWk=
kmodules.xyz/apiversion v0.2.0/go.mod h1:oPX8g8LvlPdPX3Yc5YvCzJHQnw3YF/X4/jdW0b1am80=
kmodules.xyz/client-go v0.30.44 h1:mLOBXQhvCIhdega9WoN4Px/usqobuKTT2vOPQcbGhXQ=
kmodules.xyz/client-go v0.30.44/go.mod h1:T9Kiu20wXEn65dLBQeegf4+y7oahJBR9ZJO2zGEVLIY=
kmodules.xyz/client-go v0.30.45 h1:hSjNlJoPQ86CKS8BiEbSmBkF2+yWsFjjMFISOCVJ6aA=
kmodules.xyz/client-go v0.30.45/go.mod h1:T9Kiu20wXEn65dLBQeegf4+y7oahJBR9ZJO2zGEVLIY=
kmodules.xyz/crd-schema-fuzz v0.29.1 h1:zJTlWYOrT5dsVVHW8HGcnR/vaWfxQfNh11QwTtkYpcs=
kmodules.xyz/crd-schema-fuzz v0.29.1/go.mod h1:n708z9YQqLMP2KNLQVgBcRJw1QpSWLvpNCEi+KJDOYE=
kmodules.xyz/custom-resources v0.30.0 h1:vR3CbseHMLwR4GvtcJJuRuwIV8voKqFqNii27rMcm1o=
Expand All @@ -682,8 +682,8 @@ kubeops.dev/petset v0.0.7 h1:F77BTRfUqRVO7kNc8q2oFSSviDmYBqni/osXqu0kgJ4=
kubeops.dev/petset v0.0.7/go.mod h1:lt0SZV4ohRy7RiwLNUnMoauG4lCbcRbSqhMg20rdUQg=
kubeops.dev/sidekick v0.0.10 h1:/lOT+yV920F6TTPLc7bKR9HLAG/Yx+sTRm1C7rUz744=
kubeops.dev/sidekick v0.0.10/go.mod h1:VRyiiKGiJikv/8dNCkrXfkwZCv/2HoIhkmtNurs0gcM=
kubestash.dev/apimachinery v0.16.0-rc.0 h1:J4KrLDZ5NTcwaKsWwQhQNsikSMcIGBUBKfF0NkPp03A=
kubestash.dev/apimachinery v0.16.0-rc.0/go.mod h1:JXx3GmrBhYGq2rt5JWsDOyGoyYHGEz07LuNr1GHq/uo=
kubestash.dev/apimachinery v0.16.0 h1:30ZQQEHaXgNnKFCGN7/LX1cKP/d4sqxC8z/KIBpAVDI=
kubestash.dev/apimachinery v0.16.0/go.mod h1:CnAAQXjAPFhmi41UQwCVIT8s6pv3grSSOqp2kcg0jwY=
moul.io/http2curl/v2 v2.3.1-0.20221024080105-10c404f653f7 h1:NykkTlRB+X40z86cLHdEmuoTxhNKhQebLT379b1EumA=
moul.io/http2curl/v2 v2.3.1-0.20221024080105-10c404f653f7/go.mod h1:RW4hyBjTWSYDOxapodpNEtX0g5Eb16sxklBqmd2RHcE=
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3 h1:2770sDpzrjjsAtVhSeUFseziht227YAWYHLGNM8QPwY=
Expand Down
2 changes: 1 addition & 1 deletion vendor/kmodules.xyz/client-go/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ lint: $(BUILD_DIRS)
--env GO111MODULE=on \
--env GOFLAGS="-mod=vendor" \
$(BUILD_IMAGE) \
golangci-lint run --enable $(ADDTL_LINTERS) --timeout=10m --skip-files="generated.*\.go$\" --skip-dirs-use-default
golangci-lint run --enable $(ADDTL_LINTERS) --timeout=10m --exclude-files="generated.*\.go$\" --exclude-dirs-use-default

$(BUILD_DIRS):
@mkdir -p $@
Expand Down
1 change: 0 additions & 1 deletion vendor/kmodules.xyz/client-go/apiextensions/v1/crd.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ func TryUpdateCustomResourceDefinition(
klog.Errorf("Attempt %d failed to update CustomResourceDefinition %s due to %v.", attempt, cur.Name, e2)
return false, nil
})

if err != nil {
err = errors.Errorf("failed to update CustomResourceDefinition %s after %d attempts due to %v", name, attempt, err)
}
Expand Down
1 change: 0 additions & 1 deletion vendor/kmodules.xyz/client-go/apps/v1/daemonset.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ func TryUpdateDaemonSet(ctx context.Context, c kubernetes.Interface, meta metav1
klog.Errorf("Attempt %d failed to update DaemonSet %s/%s due to %v.", attempt, cur.Namespace, cur.Name, e2)
return false, nil
})

if err != nil {
err = errors.Errorf("failed to update DaemonSet %s/%s after %d attempts due to %v", meta.Namespace, meta.Name, attempt, err)
}
Expand Down
1 change: 0 additions & 1 deletion vendor/kmodules.xyz/client-go/apps/v1/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ func TryUpdateDeployment(ctx context.Context, c kubernetes.Interface, meta metav
klog.Errorf("Attempt %d failed to update Deployment %s/%s due to %v.", attempt, cur.Namespace, cur.Name, e2)
return false, nil
})

if err != nil {
err = errors.Errorf("failed to update Deployment %s/%s after %d attempts due to %v", meta.Namespace, meta.Name, attempt, err)
}
Expand Down
1 change: 0 additions & 1 deletion vendor/kmodules.xyz/client-go/apps/v1/replicaset.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ func TryUpdateReplicaSet(ctx context.Context, c kubernetes.Interface, meta metav
klog.Errorf("Attempt %d failed to update ReplicaSet %s/%s due to %v.", attempt, cur.Namespace, cur.Name, e2)
return false, nil
})

if err != nil {
err = errors.Errorf("failed to update ReplicaSet %s/%s after %d attempts due to %v", meta.Namespace, meta.Name, attempt, err)
}
Expand Down
1 change: 0 additions & 1 deletion vendor/kmodules.xyz/client-go/apps/v1/statefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ func TryUpdateStatefulSet(ctx context.Context, c kubernetes.Interface, meta meta
klog.Errorf("Attempt %d failed to update StatefulSet %s/%s due to %v.", attempt, cur.Namespace, cur.Name, e2)
return false, nil
})

if err != nil {
err = errors.Errorf("failed to update StatefulSet %s/%s after %d attempts due to %v", meta.Namespace, meta.Name, attempt, err)
}
Expand Down
45 changes: 45 additions & 0 deletions vendor/kmodules.xyz/client-go/cluster/ocm.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,16 @@ package cluster

import (
"context"
"fmt"
"strings"

kmapi "kmodules.xyz/client-go/api/v1"

core "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/meta"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apiserver/pkg/authentication/user"
"sigs.k8s.io/controller-runtime/pkg/client"
)

Expand Down Expand Up @@ -53,3 +59,42 @@ func IsOpenClusterMulticlusterControlplane(mapper meta.RESTMapper) bool {
}
return IsOpenClusterHub(mapper) && missingDeployment
}

type ClientOrgResult struct {
IsClientOrg bool
OrgID string
Namespace core.Namespace
}

func IsClientOrgMember(kc client.Client, user user.Info) (*ClientOrgResult, error) {
orgs, exists := user.GetExtra()[kmapi.AceOrgIDKey]
if !exists || len(orgs) == 0 {
return &ClientOrgResult{}, nil
}
if len(orgs) > 1 {
return nil, fmt.Errorf("user %s associated with multiple orgs %v", user.GetName(), orgs)
}

var list core.NamespaceList
if err := kc.List(context.TODO(), &list, client.MatchingLabels{
kmapi.ClientOrgKey: "true",
}); err != nil {
return nil, err
}

for _, ns := range list.Items {
if ns.Annotations[kmapi.AceOrgIDKey] == orgs[0] {
return &ClientOrgResult{
IsClientOrg: true,
OrgID: orgs[0],
Namespace: ns,
}, nil
}
}
return &ClientOrgResult{}, nil
}

func ClientDashboardTitle(title string) string {
title = strings.TrimPrefix(title, "KubeDB /")
return strings.TrimSpace(title)
}
1 change: 0 additions & 1 deletion vendor/kmodules.xyz/client-go/core/v1/configmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ func TryUpdateConfigMap(ctx context.Context, c kubernetes.Interface, meta metav1
klog.Errorf("Attempt %d failed to update ConfigMap %s/%s due to %v.", attempt, cur.Namespace, cur.Name, e2)
return false, nil
})

if err != nil {
err = errors.Errorf("failed to update ConfigMap %s/%s after %d attempts due to %v", meta.Namespace, meta.Name, attempt, err)
}
Expand Down
1 change: 0 additions & 1 deletion vendor/kmodules.xyz/client-go/core/v1/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ func TryUpdateEvent(ctx context.Context, c kubernetes.Interface, meta metav1.Obj
klog.Errorf("Attempt %d failed to update Event %s/%s due to %v.", attempt, cur.Namespace, cur.Name, e2)
return false, nil
})

if err != nil {
err = errors.Errorf("failed to update Event %s/%s after %d attempts due to %v", meta.Namespace, meta.Name, attempt, err)
}
Expand Down
1 change: 0 additions & 1 deletion vendor/kmodules.xyz/client-go/core/v1/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ func TryUpdateNode(ctx context.Context, c kubernetes.Interface, meta metav1.Obje
klog.Errorf("Attempt %d failed to update Node %s due to %v.", attempt, cur.Name, e2)
return false, nil
})

if err != nil {
err = errors.Errorf("failed to update Node %s after %d attempts due to %v", meta.Name, attempt, err)
}
Expand Down
1 change: 0 additions & 1 deletion vendor/kmodules.xyz/client-go/core/v1/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ func TryUpdatePod(ctx context.Context, c kubernetes.Interface, meta metav1.Objec
klog.Errorf("Attempt %d failed to update Pod %s/%s due to %v.", attempt, cur.Namespace, cur.Name, e2)
return false, nil
})

if err != nil {
err = errors.Errorf("failed to update Pod %s/%s after %d attempts due to %v", meta.Namespace, meta.Name, attempt, err)
}
Expand Down
1 change: 0 additions & 1 deletion vendor/kmodules.xyz/client-go/core/v1/pv.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ func TryUpdatePV(ctx context.Context, c kubernetes.Interface, meta metav1.Object
klog.Errorf("Attempt %d failed to update PersistentVolume %s due to %v.", attempt, cur.Name, e2)
return false, nil
})

if err != nil {
err = errors.Errorf("failed to update PersistentVolume %s after %d attempts due to %v", meta.Name, attempt, err)
}
Expand Down
1 change: 0 additions & 1 deletion vendor/kmodules.xyz/client-go/core/v1/pvc.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ func TryUpdatePVC(ctx context.Context, c kubernetes.Interface, meta metav1.Objec
klog.Errorf("Attempt %d failed to update PersistentVolumeClaim %s/%s due to %v.", attempt, cur.Namespace, cur.Name, e2)
return false, nil
})

if err != nil {
err = errors.Errorf("failed to update PersistentVolumeClaim %s/%s after %d attempts due to %v", meta.Namespace, meta.Name, attempt, err)
}
Expand Down
1 change: 0 additions & 1 deletion vendor/kmodules.xyz/client-go/core/v1/rc.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ func TryUpdateRC(ctx context.Context, c kubernetes.Interface, meta metav1.Object
klog.Errorf("Attempt %d failed to update ReplicationController %s/%s due to %v.", attempt, cur.Namespace, cur.Name, e2)
return false, nil
})

if err != nil {
err = errors.Errorf("failed to update ReplicationController %s/%s after %d attempts due to %v", meta.Namespace, meta.Name, attempt, err)
}
Expand Down
1 change: 0 additions & 1 deletion vendor/kmodules.xyz/client-go/core/v1/secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ func TryUpdateSecret(ctx context.Context, c kubernetes.Interface, meta metav1.Ob
klog.Errorf("Attempt %d failed to update Secret %s/%s due to %v.", attempt, cur.Namespace, cur.Name, e2)
return false, nil
})

if err != nil {
err = errors.Errorf("failed to update Secret %s/%s after %d attempts due to %v", meta.Namespace, meta.Name, attempt, err)
}
Expand Down
1 change: 0 additions & 1 deletion vendor/kmodules.xyz/client-go/core/v1/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ func TryUpdateService(ctx context.Context, c kubernetes.Interface, meta metav1.O
klog.Errorf("Attempt %d failed to update Service %s/%s due to %v.", attempt, cur.Namespace, cur.Name, e2)
return false, nil
})

if err != nil {
err = errors.Errorf("failed to update Service %s/%s after %d attempts due to %v", meta.Namespace, meta.Name, attempt, err)
}
Expand Down
1 change: 0 additions & 1 deletion vendor/kmodules.xyz/client-go/core/v1/serviceaccount.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ func TryUpdateServiceAccount(ctx context.Context, c kubernetes.Interface, meta m
klog.Errorf("Attempt %d failed to update ServiceAccount %s/%s due to %v.", attempt, cur.Namespace, cur.Name, e2)
return false, nil
})

if err != nil {
err = errors.Errorf("failed to update ServiceAccount %s/%s after %d attempts due to %v", meta.Namespace, meta.Name, attempt, err)
}
Expand Down
2 changes: 0 additions & 2 deletions vendor/kmodules.xyz/client-go/dynamic/unstructured.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ func TryUpdate(
klog.Errorf("Attempt %d failed to update %s %s/%s due to %v.", attempt, gvr.String(), cur.GetNamespace(), cur.GetName(), e2)
return false, nil
})

if err != nil {
err = errors.Errorf("failed to update %s %s/%s after %d attempts due to %v", gvr.String(), meta.Namespace, meta.Name, attempt, err)
}
Expand Down Expand Up @@ -187,7 +186,6 @@ func UpdateStatus(
}
return e2 == nil, nil
})

if err != nil {
err = fmt.Errorf("failed to update status of %s %s/%s after %d attempts due to %v", gvr.String(), in.GetNamespace(), in.GetName(), attempt, err)
}
Expand Down
1 change: 0 additions & 1 deletion vendor/kmodules.xyz/client-go/policy/v1/pdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ func TryUpdatePodDisruptionBudget(ctx context.Context, c kubernetes.Interface, m
klog.Errorf("Attempt %d failed to update PodDisruptionBudget %s due to %v.", attempt, cur.Name, e2)
return false, nil
})

if err != nil {
err = errors.Errorf("failed to update PodDisruptionBudget %s after %d attempts due to %v", meta.Name, attempt, err)
}
Expand Down
1 change: 0 additions & 1 deletion vendor/kmodules.xyz/client-go/policy/v1beta1/pdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ func TryUpdatePodDisruptionBudget(ctx context.Context, c kubernetes.Interface, m
klog.Errorf("Attempt %d failed to update PodDisruptionBudget %s due to %v.", attempt, cur.Name, e2)
return false, nil
})

if err != nil {
err = errors.Errorf("failed to update PodDisruptionBudget %s after %d attempts due to %v", meta.Name, attempt, err)
}
Expand Down
4 changes: 2 additions & 2 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1674,7 +1674,7 @@ k8s.io/utils/trace
# kmodules.xyz/apiversion v0.2.0
## explicit; go 1.14
kmodules.xyz/apiversion
# kmodules.xyz/client-go v0.30.44
# kmodules.xyz/client-go v0.30.45
## explicit; go 1.22.0
kmodules.xyz/client-go
kmodules.xyz/client-go/api/v1
Expand Down Expand Up @@ -1785,7 +1785,7 @@ kubeops.dev/petset/pkg/features
kubeops.dev/sidekick/apis/apps
kubeops.dev/sidekick/apis/apps/v1alpha1
kubeops.dev/sidekick/crds
# kubestash.dev/apimachinery v0.16.0-rc.0
# kubestash.dev/apimachinery v0.16.0
## explicit; go 1.22.1
kubestash.dev/apimachinery/apis
kubestash.dev/apimachinery/apis/addons/v1alpha1
Expand Down

0 comments on commit 00ea2f0

Please sign in to comment.