Skip to content

Commit

Permalink
Merge branch 'master' into vv
Browse files Browse the repository at this point in the history
  • Loading branch information
RokibulHasan7 authored Mar 7, 2024
2 parents e4f6e90 + 5567683 commit d24fd06
Show file tree
Hide file tree
Showing 120 changed files with 1,547 additions and 2,358 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
name: Build
runs-on: ubuntu-20.04
steps:
- name: Set up Go 1.21
- name: Set up Go 1.22
uses: actions/setup-go@v1
with:
go-version: '1.21'
go-version: '1.22'
id: go

- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion 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-debian11
BASEIMAGE_DBG ?= debian:bullseye

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

OUTBIN = bin/$(OS)_$(ARCH)/$(BIN)
Expand Down
17 changes: 11 additions & 6 deletions cluster/lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,24 +116,29 @@ func getProviderName(kind string) string {
return ""
}

func DetectClusterManager(kc client.Client) kmapi.ClusterManager {
func DetectClusterManager(kc client.Client, mappers ...meta.RESTMapper) kmapi.ClusterManager {
mapper := kc.RESTMapper()
if len(mappers) > 0 {
mapper = mappers[0]
}

var result kmapi.ClusterManager
if IsACEManaged(kc) {
result |= kmapi.ClusterManagerACE
}
if IsOpenClusterHub(kc.RESTMapper()) {
if IsOpenClusterHub(mapper) {
result |= kmapi.ClusterManagerOCMHub
}
if IsOpenClusterSpoke(kc.RESTMapper()) {
if IsOpenClusterSpoke(mapper) {
result |= kmapi.ClusterManagerOCMSpoke
}
if IsOpenClusterMulticlusterControlplane(kc.RESTMapper()) {
if IsOpenClusterMulticlusterControlplane(mapper) {
result |= kmapi.ClusterManagerOCMMulticlusterControlplane
}
if IsRancherManaged(kc.RESTMapper()) {
if IsRancherManaged(mapper) {
result |= kmapi.ClusterManagerRancher
}
if IsOpenShiftManaged(kc.RESTMapper()) {
if IsOpenShiftManaged(mapper) {
result |= kmapi.ClusterManagerOpenShift
}
if MustIsVirtualCluster(kc) {
Expand Down
60 changes: 31 additions & 29 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,47 +1,49 @@
module kmodules.xyz/client-go

go 1.21.5
go 1.22.0

toolchain go1.22.1

require (
github.com/Masterminds/semver/v3 v3.2.1
github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8
github.com/davecgh/go-spew v1.1.1
github.com/evanphx/json-patch v5.7.0+incompatible
github.com/evanphx/json-patch v4.12.0+incompatible
github.com/fatih/structs v1.1.0
github.com/fsnotify/fsnotify v1.7.0
github.com/gabriel-vasile/mimetype v1.4.2
github.com/gabriel-vasile/mimetype v1.4.3
github.com/go-logr/logr v1.4.1
github.com/gogo/protobuf v1.3.2
github.com/google/go-cmp v0.6.0
github.com/google/go-containerregistry v0.16.1
github.com/google/go-containerregistry v0.19.0
github.com/google/gofuzz v1.2.0
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79
github.com/imdario/mergo v0.3.6
github.com/json-iterator/go v1.1.12
github.com/mitchellh/mapstructure v1.4.1
github.com/onsi/gomega v1.30.0
github.com/mitchellh/mapstructure v1.5.0
github.com/onsi/gomega v1.31.1
github.com/pkg/errors v0.9.1
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.8.4
github.com/stretchr/testify v1.9.0
github.com/yudai/gojsondiff v1.0.0
github.com/zeebo/xxh3 v1.0.2
golang.org/x/time v0.3.0
golang.org/x/time v0.5.0
gomodules.xyz/jsonpatch/v2 v2.4.0
gomodules.xyz/mergo v0.3.13
gomodules.xyz/pointer v0.1.0
gomodules.xyz/sync v0.1.0
gomodules.xyz/x v0.0.15
k8s.io/api v0.29.0
k8s.io/apiextensions-apiserver v0.29.0
k8s.io/apimachinery v0.29.0
k8s.io/apiserver v0.29.0
k8s.io/cli-runtime v0.29.0
k8s.io/client-go v0.29.0
k8s.io/klog/v2 v2.110.1
k8s.io/kube-aggregator v0.29.0
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00
gomodules.xyz/x v0.0.17
k8s.io/api v0.29.2
k8s.io/apiextensions-apiserver v0.29.2
k8s.io/apimachinery v0.29.2
k8s.io/apiserver v0.29.2
k8s.io/cli-runtime v0.29.2
k8s.io/client-go v0.29.2
k8s.io/klog/v2 v2.120.1
k8s.io/kube-aggregator v0.29.2
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340
kmodules.xyz/apiversion v0.2.0
sigs.k8s.io/controller-runtime v0.17.0
sigs.k8s.io/controller-runtime v0.17.2
sigs.k8s.io/yaml v1.4.0
)

Expand Down Expand Up @@ -70,7 +72,7 @@ require (
github.com/google/cel-go v0.17.7 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 // indirect
Expand All @@ -96,7 +98,7 @@ require (
github.com/prometheus/common v0.45.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/sergi/go-diff v1.1.0 // indirect
github.com/spf13/cobra v1.7.0 // indirect
github.com/spf13/cobra v1.8.0 // indirect
github.com/stoewer/go-strcase v1.2.0 // indirect
github.com/xlab/treeprint v1.2.0 // indirect
github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 // indirect
Expand All @@ -116,13 +118,13 @@ require (
go.starlark.net v0.0.0-20230525235612-a134d8f9ddca // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.26.0 // indirect
golang.org/x/crypto v0.17.0 // indirect
golang.org/x/exp v0.0.0-20220827204233-334a2380cb91 // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/crypto v0.19.0 // indirect
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
golang.org/x/net v0.21.0 // indirect
golang.org/x/oauth2 v0.12.0 // indirect
golang.org/x/sync v0.5.0 // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/term v0.15.0 // indirect
golang.org/x/sys v0.17.0 // indirect
golang.org/x/term v0.17.0 // indirect
golang.org/x/text v0.14.0 // indirect
gomodules.xyz/homedir v0.1.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
Expand All @@ -135,8 +137,8 @@ require (
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/component-base v0.29.0 // indirect
k8s.io/kms v0.29.0 // indirect
k8s.io/component-base v0.29.2 // indirect
k8s.io/kms v0.29.2 // indirect
k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.28.0 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
Expand Down
Loading

0 comments on commit d24fd06

Please sign in to comment.