Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update dependencies (#436)
Browse files Browse the repository at this point in the history
Signed-off-by: 1gtm <1gtm@appscode.com>
1gtm authored Nov 24, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 4e074da commit 0a153b6
Showing 68 changed files with 63,607 additions and 57 deletions.
18 changes: 9 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
@@ -6,9 +6,9 @@ require (
github.com/prometheus-operator/prometheus-operator/pkg/client v0.47.0
github.com/spf13/cobra v1.1.3
github.com/spf13/pflag v1.0.5
go.bytebuilders.dev/audit v0.0.12
go.bytebuilders.dev/license-verifier v0.9.5
go.bytebuilders.dev/license-verifier/kubernetes v0.9.5
go.bytebuilders.dev/audit v0.0.13
go.bytebuilders.dev/license-verifier v0.9.6
go.bytebuilders.dev/license-verifier/kubernetes v0.9.6
gomodules.xyz/logs v0.0.6
gomodules.xyz/runtime v0.2.0
gomodules.xyz/x v0.0.8
@@ -18,10 +18,10 @@ require (
k8s.io/apiserver v0.21.1
k8s.io/client-go v0.21.1
k8s.io/klog/v2 v2.8.0
kmodules.xyz/client-go v0.0.0-20211116191353-a321f503ea3a
kmodules.xyz/custom-resources v0.0.0-20211025144742-7ab2db03cce8
kmodules.xyz/webhook-runtime v0.0.0-20211025143924-ac7adedbd680
kubedb.dev/apimachinery v0.23.0
kmodules.xyz/client-go v0.0.0-20211122091731-6c471b24a4ea
kmodules.xyz/custom-resources v0.0.0-20211122142737-3bf3dbd8ac52
kmodules.xyz/webhook-runtime v0.0.0-20211116181908-909a755cc9d1
kubedb.dev/apimachinery v0.23.1-0.20211122140200-fe94664c6645
kubedb.dev/elasticsearch v0.23.0
kubedb.dev/mariadb v0.7.0
kubedb.dev/memcached v0.16.0
@@ -177,8 +177,8 @@ require (
k8s.io/utils v0.0.0-20210802155522-efc7438f0176 // indirect
kmodules.xyz/apiversion v0.2.0 // indirect
kmodules.xyz/monitoring-agent-api v0.0.0-20211117051609-520052fe6ff6 // indirect
kmodules.xyz/objectstore-api v0.0.0-20211025143832-b9135743b78b // indirect
kmodules.xyz/offshoot-api v0.0.0-20211103060642-3e217667cf41 // indirect
kmodules.xyz/objectstore-api v0.0.0-20211116180107-8720be0c9bf7 // indirect
kmodules.xyz/offshoot-api v0.0.0-20211116180130-806cde7fb795 // indirect
kmodules.xyz/prober v0.0.0-20210618020259-5836fb959027 // indirect
kmodules.xyz/resource-metadata v0.6.7 // indirect
kmodules.xyz/resource-metrics v0.0.5 // indirect
29 changes: 20 additions & 9 deletions go.sum
Original file line number Diff line number Diff line change
@@ -732,6 +732,7 @@ github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
github.com/opencontainers/image-spec v1.0.0/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
github.com/opencontainers/image-spec v1.0.2/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
github.com/opencontainers/runc v0.0.0-20190115041553-12f6a991201f/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U=
github.com/opencontainers/runc v1.0.0-rc93/go.mod h1:3NOsor4w32B2tC0Zbl8Knk4Wg84SM2ImC1fxBuqJ/H0=
github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
@@ -931,13 +932,16 @@ github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go
github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q=
github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0=
go.bytebuilders.dev/audit v0.0.10/go.mod h1:jhNyXHoeVHijC4tM7EYpcB9RqkwnI27IoRN3k0ivick=
go.bytebuilders.dev/audit v0.0.12 h1:B8kXU/HRJ9ss2J8wEAEBjClFSOE3U4v5IkZQtRH641E=
go.bytebuilders.dev/audit v0.0.12/go.mod h1:ByBiBbgRf3y+frLEWnxjJJCYn4rXN5TTb9Dc0Kfr0tI=
go.bytebuilders.dev/audit v0.0.13 h1:Ne2tYw6aM7p5fbGOxQWfhQvGyv0IVZphLBAK3rMLGFE=
go.bytebuilders.dev/audit v0.0.13/go.mod h1:p5z/qZKf9awnjs8mKSWiwz1OwUdzbK5SXKi+Xtww5HQ=
go.bytebuilders.dev/license-verifier v0.9.3/go.mod h1:GpIW0o8O0wpiBVt7IIz4z7bcPuG8nza8/bCDkaupDn8=
go.bytebuilders.dev/license-verifier v0.9.5 h1:XUbFH3LzHSpQFtVS/MiT5RN0gr/KNNBvnOm78KYoAEQ=
go.bytebuilders.dev/license-verifier v0.9.5/go.mod h1:GpIW0o8O0wpiBVt7IIz4z7bcPuG8nza8/bCDkaupDn8=
go.bytebuilders.dev/license-verifier/kubernetes v0.9.5 h1:KWzmh4qZ+3cR8LpBuUfufb2goK5NuULyE0uKYgt3D50=
go.bytebuilders.dev/license-verifier v0.9.6 h1:nT4Eplu0OQWM7Re81ZQibkYKeno6nDAwOzaz14Yvadc=
go.bytebuilders.dev/license-verifier v0.9.6/go.mod h1:GpIW0o8O0wpiBVt7IIz4z7bcPuG8nza8/bCDkaupDn8=
go.bytebuilders.dev/license-verifier/kubernetes v0.9.5/go.mod h1:mg5pZDweHlpTTw57kOdLj4bU107hHVP/1xTKKZ1eUNc=
go.bytebuilders.dev/license-verifier/kubernetes v0.9.6 h1:QwiUgNug1pD4cwxLuSQmSLn1WvvNreKfBajdymoRmeM=
go.bytebuilders.dev/license-verifier/kubernetes v0.9.6/go.mod h1:b1oIjrDuNN1T3d1ixnr020hi2i0sXlR7CIsWrhkzga4=
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
go.etcd.io/bbolt v1.3.5 h1:XAzx9gjCb0Rxj7EoqcClPD1d5ZBxZJk0jbuoPHenBt0=
@@ -1431,22 +1435,27 @@ kmodules.xyz/client-go v0.0.0-20211013093146-1fbfd52e78c9/go.mod h1:0gkPeALtYjB2
kmodules.xyz/client-go v0.0.0-20211028132207-0cf6ea46b030/go.mod h1:ENUu8pPK19xzBkVpAJHoGCI2QRvb1SqffWRt0K2sV5I=
kmodules.xyz/client-go v0.0.0-20211107190155-5bb4090d2728/go.mod h1:ENUu8pPK19xzBkVpAJHoGCI2QRvb1SqffWRt0K2sV5I=
kmodules.xyz/client-go v0.0.0-20211110065417-091bd089a92d/go.mod h1:ENUu8pPK19xzBkVpAJHoGCI2QRvb1SqffWRt0K2sV5I=
kmodules.xyz/client-go v0.0.0-20211116191353-a321f503ea3a h1:g7KnojrCiNSGPWf7xWtgQ+OM1GtgsuGdceGwqE3xJWQ=
kmodules.xyz/client-go v0.0.0-20211116191353-a321f503ea3a/go.mod h1:ENUu8pPK19xzBkVpAJHoGCI2QRvb1SqffWRt0K2sV5I=
kmodules.xyz/client-go v0.0.0-20211119042047-bbc619ee4c49/go.mod h1:ENUu8pPK19xzBkVpAJHoGCI2QRvb1SqffWRt0K2sV5I=
kmodules.xyz/client-go v0.0.0-20211122091731-6c471b24a4ea h1:z5Li57oxum0018ryWpI5w5HYVFgI2S2cVj27R76IRnU=
kmodules.xyz/client-go v0.0.0-20211122091731-6c471b24a4ea/go.mod h1:ENUu8pPK19xzBkVpAJHoGCI2QRvb1SqffWRt0K2sV5I=
kmodules.xyz/constants v0.0.0-20210218100002-2c304bfda278/go.mod h1:DbiFk1bJ1KEO94t1SlAn7tzc+Zz95rSXgyUKa2nzPmY=
kmodules.xyz/crd-schema-fuzz v0.0.0-20210618002152-fae23aef5fb4/go.mod h1:IIkUctlfoptoci0BOrsUf8ya+MOG5uaeh1PE4uzaIbA=
kmodules.xyz/custom-resources v0.0.0-20211007080833-72bd9e8cae6e/go.mod h1:pGabego8q4oi/2sNjhdtFkgVaVw4AyGv14GO6VtAjTw=
kmodules.xyz/custom-resources v0.0.0-20211025144742-7ab2db03cce8 h1:fukXZ0qnfth9rLuQh1X0L3xhpEGc8x19JO10t8IPQaU=
kmodules.xyz/custom-resources v0.0.0-20211025144742-7ab2db03cce8/go.mod h1:yHLFe4wVYxepTnN00CFUf29xH+jEHDokq6d2fbp9pks=
kmodules.xyz/custom-resources v0.0.0-20211122142737-3bf3dbd8ac52 h1:UWVpU7y5znTUusU+JhPB+ojh26f6K2v8sNb37U1DolQ=
kmodules.xyz/custom-resources v0.0.0-20211122142737-3bf3dbd8ac52/go.mod h1:yHLFe4wVYxepTnN00CFUf29xH+jEHDokq6d2fbp9pks=
kmodules.xyz/monitoring-agent-api v0.0.0-20210928135619-38ca075a2dbd/go.mod h1:08pBqfEuy29EjhaMrHB2XFy2iekoFi7AjaXcJS+xAck=
kmodules.xyz/monitoring-agent-api v0.0.0-20211117051609-520052fe6ff6 h1:YmbW4M8kN4jzE3Me34l+zkaeuVRoSqrQ2PefAl9gMFo=
kmodules.xyz/monitoring-agent-api v0.0.0-20211117051609-520052fe6ff6/go.mod h1:pMat/DczEAlpNXI53di7FklmlQ594rzXwK3tdIyht2c=
kmodules.xyz/objectstore-api v0.0.0-20210928135706-fdf68f88ea6e/go.mod h1:Tkcf9uTplnrJ6C8o0zlw2kpgS1SaWAiMO5P2YgLjTo8=
kmodules.xyz/objectstore-api v0.0.0-20211025143832-b9135743b78b h1:OmlGtmyI++rShfOf0VsmmIRulgCmFUOSlAp+g7iOrCs=
kmodules.xyz/objectstore-api v0.0.0-20211025143832-b9135743b78b/go.mod h1:IICnDdPFOEeGXdaPVHOGYfdwD1cyh/p1I/TWMkyNTIE=
kmodules.xyz/objectstore-api v0.0.0-20211116180107-8720be0c9bf7 h1:JIAEFjN3GDhLEG1Fh1zYpy/QFyyN337mJTM+ODEGosg=
kmodules.xyz/objectstore-api v0.0.0-20211116180107-8720be0c9bf7/go.mod h1:IICnDdPFOEeGXdaPVHOGYfdwD1cyh/p1I/TWMkyNTIE=
kmodules.xyz/offshoot-api v0.0.0-20210829122105-6f4d481b0c61/go.mod h1:3LECbAL3FgbyK80NP3V3Pmiuo/a3hFWg/PR6SPFhTns=
kmodules.xyz/offshoot-api v0.0.0-20211103060642-3e217667cf41 h1:GCDyb1fbgCHUNuFk9MecSFvzMq/WCeGk8pDEtqivziA=
kmodules.xyz/offshoot-api v0.0.0-20211103060642-3e217667cf41/go.mod h1:sJYyxf84ZvbVz4SivxMgSelGRYn19wOLUtObiEncCxk=
kmodules.xyz/offshoot-api v0.0.0-20211116180130-806cde7fb795 h1:h4pVd4olac3LPEMI1YEtUXWahNIuAOsrpv1B/KN3C54=
kmodules.xyz/offshoot-api v0.0.0-20211116180130-806cde7fb795/go.mod h1:sJYyxf84ZvbVz4SivxMgSelGRYn19wOLUtObiEncCxk=
kmodules.xyz/openshift v0.0.0-20210618001443-f2507caa512f/go.mod h1:8E5ckbd1KMNmR4hc7ScvmQnGfx1ULUUp+UTmoDdxRkc=
kmodules.xyz/prober v0.0.0-20210618020259-5836fb959027 h1:rtSPsruEkoBOLcbJkxMQjnPafpv8/vJnfWlTIj9yRBg=
kmodules.xyz/prober v0.0.0-20210618020259-5836fb959027/go.mod h1:H4NcvS1RQxeXtQONALbU6r9OT3Xa7cMhfamX/k9t9wo=
@@ -1457,11 +1466,13 @@ kmodules.xyz/resource-metrics v0.0.3/go.mod h1:6Dv63HDgp83DhA+lZNB7GIQR6PLjNrYW6
kmodules.xyz/resource-metrics v0.0.5 h1:an1eaxw8mWX5RfujUMTTkJPGiMlQQUDzT6aveSGNAq8=
kmodules.xyz/resource-metrics v0.0.5/go.mod h1:6Dv63HDgp83DhA+lZNB7GIQR6PLjNrYW6ghQKioQzII=
kmodules.xyz/webhook-runtime v0.0.0-20210928141616-7f73c2ab318a/go.mod h1:MFZFmJk9IXNHwq8JlF/mukwBDbopFQj4swaB2MWHc/U=
kmodules.xyz/webhook-runtime v0.0.0-20211025143924-ac7adedbd680 h1:Ki7RCqjyrbb7OLa1vl4PgWSWWDX5bM0a/Qz8bxhhkEQ=
kmodules.xyz/webhook-runtime v0.0.0-20211025143924-ac7adedbd680/go.mod h1:+iqfWTb9yfnhLKPKIPsX/UBTc0yxZItLY2UpYaoNEsg=
kmodules.xyz/webhook-runtime v0.0.0-20211116181908-909a755cc9d1 h1:yqQdFNjCmAolD0/ER0KizY5efbGj7lyXx2Q0SqsflYo=
kmodules.xyz/webhook-runtime v0.0.0-20211116181908-909a755cc9d1/go.mod h1:+iqfWTb9yfnhLKPKIPsX/UBTc0yxZItLY2UpYaoNEsg=
kubedb.dev/apimachinery v0.22.1-0.20211012044625-d0176524a0cc/go.mod h1:LLwysTxytDqUq2CSJ5iS8H+8mFa0a9PepejreZZcZwI=
kubedb.dev/apimachinery v0.23.0 h1:K0dKXx7XJINv3Py75D/up6V3zl8XfX/e/rvspNejXNA=
kubedb.dev/apimachinery v0.23.0/go.mod h1:x8UBaJPIBCD6S58VQ+38+QxFUXCYdvFrmP9FnOuPOaI=
kubedb.dev/apimachinery v0.23.1-0.20211122140200-fe94664c6645 h1:pzzMygnBdzkAFPmcnDWI0kPRVYfEc3rfdpGCQ3RsTvQ=
kubedb.dev/apimachinery v0.23.1-0.20211122140200-fe94664c6645/go.mod h1:euSlEJ4PbfR6m6QH1oYGt2bEAOErr/ZiJWz+h+siqII=
kubedb.dev/db-client-go v0.0.0-20211102100133-9d4b23e3d1c5 h1:YdsaIj9Xs9d1S5OQEN6Fdkixg6PqLA/UdkerGQ9F9ys=
kubedb.dev/db-client-go v0.0.0-20211102100133-9d4b23e3d1c5/go.mod h1:z5qHbfnNuEg9ORXi6gmc+8WNeKjNfaPs1GL2JLYS838=
kubedb.dev/elasticsearch v0.23.0 h1:FewhB/5eGcxQXDWznCvHmB2FXKQPyyP9I2rPeieUZeY=
2 changes: 1 addition & 1 deletion vendor/go.bytebuilders.dev/audit/lib/nats.go
Original file line number Diff line number Diff line change
@@ -61,7 +61,7 @@ func NewNatsConfig(clusterID string, LicenseFile string) (*NatsConfig, error) {

opts := verifier.Options{
ClusterUID: clusterID,
Features: info.ProductName,
Features: info.Features(),
CACert: []byte(info.LicenseCA),
License: licenseBytes,
}
4 changes: 2 additions & 2 deletions vendor/go.bytebuilders.dev/license-verifier/Makefile
Original file line number Diff line number Diff line change
@@ -61,8 +61,8 @@ BIN_PLATFORMS := $(DOCKER_PLATFORMS) windows/amd64 darwin/amd64
OS := $(if $(GOOS),$(GOOS),$(shell go env GOOS))
ARCH := $(if $(GOARCH),$(GOARCH),$(shell go env GOARCH))

BASEIMAGE_PROD ?= gcr.io/distroless/static-debian10
BASEIMAGE_DBG ?= debian:buster
BASEIMAGE_PROD ?= gcr.io/distroless/static-debian11
BASEIMAGE_DBG ?= debian:bullseye

GO_VERSION ?= 1.17
BUILD_IMAGE ?= appscode/golang-dev:$(GO_VERSION)
8 changes: 8 additions & 0 deletions vendor/go.bytebuilders.dev/license-verifier/info/lib.go
Original file line number Diff line number Diff line change
@@ -20,6 +20,8 @@ import (
"net/url"
"path"
"strconv"
"strings"
"unicode"
)

var (
@@ -37,6 +39,12 @@ var (
registrationAPIPath = "api/v1/register"
)

func Features() []string {
return strings.FieldsFunc(ProductName, func(r rune) bool {
return unicode.IsSpace(r) || r == ',' || r == ';'
})
}

func SkipLicenseVerification() bool {
v, _ := strconv.ParseBool(EnforceLicense)
return !v
6 changes: 3 additions & 3 deletions vendor/go.bytebuilders.dev/license-verifier/kubernetes/lib.go
Original file line number Diff line number Diff line change
@@ -74,7 +74,7 @@ func NewLicenseEnforcer(config *rest.Config, licenseFile string) *LicenseEnforce
config: config,
opts: &verifier.Options{
CACert: []byte(info.LicenseCA),
Features: info.ProductName,
Features: info.Features(),
},
}
}
@@ -227,7 +227,7 @@ func VerifyLicensePeriodically(config *rest.Config, licenseFile string, stopCh <
config: config,
opts: &verifier.Options{
CACert: []byte(info.LicenseCA),
Features: info.ProductName,
Features: info.Features(),
},
}

@@ -286,7 +286,7 @@ func CheckLicenseFile(config *rest.Config, licenseFile string) error {
config: config,
opts: &verifier.Options{
CACert: []byte(info.LicenseCA),
Features: info.ProductName,
Features: info.Features(),
},
}

11 changes: 3 additions & 8 deletions vendor/go.bytebuilders.dev/license-verifier/lib.go
Original file line number Diff line number Diff line change
@@ -20,10 +20,8 @@ import (
"crypto/x509"
"encoding/pem"
"fmt"
"strings"
"unicode"

"go.bytebuilders.dev/license-verifier/apis/licenses/v1alpha1"
"strings"

"github.com/pkg/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -32,7 +30,7 @@ import (

type Options struct {
ClusterUID string `json:"clusterUID"`
Features string `json:"features"`
Features []string `json:"features"`
CACert []byte `json:"caCert,omitempty"`
License []byte `json:"license"`
}
@@ -165,10 +163,7 @@ func VerifyLicense(opts *Options) (v1alpha1.License, error) {
license.Reason = e2.Error()
return license, e2
}
features := strings.FieldsFunc(opts.Features, func(r rune) bool {
return unicode.IsSpace(r) || r == ',' || r == ';'
})
if !sets.NewString(cert.Subject.Organization...).HasAny(features...) {
if !sets.NewString(cert.Subject.Organization...).HasAny(opts.Features...) {
e2 := fmt.Errorf("license was not issued for %s", opts.Features)
license.Status = v1alpha1.LicenseExpired
license.Reason = e2.Error()
8 changes: 1 addition & 7 deletions vendor/kmodules.xyz/client-go/Makefile
Original file line number Diff line number Diff line change
@@ -25,13 +25,7 @@ CODE_GENERATOR_IMAGE ?= appscode/gengo:release-1.21
git_branch := $(shell git rev-parse --abbrev-ref HEAD)
git_tag := $(shell git describe --exact-match --abbrev=0 2>/dev/null || echo "")
commit_hash := $(shell git rev-parse --verify HEAD)
OS ?= $(shell uname -s)
ifeq ($(OS),Linux)
commit_timestamp := $(shell date --date="@$$(git show -s --format=%ct)" --utc +%FT%T)
endif
ifeq ($(OS),Darwin)
commit_timestamp := $(shell date -r "$$(git show -s --format=%ct)" -u +%FT%T)
endif
commit_timestamp := $(shell date --date="@$$(git show -s --format=%ct)" --utc +%FT%T)

VERSION := $(shell git describe --tags --always --dirty)
version_strategy := commit_hash
13 changes: 13 additions & 0 deletions vendor/kmodules.xyz/client-go/dynamic/kubernetes.go
Original file line number Diff line number Diff line change
@@ -386,3 +386,16 @@ func ResourcesNotExists(
}
return true, nil
}

func ClusterUID(client dynamic.Interface) (string, error) {
ns, err := client.Resource(schema.GroupVersionResource{
Group: "",
Version: "v1",
Resource: "namespaces",
}).Get(context.TODO(), "kube-system", metav1.GetOptions{})
if err != nil {
return "", err
}
clusterID, _, err := unstructured.NestedString(ns.UnstructuredContent(), "metadata", "uid")
return clusterID, err
}

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

Original file line number Diff line number Diff line change
@@ -38,8 +38,8 @@ const (
type SiteInfo struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Product *ProductInfo `json:"product,omitempty"`
Kubernetes KubernetesInfo `json:"kubernetes"`
Product *ProductInfo `json:"product,omitempty"`
Kubernetes *KubernetesInfo `json:"kubernetes,omitempty"`
}

type Version struct {

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

Original file line number Diff line number Diff line change
@@ -169,8 +169,6 @@ spec:
required:
- version
type: object
required:
- kubernetes
type: object
served: true
storage: true
1 change: 1 addition & 0 deletions vendor/kmodules.xyz/custom-resources/util/siteinfo/lib.go
Original file line number Diff line number Diff line change
@@ -41,6 +41,7 @@ func GetSiteInfo(cfg *rest.Config, kc kubernetes.Interface, nodes []*core.Node,
APIVersion: auditorapi.SchemeGroupVersion.String(),
Kind: "SiteInfo",
},
Kubernetes: &auditorapi.KubernetesInfo{},
}

if info.ProductName != "" || v.Version.Version != "" || licenseID != "" {
28 changes: 28 additions & 0 deletions vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/helpers.go
Original file line number Diff line number Diff line change
@@ -21,6 +21,7 @@ import (

core "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
appslister "k8s.io/client-go/listers/apps/v1"
apps_util "kmodules.xyz/client-go/apps/v1"
@@ -121,6 +122,33 @@ func SetDefaultResourceLimits(req *core.ResourceRequirements, defaultResources c
}
}

func GetDatabasePods(db metav1.Object, stsLister appslister.StatefulSetLister, pods []core.Pod) ([]core.Pod, error) {
var dbPods []core.Pod

for i := range pods {
owner := metav1.GetControllerOf(&pods[i])
if owner == nil {
continue
}

// If the Pod is not control by a StatefulSet, then it is not a KubeDB database Pod
if owner.Kind == ResourceKindStatefulSet {
// Find the controlling StatefulSet
sts, err := stsLister.StatefulSets(db.GetNamespace()).Get(owner.Name)
if err != nil {
return nil, err
}

// Check if the StatefulSet is controlled by the database
if metav1.IsControlledBy(sts, db) {
dbPods = append(dbPods, pods[i])
}
}
}

return dbPods, nil
}

// Upsert elements to string slice
func upsertStringSlice(inSlice []string, values ...string) []string {
upsert := func(m string) {
22 changes: 22 additions & 0 deletions vendor/kubedb.dev/apimachinery/apis/ui/register.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
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 ui

const (
// GroupName is the group name use in this package
GroupName = "ui.kubedb.com"
)
Loading

0 comments on commit 0a153b6

Please sign in to comment.