Skip to content

Commit

Permalink
Prepare for release v0.11.0 (#35)
Browse files Browse the repository at this point in the history
ProductLine: KubeStash

Release: v2024.8.30

Release-tracker: kubestash/CHANGELOG#19

Signed-off-by: 1gtm <[email protected]>
  • Loading branch information
1gtm authored Aug 30, 2024
1 parent e25615d commit 7b8760e
Show file tree
Hide file tree
Showing 14 changed files with 281 additions and 23 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ require (
k8s.io/klog/v2 v2.120.1
k8s.io/kubectl v0.29.0
k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0
kmodules.xyz/client-go v0.30.8
kmodules.xyz/client-go v0.30.13
kmodules.xyz/offshoot-api v0.29.4
kubestash.dev/apimachinery v0.11.0
kubestash.dev/apimachinery v0.12.0
sigs.k8s.io/controller-runtime v0.18.4
)

Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -630,16 +630,16 @@ k8s.io/kubectl v0.29.0 h1:Oqi48gXjikDhrBF67AYuZRTcJV4lg2l42GmvsP7FmYI=
k8s.io/kubectl v0.29.0/go.mod h1:0jMjGWIcMIQzmUaMgAzhSELv5WtHo2a8pq67DtviAJs=
k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0 h1:jgGTlFYnhF1PM1Ax/lAlxUPE+KfCIXHaathvJg1C3ak=
k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
kmodules.xyz/client-go v0.30.8 h1:LG4sc94GPYyY2yGBEyCdiww4DZryjZ+Z/AxkHlnD+dk=
kmodules.xyz/client-go v0.30.8/go.mod h1:XL3PDQIXG4s3xNRL2SSxIvi8b2WyMGpn26dFnOBz0j4=
kmodules.xyz/client-go v0.30.13 h1:Tpvg7ZlSNlzjB0NZT9hUe9JrO7FN4PjUUF1hNUXSku0=
kmodules.xyz/client-go v0.30.13/go.mod h1:XL3PDQIXG4s3xNRL2SSxIvi8b2WyMGpn26dFnOBz0j4=
kmodules.xyz/objectstore-api v0.29.1 h1:uUsjf8KU0w4LYowSEOnl0AbHT3hsHIu1wNLHqGe1o6s=
kmodules.xyz/objectstore-api v0.29.1/go.mod h1:xG+5awH1SXYKxwN/+k1FEQvzixd5tgNqEN/1LEiB2FE=
kmodules.xyz/offshoot-api v0.29.4 h1:WQV2BIUIoVKKiqZNmZ4gAy367jEdwBhEl3dFCLZM1qA=
kmodules.xyz/offshoot-api v0.29.4/go.mod h1:e+NQ0s4gW/YTPWBWEfdISZcmk+tlTq8IjvP5SLdqvko=
kmodules.xyz/prober v0.29.0 h1:Ex7m4F9rH7uWNNJlLgP63ROOM+nUATJkC2L5OQ7nwMg=
kmodules.xyz/prober v0.29.0/go.mod h1:UtK+HKyI1lFLEKX+HFLyOCVju6TO93zv3kwGpzqmKOo=
kubestash.dev/apimachinery v0.11.0 h1:RK1kSkuq/MIWDcGLxaLrApR4sSAcekmulGI+84FEcDc=
kubestash.dev/apimachinery v0.11.0/go.mod h1:iSumBmpU+PmxloNvHQkazCYnuxPqi3lbTXjXTI1hKqc=
kubestash.dev/apimachinery v0.12.0 h1:33eDk/W2n/K45iRpAj8JTFGq9JzSvJBoWAjyoKTklgQ=
kubestash.dev/apimachinery v0.12.0/go.mod h1:gtVSpHtK8LvS26+rKyLTnZvijvSSCdfG83n6GL6+Kwc=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
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 @@ -58,7 +58,7 @@ ARCH := $(if $(GOARCH),$(GOARCH),$(shell go env GOARCH))
BASEIMAGE_PROD ?= gcr.io/distroless/static-debian12
BASEIMAGE_DBG ?= debian:bookworm

GO_VERSION ?= 1.22
GO_VERSION ?= 1.23
BUILD_IMAGE ?= ghcr.io/appscode/golang-dev:$(GO_VERSION)

OUTBIN = bin/$(OS)_$(ARCH)/$(BIN)
Expand Down
15 changes: 14 additions & 1 deletion vendor/kmodules.xyz/client-go/api/v1/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ limitations under the License.

package v1

import "strings"
import (
"crypto/hmac"
"crypto/sha256"
"encoding/base64"
"fmt"
"strings"
)

// +kubebuilder:validation:Enum=Aws;Azure;DigitalOcean;GoogleCloud;Linode;Packet;Scaleway;Vultr;BareMetal;KIND;Generic;Private
type HostingProvider string
Expand Down Expand Up @@ -56,6 +62,13 @@ type ClusterMetadata struct {
CABundle string `json:"caBundle,omitempty"`
}

func (md ClusterMetadata) State() string {
hasher := hmac.New(sha256.New, []byte(md.UID))
state := fmt.Sprintf("%s,%s", md.APIEndpoint, md.OwnerID)
hasher.Write([]byte(state))
return base64.URLEncoding.EncodeToString(hasher.Sum(nil))
}

/*
ENUM(
Expand Down
4 changes: 2 additions & 2 deletions vendor/kmodules.xyz/client-go/api/v1/object.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@ type ObjectInfo struct {
Ref ObjectReference `json:"ref" protobuf:"bytes,2,opt,name=ref"`
}

// +kubebuilder:validation:Enum=authn;authz;auth_secret;backup_via;catalog;cert_issuer;config;connect_via;exposed_by;event;located_on;monitored_by;ocm_bind;offshoot;ops;placed_into;policy;recommended_for;restore_into;scaled_by;source;storage;view
// ENUM(authn,authz,auth_secret,backup_via,catalog,cert_issuer,config,connect_via,exposed_by,event,located_on,monitored_by,ocm_bind,offshoot,ops,placed_into,policy,recommended_for,restore_into,scaled_by,source,storage,view)
// +kubebuilder:validation:Enum=authn;authz;auth_secret;backup_via;catalog;cert_issuer;config;connect_via;exposed_by;event;located_on;monitored_by;ocm_bind;offshoot;ops;policy;recommended_for;restore_into;scaled_by;source;storage;view
// ENUM(authn,authz,auth_secret,backup_via,catalog,cert_issuer,config,connect_via,exposed_by,event,located_on,monitored_by,ocm_bind,offshoot,ops,policy,recommended_for,restore_into,scaled_by,source,storage,view)
type EdgeLabel string

func (e EdgeLabel) Direct() bool {
Expand Down
5 changes: 0 additions & 5 deletions vendor/kmodules.xyz/client-go/api/v1/object_enum.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion vendor/kmodules.xyz/client-go/apiextensions/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@ type setupGroup struct {
fn SetupFn
}

type crdParamKey struct{}

var (
setupFns = make(map[schema.GroupKind]setupGroup)
testFns = make(map[schema.GroupKind]TestFn)
setupDone = map[schema.GroupKind]bool{}
CRDParam = struct{}{}
CRDParam = crdParamKey{}
mu sync.Mutex
)

Expand Down
234 changes: 234 additions & 0 deletions vendor/kmodules.xyz/client-go/client/retryclient.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,234 @@
/*
Copyright AppsCode Inc. and 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 client

import (
"context"
"errors"
"io"
"time"

"k8s.io/apimachinery/pkg/api/meta"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/util/wait"
"sigs.k8s.io/controller-runtime/pkg/client"
)

type retryClient struct {
d client.Client
interval time.Duration
timeout time.Duration
}

var _ client.Client = &retryClient{}

func NewRetryClient(d client.Client) client.Client {
return &retryClient{d: d, interval: 500 * time.Millisecond, timeout: 5 * time.Minute}
}

func NewRetryClientWithOptions(d client.Client, interval time.Duration, timeout time.Duration) client.Client {
return &retryClient{d: d, interval: interval, timeout: timeout}
}

func (r *retryClient) Scheme() *runtime.Scheme {
return r.d.Scheme()
}

func (r *retryClient) RESTMapper() meta.RESTMapper {
return r.d.RESTMapper()
}

func (r *retryClient) GroupVersionKindFor(obj runtime.Object) (schema.GroupVersionKind, error) {
return r.d.GroupVersionKindFor(obj)
}

func (r *retryClient) IsObjectNamespaced(obj runtime.Object) (bool, error) {
return r.d.IsObjectNamespaced(obj)
}

func (r *retryClient) Get(ctx context.Context, key client.ObjectKey, obj client.Object, opts ...client.GetOption) (apierror error) {
_ = wait.PollUntilContextTimeout(ctx, r.interval, r.timeout, true, func(ctx context.Context) (done bool, err error) {
apierror = r.d.Get(ctx, key, obj, opts...)
err = apierror
done = err == nil || !errors.Is(err, io.EOF)
return
})
return
}

func (r *retryClient) List(ctx context.Context, list client.ObjectList, opts ...client.ListOption) (apierror error) {
_ = wait.PollUntilContextTimeout(ctx, r.interval, r.timeout, true, func(ctx context.Context) (done bool, err error) {
apierror = r.d.List(ctx, list, opts...)
err = apierror
done = err == nil || !errors.Is(err, io.EOF)
return
})
return
}

func (r *retryClient) Create(ctx context.Context, obj client.Object, opts ...client.CreateOption) (apierror error) {
_ = wait.PollUntilContextTimeout(ctx, r.interval, r.timeout, true, func(ctx context.Context) (done bool, err error) {
apierror = r.d.Create(ctx, obj, opts...)
err = apierror
done = err == nil || !errors.Is(err, io.EOF)
return
})
return
}

func (r *retryClient) Delete(ctx context.Context, obj client.Object, opts ...client.DeleteOption) (apierror error) {
_ = wait.PollUntilContextTimeout(ctx, r.interval, r.timeout, true, func(ctx context.Context) (done bool, err error) {
apierror = r.d.Delete(ctx, obj, opts...)
err = apierror
done = err == nil || !errors.Is(err, io.EOF)
return
})
return
}

func (r *retryClient) Update(ctx context.Context, obj client.Object, opts ...client.UpdateOption) (apierror error) {
_ = wait.PollUntilContextTimeout(ctx, r.interval, r.timeout, true, func(ctx context.Context) (done bool, err error) {
apierror = r.d.Update(ctx, obj, opts...)
err = apierror
done = err == nil || !errors.Is(err, io.EOF)
return
})
return
}

func (r *retryClient) Patch(ctx context.Context, obj client.Object, patch client.Patch, opts ...client.PatchOption) (apierror error) {
_ = wait.PollUntilContextTimeout(ctx, r.interval, r.timeout, true, func(ctx context.Context) (done bool, err error) {
apierror = r.d.Patch(ctx, obj, patch, opts...)
err = apierror
done = err == nil || !errors.Is(err, io.EOF)
return
})
return
}

func (r *retryClient) DeleteAllOf(ctx context.Context, obj client.Object, opts ...client.DeleteAllOfOption) (apierror error) {
_ = wait.PollUntilContextTimeout(ctx, r.interval, r.timeout, true, func(ctx context.Context) (done bool, err error) {
apierror = r.d.DeleteAllOf(ctx, obj, opts...)
err = apierror
done = err == nil || !errors.Is(err, io.EOF)
return
})
return
}

func (r *retryClient) Status() client.SubResourceWriter {
return &retrySubResourceWriter{
d: r.d.Status(),
interval: r.interval,
timeout: r.timeout,
}
}

func (r *retryClient) SubResource(subResource string) client.SubResourceClient {
return &retrySubResourceClient{
d: r.d.SubResource(subResource),
interval: r.interval,
timeout: r.timeout,
}
}

type retrySubResourceWriter struct {
d client.SubResourceWriter
interval time.Duration
timeout time.Duration
}

var _ client.SubResourceWriter = &retrySubResourceWriter{}

func (r *retrySubResourceWriter) Create(ctx context.Context, obj client.Object, subResource client.Object, opts ...client.SubResourceCreateOption) (apierror error) {
_ = wait.PollUntilContextTimeout(ctx, r.interval, r.timeout, true, func(ctx context.Context) (done bool, err error) {
apierror = r.d.Create(ctx, obj, subResource, opts...)
err = apierror
done = err == nil || !errors.Is(err, io.EOF)
return
})
return
}

func (r *retrySubResourceWriter) Update(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) (apierror error) {
_ = wait.PollUntilContextTimeout(ctx, r.interval, r.timeout, true, func(ctx context.Context) (done bool, err error) {
apierror = r.d.Update(ctx, obj, opts...)
err = apierror
done = err == nil || !errors.Is(err, io.EOF)
return
})
return
}

func (r *retrySubResourceWriter) Patch(ctx context.Context, obj client.Object, patch client.Patch, opts ...client.SubResourcePatchOption) (apierror error) {
_ = wait.PollUntilContextTimeout(ctx, r.interval, r.timeout, true, func(ctx context.Context) (done bool, err error) {
apierror = r.d.Patch(ctx, obj, patch, opts...)
err = apierror
done = err == nil || !errors.Is(err, io.EOF)
return
})
return
}

type retrySubResourceClient struct {
d client.SubResourceClient
interval time.Duration
timeout time.Duration
}

var _ client.SubResourceClient = &retrySubResourceClient{}

func (r *retrySubResourceClient) Get(ctx context.Context, obj client.Object, subResource client.Object, opts ...client.SubResourceGetOption) (apierror error) {
_ = wait.PollUntilContextTimeout(ctx, r.interval, r.timeout, true, func(ctx context.Context) (done bool, err error) {
apierror = r.d.Get(ctx, obj, subResource, opts...)
err = apierror
done = err == nil || !errors.Is(err, io.EOF)
return
})
return
}

func (r *retrySubResourceClient) Create(ctx context.Context, obj client.Object, subResource client.Object, opts ...client.SubResourceCreateOption) (apierror error) {
_ = wait.PollUntilContextTimeout(ctx, r.interval, r.timeout, true, func(ctx context.Context) (done bool, err error) {
apierror = r.d.Create(ctx, obj, subResource, opts...)
err = apierror
done = err == nil || !errors.Is(err, io.EOF)
return
})
return
}

func (r *retrySubResourceClient) Update(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) (apierror error) {
_ = wait.PollUntilContextTimeout(ctx, r.interval, r.timeout, true, func(ctx context.Context) (done bool, err error) {
apierror = r.d.Update(ctx, obj, opts...)
err = apierror
done = err == nil || !errors.Is(err, io.EOF)
return
})
return
}

func (r *retrySubResourceClient) Patch(ctx context.Context, obj client.Object, patch client.Patch, opts ...client.SubResourcePatchOption) (apierror error) {
_ = wait.PollUntilContextTimeout(ctx, r.interval, r.timeout, true, func(ctx context.Context) (done bool, err error) {
apierror = r.d.Patch(ctx, obj, patch, opts...)
err = apierror
done = err == nil || !errors.Is(err, io.EOF)
return
})
return
}
2 changes: 1 addition & 1 deletion vendor/kmodules.xyz/client-go/conditions/getter.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ func mirror(from Getter, targetCondition kmapi.ConditionType, options ...MirrorO
case true:
condition = TrueCondition(targetCondition)
case false:
condition = FalseCondition(targetCondition, mirrorOpt.fallbackReason, mirrorOpt.fallbackSeverity, mirrorOpt.fallbackMessage)
condition = FalseCondition(targetCondition, mirrorOpt.fallbackReason, mirrorOpt.fallbackSeverity, mirrorOpt.fallbackMessage) //nolint:govet
}
}

Expand Down
4 changes: 2 additions & 2 deletions vendor/kmodules.xyz/client-go/conditions/merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ func merge(conditions []localizedCondition, targetCondition kmapi.ConditionType,
targetMessage := getMessage(g, options)

if g.TopGroup().status == metav1.ConditionFalse {
return FalseCondition(targetCondition, targetReason, g.TopGroup().severity, targetMessage)
return FalseCondition(targetCondition, targetReason, g.TopGroup().severity, targetMessage) //nolint:govet
}
return UnknownCondition(targetCondition, targetReason, targetMessage)
return UnknownCondition(targetCondition, targetReason, targetMessage) //nolint:govet
}

// getConditionGroups groups a list of conditions according to status, severity values.
Expand Down
Loading

0 comments on commit 7b8760e

Please sign in to comment.