Skip to content

Commit

Permalink
Add CAPIClusterInfo, ClusterManagers field in ClusterInfo status (#76)
Browse files Browse the repository at this point in the history
* Add CAPIClusterInfo, ClusterManagers field in ClusterInfo status

Signed-off-by: Masudur Rahman <masud@appscode.com>

* Remove redundant code

Signed-off-by: Masudur Rahman <masud@appscode.com>

* Add TricksterReference label

Signed-off-by: Masudur Rahman <masud@appscode.com>

---------

Signed-off-by: Masudur Rahman <masud@appscode.com>
  • Loading branch information
masudur-rahman authored Sep 22, 2023
1 parent 15c9d93 commit 2f8e112
Show file tree
Hide file tree
Showing 76 changed files with 16,947 additions and 40 deletions.
1 change: 1 addition & 0 deletions apis/cluster/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const (
LabelClusterExternalID = "byte.builders/cluster-external-id"

LabelClusterConnectorLinkID = "byte.builders/cluster-connector-link-id"
LabelTricksterReference = "byte.builders/cluster"
)

const (
Expand Down
6 changes: 6 additions & 0 deletions apis/cluster/v1alpha1/cluster_info_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package v1alpha1

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
kmapi "kmodules.xyz/client-go/api/v1"
)

const (
Expand Down Expand Up @@ -140,4 +141,9 @@ type ClusterInfoStatus struct {
// Message specifies additional information regarding the possible actions for the user
// +optional
Message string `json:"message,omitempty" protobuf:"bytes,4,opt,name=message"`
// +optional
ClusterManagers []string `json:"clusterManagers,omitempty"`
// CAPIClusterInfo contains capi cluster information if the cluster is created by cluster-api
// +optional
CAPIClusterInfo *kmapi.CAPIClusterInfo `json:"capiClusterInfo,omitempty"`
}
13 changes: 12 additions & 1 deletion apis/cluster/v1alpha1/zz_generated.deepcopy.go

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

15 changes: 15 additions & 0 deletions crds/cluster.bytebuilders.dev_clusterinfos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,21 @@ spec:
type: object
status:
properties:
capiClusterInfo:
description: CAPIClusterInfo contains capi cluster information if
the cluster is created by cluster-api
properties:
clusterName:
type: string
namespace:
type: string
provider:
type: string
type: object
clusterManagers:
items:
type: string
type: array
message:
description: Message specifies additional information regarding the
possible actions for the user
Expand Down
8 changes: 5 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ require (
k8s.io/apimachinery v0.25.3
k8s.io/client-go v0.25.3
k8s.io/klog/v2 v2.80.1
kmodules.xyz/client-go v0.25.24
kmodules.xyz/client-go v0.25.34-0.20230920051128-f758ec0276ab
kmodules.xyz/crd-schema-fuzz v0.25.0
sigs.k8s.io/yaml v1.3.0
)
Expand All @@ -45,6 +45,7 @@ require (
github.com/dustin/go-humanize v1.0.1-0.20220316001817-d5090ed65664 // indirect
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/fatih/structs v1.1.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
Expand All @@ -65,6 +66,7 @@ require (
github.com/googleapis/gax-go/v2 v2.7.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/howeyc/gopass v0.0.0-20210920133722-c8aef6fb66ef // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/inconshreveable/mousetrap v1.0.1 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
Expand All @@ -79,7 +81,6 @@ require (
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/moul/gotty-client v1.10.0 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/onsi/ginkgo v1.16.5 // indirect
github.com/onsi/gomega v1.20.2 // indirect
github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect
github.com/renstrom/fuzzysearch v0.0.0-00010101000000-000000000000 // indirect
Expand All @@ -98,7 +99,7 @@ require (
golang.org/x/text v0.7.0 // indirect
golang.org/x/time v0.3.0 // indirect
gomodules.xyz/clock v0.0.0-20200817085942-06523dba733f // indirect
gomodules.xyz/jsonpatch/v2 v2.3.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
gomodules.xyz/sets v0.2.1 // indirect
gomodules.xyz/wait v0.2.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
Expand All @@ -115,6 +116,7 @@ require (
k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 // indirect
moul.io/anonuuid v1.3.2 // indirect
moul.io/srand v1.6.1 // indirect
sigs.k8s.io/controller-runtime v0.13.1 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
)
Expand Down
Loading

0 comments on commit 2f8e112

Please sign in to comment.