Skip to content

Commit

Permalink
Fixing lint error by having namespace and partition directly
Browse files Browse the repository at this point in the history
  • Loading branch information
tauhid621 committed Jan 5, 2024
1 parent 9254834 commit 63c9cd0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 5 additions & 3 deletions api/config_entry_exports.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ package api

import (
"encoding/json"

"github.com/hashicorp/consul/acl"
)

// ExportedServicesConfigEntry manages the exported services for a single admin partition.
Expand Down Expand Up @@ -89,7 +87,11 @@ type ResolvedExportedService struct {
// Service is the name of the service which is exported.
Service string

acl.EnterpriseMeta `hcl:",squash" mapstructure:",squash"`
// Partition of the service
Partition string `json:",omitempty"`

// Namespace of the service
Namespace string `json:",omitempty"`

// Consumers is a list of downstream consumers of the service.
Consumers ResolvedConsumers
Expand Down
6 changes: 5 additions & 1 deletion proto/private/pbconfigentry/config_entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,11 @@ func (r *ResolvedExportedService) ToAPI() *api.ResolvedExportedService {
var t api.ResolvedExportedService

t.Service = r.Service
pbcommon.EnterpriseMetaToStructs(r.EnterpriseMeta, &t.EnterpriseMeta)
if r.EnterpriseMeta != nil {
t.Namespace = r.EnterpriseMeta.Namespace
t.Partition = r.EnterpriseMeta.Partition
}

t.Consumers.Peers = r.Consumers.Peers
t.Consumers.Partitions = r.Consumers.Partitions

Expand Down

0 comments on commit 63c9cd0

Please sign in to comment.