Skip to content

Commit

Permalink
Prepare for release v0.43.0-rc.0 (#760)
Browse files Browse the repository at this point in the history
ProductLine: KubeDB

Release: v2024.3.9-rc.0

Release-tracker: kubedb/CHANGELOG#86

Signed-off-by: 1gtm <[email protected]>
  • Loading branch information
1gtm authored Mar 10, 2024
1 parent 6980c71 commit 3410dd4
Show file tree
Hide file tree
Showing 101 changed files with 19,213 additions and 894 deletions.
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ require (
k8s.io/klog/v2 v2.110.1
k8s.io/kubectl v0.29.0
kmodules.xyz/cert-manager-util v0.29.0
kmodules.xyz/client-go v0.29.8
kmodules.xyz/client-go v0.29.12
kmodules.xyz/custom-resources v0.29.1
kmodules.xyz/monitoring-agent-api v0.29.0
kubedb.dev/apimachinery v0.42.0
kubedb.dev/db-client-go v0.0.11
kubedb.dev/apimachinery v0.43.0-rc.0
kubedb.dev/db-client-go v0.0.12
sigs.k8s.io/controller-runtime v0.17.0
sigs.k8s.io/yaml v1.4.0
stash.appscode.dev/apimachinery v0.33.0
Expand Down Expand Up @@ -138,7 +138,7 @@ require (
kmodules.xyz/objectstore-api v0.29.1 // indirect
kmodules.xyz/offshoot-api v0.29.0 // indirect
kmodules.xyz/prober v0.29.0 // indirect
kmodules.xyz/resource-metadata v0.18.2-0.20240105072614-e92a8a48d400 // indirect
kmodules.xyz/resource-metadata v0.18.2-0.20240219094915-0a7ba5704897 // indirect
kubeops.dev/sidekick v0.0.5 // indirect
kubestash.dev/apimachinery v0.5.0 // indirect
sigs.k8s.io/gateway-api v0.8.0 // indirect
Expand Down
16 changes: 8 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -695,8 +695,8 @@ kmodules.xyz/apiversion v0.2.0 h1:vAQYqZFm4xu4pbB1cAdHbFEPES6EQkcR4wc06xdTOWk=
kmodules.xyz/apiversion v0.2.0/go.mod h1:oPX8g8LvlPdPX3Yc5YvCzJHQnw3YF/X4/jdW0b1am80=
kmodules.xyz/cert-manager-util v0.29.0 h1:HjEaEsv66xeMKiI8LwfTRls0z9V9L0qEvPBdOcX/CsI=
kmodules.xyz/cert-manager-util v0.29.0/go.mod h1:0YuaPwp+P3Pw7Spxf6eDhOCMDDNXfNV2xIuxIexT1QU=
kmodules.xyz/client-go v0.29.8 h1:8Uw7zoaye0ZaY47fBVTLjDOOn6cXzLPYBNnzHj7pgH4=
kmodules.xyz/client-go v0.29.8/go.mod h1:WYM/ZC3I5/AUGHYyYYEzYHFhnSwK+tEZyGld6KpLoxI=
kmodules.xyz/client-go v0.29.12 h1:OZV5a9fEJwx0XI8OJYDqYRuCEeJyhsZN0iUs1YCBeks=
kmodules.xyz/client-go v0.29.12/go.mod h1:WYM/ZC3I5/AUGHYyYYEzYHFhnSwK+tEZyGld6KpLoxI=
kmodules.xyz/custom-resources v0.29.1 h1:xiNylhs3ILRbcUhxxy306AOy9GMA4Mq7xFIptZKgal4=
kmodules.xyz/custom-resources v0.29.1/go.mod h1:829zDY1EjaxPP52h1T73LZx/vgv8Pld9/uTT/ViZTc0=
kmodules.xyz/monitoring-agent-api v0.29.0 h1:gpFl6OZrlMLb/ySMHdREI9EwGtnJ91oZBn9H1UFRwB4=
Expand All @@ -707,12 +707,12 @@ kmodules.xyz/offshoot-api v0.29.0 h1:GHLhxxT9jU1N8+FvOCCeJNyU5g0duYS46UGrs6AHNLY
kmodules.xyz/offshoot-api v0.29.0/go.mod h1:5NxhBblXoDHWStx9HCDJR2KFTwYjEZ7i1Id3jelIunw=
kmodules.xyz/prober v0.29.0 h1:Ex7m4F9rH7uWNNJlLgP63ROOM+nUATJkC2L5OQ7nwMg=
kmodules.xyz/prober v0.29.0/go.mod h1:UtK+HKyI1lFLEKX+HFLyOCVju6TO93zv3kwGpzqmKOo=
kmodules.xyz/resource-metadata v0.18.2-0.20240105072614-e92a8a48d400 h1:bmd9/fvbhE55xtMF9hXVzjoUZFLGjMfEoHSHu9Hw6Gc=
kmodules.xyz/resource-metadata v0.18.2-0.20240105072614-e92a8a48d400/go.mod h1:XsCdEKjfoulX29tMGviDhjT/jLl158uvMvXlKOhK1as=
kubedb.dev/apimachinery v0.42.0 h1:i+Lq2LIrdGOqBNizP83YYhLO8YvGCx4e1chKQwMG78E=
kubedb.dev/apimachinery v0.42.0/go.mod h1:SAqjTUSzUBFedESPe0HJmV+pElaCPA7tyg4OUFyWi1c=
kubedb.dev/db-client-go v0.0.11 h1:4ngVHsYaAkK5C8aB196VaHdejrXULCe/QtSDD0STTa8=
kubedb.dev/db-client-go v0.0.11/go.mod h1:ko85gwOIinwL3xWSshqhQ/secVUVcSR824cn52Q5yuY=
kmodules.xyz/resource-metadata v0.18.2-0.20240219094915-0a7ba5704897 h1:mpv8wiSPScA763f0erwUozO3n1v0ALRw6hB+TTmca00=
kmodules.xyz/resource-metadata v0.18.2-0.20240219094915-0a7ba5704897/go.mod h1:nWzNouxIj4fvirSS1mkWO9sm1GHCQLcxJL+IzMCKQgE=
kubedb.dev/apimachinery v0.43.0-rc.0 h1:XCJfDDF8oDjUlaSZINsMlAbpV4c9NPsMRxEDSKdJYKM=
kubedb.dev/apimachinery v0.43.0-rc.0/go.mod h1:pEkqSvBTEhGfmxSqwSKgib5a7fLYgKx4cP29muFgYQc=
kubedb.dev/db-client-go v0.0.12 h1:l5a4UmMNinc8iOvEYtLnUYN689LgGY9Ww7H0+VNbOYY=
kubedb.dev/db-client-go v0.0.12/go.mod h1:QNXpsZcXXKEBGd+FqkCET76jrF5NlN/jWqm67PvAZLA=
kubeops.dev/sidekick v0.0.5 h1:HFeAVomGJmSmbnxoNiT+uP97IjgCY17zG4RtPUlzVZs=
kubeops.dev/sidekick v0.0.5/go.mod h1:uEz3ICN1oXA9dB+86T8kgRCrbakSjafWDPxQadqFkS0=
kubestash.dev/apimachinery v0.5.0 h1:wfEv593FpyckyAkoJhuRN3WXyDJJ2Javxs4g56kBcFA=
Expand Down
17 changes: 15 additions & 2 deletions vendor/kmodules.xyz/client-go/api/v1/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,28 @@ type ClusterMetadata struct {
Provider HostingProvider `json:"provider,omitempty" protobuf:"bytes,4,opt,name=provider,casttype=HostingProvider"`
}

/*
ENUM(
ACE = 1
OCMHub = 2
OCMMulticlusterControlplane = 4
OCMSpoke = 8
OpenShift = 16
Rancher = 32
VirtualCluster = 64
)
*/
type ClusterManager int

const (
ClusterManagerACE ClusterManager = 1 << iota
ClusterManagerOCMHub
ClusterManagerOCMSpoke
ClusterManagerOCMMulticlusterControlplane
ClusterManagerRancher
ClusterManagerOCMSpoke
ClusterManagerOpenShift
ClusterManagerRancher
ClusterManagerVirtualCluster
)

Expand Down
84 changes: 84 additions & 0 deletions vendor/kmodules.xyz/client-go/api/v1/cluster_enum.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
/*
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 v1

import (
"fmt"
"strings"
)

var ErrInvalidClusterManager = fmt.Errorf("not a valid ClusterManager, try [%s]", strings.Join(_ClusterManagerNames, ", "))

const _ClusterManagerName = "ACEOCMHubOCMMulticlusterControlplaneOCMSpokeOpenShiftRancherVirtualCluster"

var _ClusterManagerNames = []string{
_ClusterManagerName[0:3],
_ClusterManagerName[3:9],
_ClusterManagerName[9:36],
_ClusterManagerName[36:44],
_ClusterManagerName[44:53],
_ClusterManagerName[53:60],
_ClusterManagerName[60:74],
}

// ClusterManagerNames returns a list of possible string values of ClusterManager.
func ClusterManagerNames() []string {
tmp := make([]string, len(_ClusterManagerNames))
copy(tmp, _ClusterManagerNames)
return tmp
}

// ClusterManagerValues returns a list of the values for ClusterManager
func ClusterManagerValues() []ClusterManager {
return []ClusterManager{
ClusterManagerACE,
ClusterManagerOCMHub,
ClusterManagerOCMMulticlusterControlplane,
ClusterManagerOCMSpoke,
ClusterManagerOpenShift,
ClusterManagerRancher,
ClusterManagerVirtualCluster,
}
}

var _ClusterManagerMap = map[ClusterManager]string{
ClusterManagerACE: _ClusterManagerName[0:3],
ClusterManagerOCMHub: _ClusterManagerName[3:9],
ClusterManagerOCMMulticlusterControlplane: _ClusterManagerName[9:36],
ClusterManagerOCMSpoke: _ClusterManagerName[36:44],
ClusterManagerOpenShift: _ClusterManagerName[44:53],
ClusterManagerRancher: _ClusterManagerName[53:60],
ClusterManagerVirtualCluster: _ClusterManagerName[60:74],
}

var _ClusterManagerValue = map[string]ClusterManager{
_ClusterManagerName[0:3]: ClusterManagerACE,
_ClusterManagerName[3:9]: ClusterManagerOCMHub,
_ClusterManagerName[9:36]: ClusterManagerOCMMulticlusterControlplane,
_ClusterManagerName[36:44]: ClusterManagerOCMSpoke,
_ClusterManagerName[44:53]: ClusterManagerOpenShift,
_ClusterManagerName[53:60]: ClusterManagerRancher,
_ClusterManagerName[60:74]: ClusterManagerVirtualCluster,
}

// ParseClusterManager attempts to convert a string to a ClusterManager.
func ParseClusterManager(name string) (ClusterManager, error) {
if x, ok := _ClusterManagerValue[name]; ok {
return x, nil
}
return ClusterManager(0), fmt.Errorf("%s is %w", name, ErrInvalidClusterManager)
}
7 changes: 6 additions & 1 deletion vendor/kmodules.xyz/client-go/apiextensions/v1/crd.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package v1

import (
"context"
"time"

"github.com/pkg/errors"
api "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
Expand All @@ -29,6 +30,10 @@ import (
kutil "kmodules.xyz/client-go"
)

const (
RetryTimeout = 10 * time.Minute
)

func CreateOrUpdateCustomResourceDefinition(
ctx context.Context,
c cs.Interface,
Expand Down Expand Up @@ -70,7 +75,7 @@ func TryUpdateCustomResourceDefinition(
opts metav1.UpdateOptions,
) (result *api.CustomResourceDefinition, err error) {
attempt := 0
err = wait.PollUntilContextTimeout(ctx, kutil.RetryInterval, kutil.RetryTimeout, true, func(ctx context.Context) (bool, error) {
err = wait.PollUntilContextTimeout(ctx, kutil.RetryInterval, RetryTimeout, true, func(ctx context.Context) (bool, error) {
attempt++
cur, e2 := c.ApiextensionsV1().CustomResourceDefinitions().Get(ctx, name, metav1.GetOptions{})
if kerr.IsNotFound(e2) {
Expand Down
49 changes: 49 additions & 0 deletions vendor/kmodules.xyz/client-go/core/v1/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ package v1
import (
"sort"

"kmodules.xyz/client-go/meta"

jsoniter "github.com/json-iterator/go"
"gomodules.xyz/mergo"
core "k8s.io/api/core/v1"
Expand Down Expand Up @@ -108,6 +110,33 @@ func UpsertContainer(containers []core.Container, upsert core.Container) []core.
return append(containers, upsert)
}

func MergeContainer(container core.Container, containerTemplate core.Container) core.Container {
if len(containerTemplate.Command) > 0 {
container.Command = containerTemplate.Command
}
container.Args = meta.UpsertArgumentList(container.Args, containerTemplate.Args)
container.WorkingDir = containerTemplate.WorkingDir
container.EnvFrom = containerTemplate.EnvFrom
container.Env = UpsertEnvVars(container.Env, containerTemplate.Env...)
container.Ports = UpsertContainerPorts(container.Ports, containerTemplate.Ports...)
container.Resources = containerTemplate.Resources
container.ResizePolicy = containerTemplate.ResizePolicy
container.RestartPolicy = containerTemplate.RestartPolicy
container.VolumeMounts = UpsertVolumeMount(container.VolumeMounts, containerTemplate.VolumeMounts...)
container.VolumeDevices = containerTemplate.VolumeDevices
container.LivenessProbe = containerTemplate.LivenessProbe
container.ReadinessProbe = containerTemplate.ReadinessProbe
container.StartupProbe = containerTemplate.StartupProbe
container.Lifecycle = containerTemplate.Lifecycle
container.TerminationMessagePath = containerTemplate.TerminationMessagePath
container.TerminationMessagePolicy = containerTemplate.TerminationMessagePolicy
container.ImagePullPolicy = containerTemplate.ImagePullPolicy
container.SecurityContext = containerTemplate.SecurityContext
container.StdinOnce = containerTemplate.StdinOnce
container.TTY = containerTemplate.TTY
return container
}

func UpsertContainers(containers []core.Container, addons []core.Container) []core.Container {
out := containers
for _, c := range addons {
Expand Down Expand Up @@ -264,6 +293,26 @@ func EnsureVolumeMountDeletedByPath(mounts []core.VolumeMount, mountPath string)
return mounts
}

func UpsertContainerPorts(ports []core.ContainerPort, np ...core.ContainerPort) []core.ContainerPort {
upsert := func(p core.ContainerPort) {
for i, port := range ports {
if port.Name == p.Name {
err := mergo.Merge(&ports[i], p, mergo.WithOverride)
if err != nil {
panic(err)
}
return
}
}
ports = append(ports, p)
}

for _, port := range np {
upsert(port)
}
return ports
}

func GetEnvByName(envs []core.EnvVar, name string) *core.EnvVar {
for i := range envs {
if envs[i].Name == name {
Expand Down
Loading

0 comments on commit 3410dd4

Please sign in to comment.