Skip to content

Commit

Permalink
Merge pull request #494 from freehan/bug-fix
Browse files Browse the repository at this point in the history
include NEG naming scheme for NameBelongsToCluster
  • Loading branch information
k8s-ci-robot authored Sep 25, 2018
2 parents 2b6d216 + b3522bb commit b04a367
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/utils/namer.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ func (n *Namer) negBelongsToCluster(name string) bool {
// NameBelongsToCluster checks if a given name is tagged with this
// cluster's UID.
func (n *Namer) NameBelongsToCluster(name string) bool {
if !strings.HasPrefix(name, n.prefix+"-") {
if !strings.HasPrefix(name, n.prefix) {
return false
}
clusterName := n.UID()
Expand Down
1 change: 1 addition & 0 deletions pkg/utils/namer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ func TestNameBelongsToCluster(t *testing.T) {
namer.ForwardingRule(lbName, HTTPProtocol),
namer.ForwardingRule(lbName, HTTPSProtocol),
namer.UrlMap(lbName),
namer.NEG("ns", "n", int32(80)),
} {
if !namer.NameBelongsToCluster(tc) {
t.Errorf("namer.NameBelongsToCluster(%q) = false, want true", tc)
Expand Down

0 comments on commit b04a367

Please sign in to comment.