Skip to content

Commit

Permalink
Set ExternalID label in ClusterInfo Resource (#65)
Browse files Browse the repository at this point in the history
Signed-off-by: Masudur Rahman <[email protected]>
  • Loading branch information
masudur-rahman authored Mar 23, 2023
1 parent f0ffde3 commit 6bbe08b
Show file tree
Hide file tree
Showing 10 changed files with 481 additions and 341 deletions.
218 changes: 109 additions & 109 deletions apis/cloud/v1alpha1/generated.pb.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apis/cloud/v1alpha1/generated.proto

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

1 change: 1 addition & 0 deletions apis/cluster/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const (
LabelClusterOwnerID = "byte.builders/cluster-owner-id"
LabelClusterProvider = "byte.builders/cluster-provider"
LabelClusterImportType = "byte.builders/cluster-import-type"
LabelClusterExternalID = "byte.builders/cluster-external-id"

LabelClusterConnectorLinkID = "byte.builders/cluster-connector-link-id"
)
Expand Down
7 changes: 6 additions & 1 deletion apis/cluster/v1alpha1/cluster_info_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ type ClusterOptions struct {
CID string `protobuf:"bytes,4,opt,name=cID"`
OwnerID int64 `protobuf:"varint,5,opt,name=ownerID"`
ImportType string `protobuf:"bytes,6,opt,name=importType"`
ConnectorLinkID string `protobuf:"bytes,7,opt,name=connectorLinkID"`
ExternalID string `protobuf:"bytes,7,opt,name=externalID"`
ConnectorLinkID string `protobuf:"bytes,8,opt,name=connectorLinkID"`
}

func (_ ClusterInfo) CustomResourceDefinition() *apiextensions.CustomResourceDefinition {
Expand All @@ -47,6 +48,7 @@ func (clusterInfo *ClusterInfo) SetLabels(opts ClusterOptions) {
cluster.LabelClusterOwnerID: strconv.FormatInt(opts.OwnerID, 10),
cluster.LabelClusterProvider: opts.Provider,
cluster.LabelClusterImportType: opts.ImportType,
cluster.LabelClusterExternalID: opts.ExternalID,
}

if len(opts.ConnectorLinkID) > 0 {
Expand Down Expand Up @@ -74,6 +76,9 @@ func (_ ClusterInfo) FormatLabels(opts ClusterOptions) string {
if opts.ImportType != "" {
labelMap[cluster.LabelClusterImportType] = opts.ImportType
}
if opts.ExternalID != "" {
labelMap[cluster.LabelClusterExternalID] = opts.ExternalID
}
if opts.ConnectorLinkID != "" {
labelMap[cluster.LabelClusterConnectorLinkID] = opts.ConnectorLinkID
}
Expand Down
359 changes: 241 additions & 118 deletions apis/cluster/v1alpha1/generated.pb.go

Large diffs are not rendered by default.

14 changes: 12 additions & 2 deletions apis/cluster/v1alpha1/generated.proto

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

128 changes: 64 additions & 64 deletions apis/identity/v1alpha1/generated.pb.go

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

2 changes: 1 addition & 1 deletion apis/identity/v1alpha1/generated.proto

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

Loading

0 comments on commit 6bbe08b

Please sign in to comment.