Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ metadata:
name: some-name
spec:
ports:
- name: mongodb
- appProtocol: mongo
name: mongodb
port: 27017
protocol: TCP
targetPort: 27017
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ metadata:
name: some-name
spec:
ports:
- name: mongodb
- appProtocol: mongo
name: mongodb
port: 27017
protocol: TCP
targetPort: 27017
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ metadata:
name: some-name
spec:
ports:
- name: mongodb
- appProtocol: mongo
name: mongodb
port: 27017
protocol: TCP
targetPort: 27017
Expand Down
14 changes: 12 additions & 2 deletions pkg/psmdb/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,12 @@ func Service(cr *api.PerconaServerMongoDB, replset *api.ReplsetSpec) *corev1.Ser
}
}
}

if cr.CompareVersion("1.16.0") >= 0 {
appProtocol := "mongo"
for _, v := range svc.Spec.Ports {
v.AppProtocol = &appProtocol
}
}
return svc
}

Expand Down Expand Up @@ -118,7 +123,12 @@ func ExternalService(cr *api.PerconaServerMongoDB, replset *api.ReplsetSpec, pod
default:
svc.Spec.Type = corev1.ServiceTypeClusterIP
}

if cr.CompareVersion("1.16.0") >= 0 {
appProtocol := "mongo"
for _, v := range svc.Spec.Ports {
v.AppProtocol = &appProtocol
}
}
return svc
}

Expand Down