Skip to content

Commit

Permalink
Rename team label to well-known team label
Browse files Browse the repository at this point in the history
  • Loading branch information
wpjunior committed Oct 16, 2024
1 parent 0f3be9c commit e069482
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 10 additions & 10 deletions kubernetes/ingress_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func TestIngressEnsure(t *testing.T) {
expectedIngress.Labels["controller"] = "my-controller"
expectedIngress.Labels["XPTO"] = "true"
expectedIngress.Labels["tsuru.io/app-name"] = "test"
expectedIngress.Labels["tsuru.io/team-name"] = "default"
expectedIngress.Labels["tsuru.io/app-team"] = "default"
expectedIngress.Annotations["ann1"] = "val1"
expectedIngress.Annotations["ann2"] = "val2"

Expand Down Expand Up @@ -397,7 +397,7 @@ func TestIngressEnsureWithCNames(t *testing.T) {
expectedIngress.Labels["controller"] = "my-controller"
expectedIngress.Labels["XPTO"] = "true"
expectedIngress.Labels["tsuru.io/app-name"] = "test"
expectedIngress.Labels["tsuru.io/team-name"] = "default"
expectedIngress.Labels["tsuru.io/app-team"] = "default"
expectedIngress.Annotations["ann1"] = "val1"
expectedIngress.Annotations["ann2"] = "val2"
expectedIngress.Annotations["router.tsuru.io/cnames"] = "test.io,www.test.io"
Expand Down Expand Up @@ -614,7 +614,7 @@ func TestIngressCreateDefaultClass(t *testing.T) {
expectedIngress.Labels["controller"] = "my-controller"
expectedIngress.Labels["XPTO"] = "true"
expectedIngress.Labels["tsuru.io/app-name"] = "test"
expectedIngress.Labels["tsuru.io/team-name"] = "default"
expectedIngress.Labels["tsuru.io/app-team"] = "default"
expectedIngress.Annotations["ann1"] = "val1"
expectedIngress.Annotations["ann2"] = "val2"
expectedIngress.Annotations["kubernetes.io/ingress.class"] = "nginx"
Expand Down Expand Up @@ -650,7 +650,7 @@ func TestIngressEnsureDefaultClassOverride(t *testing.T) {
expectedIngress.Labels["controller"] = "my-controller"
expectedIngress.Labels["XPTO"] = "true"
expectedIngress.Labels["tsuru.io/app-name"] = "test"
expectedIngress.Labels["tsuru.io/team-name"] = "default"
expectedIngress.Labels["tsuru.io/app-team"] = "default"
expectedIngress.Annotations["ann1"] = "val1"
expectedIngress.Annotations["ann2"] = "val2"
expectedIngress.Annotations["kubernetes.io/ingress.class"] = "xyz"
Expand Down Expand Up @@ -689,7 +689,7 @@ func TestIngressEnsureDefaultPrefix(t *testing.T) {
expectedIngress.Labels["controller"] = "my-controller"
expectedIngress.Labels["XPTO"] = "true"
expectedIngress.Labels["tsuru.io/app-name"] = "test"
expectedIngress.Labels["tsuru.io/team-name"] = "default"
expectedIngress.Labels["tsuru.io/app-team"] = "default"
expectedIngress.Annotations["ann1"] = "val1"
expectedIngress.Annotations["ann2"] = "val2"
expectedIngress.Annotations["my.prefix.com/foo1"] = "xyz"
Expand Down Expand Up @@ -727,7 +727,7 @@ func TestIngressEnsureRemoveAnnotation(t *testing.T) {
expectedIngress.Labels["controller"] = "my-controller"
expectedIngress.Labels["XPTO"] = "true"
expectedIngress.Labels["tsuru.io/app-name"] = "test"
expectedIngress.Labels["tsuru.io/team-name"] = "default"
expectedIngress.Labels["tsuru.io/app-team"] = "default"
expectedIngress.Annotations["ann2"] = "val2"

assert.Equal(t, expectedIngress, foundIngress)
Expand Down Expand Up @@ -1394,7 +1394,7 @@ func TestEnsureWithTLSAndCName(t *testing.T) {

expectedIngress := defaultIngress("test", "default")
expectedIngress.Labels["tsuru.io/app-name"] = "test"
expectedIngress.Labels["tsuru.io/team-name"] = "default"
expectedIngress.Labels["tsuru.io/app-team"] = "default"
expectedIngress.Annotations["router.tsuru.io/cnames"] = "test.io"
expectedIngress.Annotations["kubernetes.io/tls-acme"] = "true"
expectedIngress.Annotations["cert-manager.io/cluster-issuer"] = "letsencrypt-prod"
Expand All @@ -1414,7 +1414,7 @@ func TestEnsureWithTLSAndCName(t *testing.T) {
expectedIngress.Name = "kubernetes-router-cname-test.io"
expectedIngress.Labels["router.tsuru.io/is-cname-ingress"] = "true"
expectedIngress.Labels["tsuru.io/app-name"] = "test"
expectedIngress.Labels["tsuru.io/team-name"] = "default"
expectedIngress.Labels["tsuru.io/app-team"] = "default"

assert.Equal(t, expectedIngress, foundIngress)
}
Expand Down Expand Up @@ -1443,7 +1443,7 @@ func TestEnsureWithTLSAndCNameAndAcmeCName(t *testing.T) {

expectedIngress := defaultIngress("test", "default")
expectedIngress.Labels["tsuru.io/app-name"] = "test"
expectedIngress.Labels["tsuru.io/team-name"] = "default"
expectedIngress.Labels["tsuru.io/app-team"] = "default"
expectedIngress.Annotations["router.tsuru.io/cnames"] = "test.io"
expectedIngress.Annotations["kubernetes.io/tls-acme"] = "true"
expectedIngress.Spec.TLS = []networkingV1.IngressTLS{
Expand All @@ -1461,7 +1461,7 @@ func TestEnsureWithTLSAndCNameAndAcmeCName(t *testing.T) {
expectedIngress.Spec.Rules[0].Host = "test.io"
expectedIngress.Name = "kubernetes-router-cname-test.io"
expectedIngress.Labels["tsuru.io/app-name"] = "test"
expectedIngress.Labels["tsuru.io/team-name"] = "default"
expectedIngress.Labels["tsuru.io/app-team"] = "default"
expectedIngress.Labels["router.tsuru.io/is-cname-ingress"] = "true"
expectedIngress.Annotations["kubernetes.io/tls-acme"] = "true"

Expand Down
2 changes: 1 addition & 1 deletion kubernetes/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const (

defaultServicePort = 8888
appLabel = "tsuru.io/app-name"
teamLabel = "tsuru.io/team-name"
teamLabel = "tsuru.io/app-team"
domainLabel = "tsuru.io/domain-name"
processLabel = "tsuru.io/app-process"
appPoolLabel = "tsuru.io/app-pool"
Expand Down

0 comments on commit e069482

Please sign in to comment.