Skip to content

Commit

Permalink
tweaks from review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
rocktavious committed Sep 29, 2021
1 parent cb93627 commit 29531af
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
1 change: 0 additions & 1 deletion src/common/jqparser.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"github.com/opslevel/kubectl-opslevel/jq"

"github.com/rs/zerolog/log"
_ "github.com/rs/zerolog/log"
)

type JQParser struct {
Expand Down
18 changes: 1 addition & 17 deletions src/common/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func Parse(field string, c config.ServiceRegistrationConfig, count int, resource
Languages := parseField(fmt.Sprintf("%s.language", field), c.Language, resources)
Frameworks := parseField(fmt.Sprintf("%s.framework", field), c.Framework, resources)
Aliases := parseFieldArray(fmt.Sprintf("%s.aliases", field), c.Aliases, resources)
if len(Aliases) < 1 {
if len(Aliases) < 1 {
Aliases = append(Aliases, parseField("Auto Added Alias", "\"k8s:\\(.metadata.name)-\\(.metadata.namespace)\"", resources))
}
TagAssigns := parseFieldArray(fmt.Sprintf("%s.tags.assign", field), c.Tags.Assign, resources)
Expand Down Expand Up @@ -303,22 +303,6 @@ func QueryForServices(c *config.Config) ([]ServiceRegistration, error) {
}
services = append(services, parsedServices...)
}

// Dedup Service Registrations
/*
input = services
output = []
for i in input:
wasMerged := false
for j in output:
if anyOverlaps(i.aliases, j.aliases):
j.Merge(i)
wasMerged = true
break
if !wasMerged :
output = append(output, i)
*/

return services, nil
}

Expand Down

0 comments on commit 29531af

Please sign in to comment.