Skip to content

Commit 1d50630

Browse files
steelingnshankar13
authored andcommitted
[backport] cherry-pick 15e46da to release-v1.2
Fix ingress backend broken SAN (openservicemesh#4914) Fix ingress backend SAN's, which were getting the trust domain appended to the provided SAN. This adds an e2e test to catch that going forward. This also switches the internal builders to use the principal (trust domain appended) vs the identity (no trust domain) [backport] cherry-pick 961c865 to release-v1.2 fix golints G114 and package-comments (openservicemesh#5037) golints addressed: 1. G114: Use of net/http serve function that has no support for setting timeouts 2. package-comments 3. removes pkg mesh and moves isValidUUID() to pkg/cli/proxy_get.go Signed-off-by: Shalier Xia <[email protected]> Signed-off-by: nshankar13 <[email protected]>
1 parent 893ff87 commit 1d50630

File tree

39 files changed

+330
-201
lines changed

39 files changed

+330
-201
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
- name: golangci-lint
5555
uses: golangci/golangci-lint-action@v3
5656
with:
57-
version: latest
57+
version: v1.47.1
5858
skip-pkg-cache: true
5959

6060
codegen:

.golangci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
run:
22
tests: true
3-
timeout: 10m
3+
timeout: 20m
44
skip-dirs:
55
- pkg/gen
66
skip-files:
@@ -35,6 +35,10 @@ issues:
3535
- revive
3636
source: ". \"github.com/openservicemesh/osm/tests/framework\""
3737
text: "dot imports"
38+
# Ignore error for package comments
39+
- linters:
40+
- revive
41+
text: "package-comments: should have a package comment"
3842
# Exclude staticcheck messages for deprecated function, variable or constant
3943
# This causes issues with package github.com/golang/protobuf/proto
4044
- linters:

demo/cmd/bookbuyer/bookbuyer.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Package main implements the bookbuyer application
12
package main
23

34
import (
@@ -77,6 +78,7 @@ func debugServer() {
7778
}
7879
http.HandleFunc("/favicon.ico", func(w http.ResponseWriter, r *http.Request) {})
7980
log.Info().Msgf("Web server running on port %d", *port)
81+
//#nosec G114: Use of net/http serve function that has no support for setting timeouts
8082
err = http.ListenAndServe(fmt.Sprintf(":%d", *port), router)
8183
log.Fatal().Err(err).Msgf("Failed to start HTTP server on port %d", *port)
8284
}

demo/cmd/bookstore/bookstore.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Package main implements the bookstore application
12
package main
23

34
import (
@@ -164,8 +165,8 @@ func main() {
164165
router.HandleFunc(h.path, h.fn).Methods(h.method)
165166
}
166167
http.HandleFunc("/favicon.ico", func(w http.ResponseWriter, r *http.Request) {})
167-
168168
log.Info().Msgf("Bookstore running on port %d", *port)
169+
//#nosec G114: Use of net/http serve function that has no support for setting timeouts
169170
err = http.ListenAndServe(fmt.Sprintf(":%d", *port), router)
170171
log.Fatal().Err(err).Msgf("Failed to start HTTP server on port %d", *port)
171172
}

demo/cmd/bookthief/bookthief.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Package main implements the bookthief application
12
package main
23

34
import (
@@ -86,6 +87,7 @@ func debugServer() {
8687
}
8788
http.HandleFunc("/favicon.ico", func(w http.ResponseWriter, r *http.Request) {})
8889
log.Info().Msgf("Bookthief running on port %d", *port)
90+
//#nosec G114: Use of net/http serve function that has no support for setting timeouts
8991
err = http.ListenAndServe(fmt.Sprintf(":%d", *port), router)
9092
log.Fatal().Err(err).Msgf("Failed to start HTTP server on port %d", *port)
9193
}

demo/cmd/bookwarehouse/bookwarehouse.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Package main implements the bookwarehouse application
2+
// This create a service which has both inbound as well as outbound service policies
3+
// i.e. bookbuyer makes a GET call to bookstore, bookstore makes a POST call to bookwarehouse
14
package main
25

36
import (
@@ -129,6 +132,7 @@ func main() {
129132
router.HandleFunc("/", restockBooks).Methods("POST")
130133
http.HandleFunc("/favicon.ico", func(w http.ResponseWriter, r *http.Request) {})
131134
log.Info().Msgf("Starting BookWarehouse HTTP server on port %d", *port)
135+
//#nosec G114: Use of net/http serve function that has no support for setting timeouts
132136
err := http.ListenAndServe(fmt.Sprintf(":%d", *port), router)
133137
log.Fatal().Err(err).Msgf("Failed to start BookWarehouse HTTP server on port %d", *port)
134138
}

demo/cmd/bookwatcher/bookwatcher.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Package main implements the bookwatcher for terminal and JSON output from demo applications
12
package main
23

34
import (

demo/cmd/common/books.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Package common implements shared functions and structs between various book* applications
12
package common
23

34
import (

demo/cmd/database/mysql.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Package database allows the bookwarehouse service to store
2+
// total books data into MySQL persistent storage
13
package database
24

35
import (

mockspec/generate.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// Package mockspec allows the mocks to be generated consistently by doing the following:
2+
// 1. defining mockgen rules using a file to specify the parameters
3+
// 2. generating mocks the same way for each of the rules
4+
// 3. integrating checks for the mocks in the CI
15
package main
26

37
import (

0 commit comments

Comments
 (0)