Skip to content

Commit

Permalink
feat: add cluster topology and refactor relationship package
Browse files Browse the repository at this point in the history
  • Loading branch information
ffforest committed Nov 28, 2023
1 parent e6ee68c commit 39dc419
Show file tree
Hide file tree
Showing 13 changed files with 450 additions and 131 deletions.
13 changes: 12 additions & 1 deletion pkg/apis/cluster/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ limitations under the License.

package cluster

import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

type CredentialType string

Expand Down Expand Up @@ -54,8 +56,17 @@ type ClusterSpec struct {
Finalized *bool
}

// +k8s:deepcopy-gen=true

type ClusterTopology struct {
GroupVersionKind string
Count int
Relationship map[string]string
}

type ClusterStatus struct {
Healthy bool
Graph map[string]ClusterTopology
}

type ClusterAccess struct {
Expand Down
15 changes: 13 additions & 2 deletions pkg/apis/cluster/v1beta1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ limitations under the License.

package v1beta1

import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

type CredentialType string

Expand Down Expand Up @@ -57,9 +59,18 @@ type ClusterSpec struct {
Finalized *bool `json:"finalized,omitempty"`
}

// +k8s:deepcopy-gen=true

type ClusterTopology struct {
GroupVersionKind string
Count int
Relationship map[string]string
}

type ClusterStatus struct {
// +optional
Healthy bool `json:"healthy,omitempty"`
Healthy bool `json:"healthy,omitempty"`
Graph map[string]ClusterTopology `json:"graph,omitempty"`
}

type ClusterAccess struct {
Expand Down
36 changes: 36 additions & 0 deletions pkg/apis/cluster/v1beta1/zz_generated.conversion.go

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

32 changes: 31 additions & 1 deletion pkg/apis/cluster/v1beta1/zz_generated.deepcopy.go

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

32 changes: 31 additions & 1 deletion pkg/apis/cluster/zz_generated.deepcopy.go

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

59 changes: 59 additions & 0 deletions pkg/generated/openapi/zz_generated.openapi.go

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

Loading

0 comments on commit 39dc419

Please sign in to comment.