Skip to content

Commit

Permalink
feat: hide rethinkdb port from endpoints (#2322)
Browse files Browse the repository at this point in the history
Signed-off-by: Javier López Barba <javier@okteto.com>
  • Loading branch information
jLopezbarb committed Mar 7, 2022
1 parent e8dedf5 commit 6617c18
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/model/stack_serializer.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ func getEndpointsFromPorts(services map[string]*ServiceRaw) EndpointSpec {
func getAccessiblePorts(ports []PortRaw) []PortRaw {
accessiblePorts := make([]PortRaw, 0)
for _, p := range ports {
if p.HostPort != 0 && !IsSkippablePort(p.ContainerPort) {
if p.HostPort != 0 && !isSkippablePort(p.ContainerPort) {
accessiblePorts = append(accessiblePorts, p)
}
}
Expand Down Expand Up @@ -883,7 +883,7 @@ func getPortWithMapping(p *PortRaw, portString string) error {
if err != nil {
return err
}
if IsSkippablePort(p.HostPort) {
if isSkippablePort(p.HostPort) {
p.HostPort = 0
}

Expand All @@ -901,12 +901,12 @@ func getPortWithMapping(p *PortRaw, portString string) error {
return nil
}

func IsSkippablePort(port int32) bool {
func isSkippablePort(port int32) bool {
skippablePorts := map[int32]string{3306: "MySQL", 1521: "OracleDB", 1830: "OracleDB", 5432: "PostgreSQL",
1433: "SQL Server", 1434: "SQL Server", 7210: "MaxDB", 7473: "Neo4j", 7474: "Neo4j", 8529: "ArangoDB",
7000: "Cassandra", 7001: "Cassandra", 9042: "Cassandra", 8086: "InfluxDB", 9200: "Elasticsearch", 9300: "Elasticsearch",
5984: "CouchDB", 27017: "MongoDB", 27018: "MongoDB", 27019: "MongoDB", 28017: "MongoDB", 6379: "Redis",
8087: "Riak", 8098: "Riak", 828015: "Rethink", 29015: "Rethink", 7574: "Solr", 8983: "Solr",
8087: "Riak", 8098: "Riak", 828015: "Rethink", 29015: "Rethink", 28015: "Rethink", 7574: "Solr", 8983: "Solr",
2345: "Golang debugger", 5858: "Node debugger", 9229: "Node debugger", 5005: "Java debugger", 1234: "Ruby debugger",
4444: "Python pdb", 5678: "Python debugpy"}
if _, ok := skippablePorts[port]; ok {
Expand Down

0 comments on commit 6617c18

Please sign in to comment.