Skip to content

Commit 3c7e3a6

Browse files
authored
sync: rc-2023-11-16.2 to stage (#1476)
sync-branches: New code has just landed in rc-2023-11-16.2, so let's bring stage up to speed!
2 parents 8fe55d3 + fcf587e commit 3c7e3a6

File tree

6 files changed

+54
-50
lines changed

6 files changed

+54
-50
lines changed

dp-terraform/helm/rhacs-terraform/charts/secured-cluster/templates/secured-cluster-cr.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,13 @@ spec:
5858
{{- if .Values.scanner.analyzer.nodeSelector }}
5959
nodeSelector: {{ toYaml .Values.scanner.analyzer.nodeSelector | nindent 8 }}
6060
{{- end }}
61-
db:
62-
{{- if .Values.scanner.analyzer.db.resources }}
63-
resources: {{ toYaml .Values.scanner.analyzer.db.resources | nindent 10 }}
64-
{{- end }}
65-
{{- if .Values.scanner.analyzer.db.tolerations }}
66-
tolerations: {{ toYaml .Values.scanner.analyzer.db.tolerations | nindent 10 }}
67-
{{- end }}
68-
{{- if .Values.scanner.analyzer.db.nodeSelector }}
69-
nodeSelector: {{ toYaml .Values.scanner.analyzer.db.nodeSelector | nindent 10 }}
70-
{{- end }}
61+
db:
62+
{{- if .Values.scanner.db.resources }}
63+
resources: {{ toYaml .Values.scanner.db.resources | nindent 8 }}
64+
{{- end }}
65+
{{- if .Values.scanner.db.tolerations }}
66+
tolerations: {{ toYaml .Values.scanner.db.tolerations | nindent 8 }}
67+
{{- end }}
68+
{{- if .Values.scanner.db.nodeSelector }}
69+
nodeSelector: {{ toYaml .Values.scanner.db.nodeSelector | nindent 8 }}
70+
{{- end }}

dp-terraform/helm/rhacs-terraform/charts/secured-cluster/values.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ scanner:
3838
requests:
3939
memory: 100Mi
4040
cpu: 100m
41-
db:
42-
tolerations: []
43-
nodeSelector: {}
44-
resources:
45-
requests:
46-
memory: 100Mi
47-
cpu: 100m
41+
db:
42+
tolerations: []
43+
nodeSelector: {}
44+
resources:
45+
requests:
46+
memory: 100Mi
47+
cpu: 100m
4848
sensor:
4949
serviceTLS:
5050
cert: ""

dp-terraform/helm/rhacs-terraform/values.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -224,13 +224,13 @@ secured-cluster:
224224
effect: NoSchedule
225225
nodeSelector:
226226
node-role.kubernetes.io/acscs-infra: ""
227-
db:
228-
tolerations:
229-
- key: node-role.kubernetes.io/acscs-infra
230-
operator: Exists
231-
effect: NoSchedule
232-
nodeSelector:
233-
node-role.kubernetes.io/acscs-infra: ""
227+
db:
228+
tolerations:
229+
- key: node-role.kubernetes.io/acscs-infra
230+
operator: Exists
231+
effect: NoSchedule
232+
nodeSelector:
233+
node-role.kubernetes.io/acscs-infra: ""
234234

235235
external-secrets:
236236
fullnameOverride: rhacs-external-secrets

pkg/features/list.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ var (
55
TargetedOperatorUpgrades = registerFeature("Upgrade Central instances targetedly via fleet-manager API", "RHACS_TARGETED_OPERATOR_UPGRADES", false)
66

77
// GitOpsCentrals enables the GitOps for Central instances
8-
GitOpsCentrals = registerFeature("GitOps for Central instances", "RHACS_GITOPS_ENABLED", false)
8+
GitOpsCentrals = registerFeature("GitOps for Central instances", "RHACS_GITOPS_ENABLED", true)
99

1010
// PrintCentralUpdateDiff enables printing the diff of the central update
11-
PrintCentralUpdateDiff = registerFeature("Print the diff of the central update", "RHACS_PRINT_CENTRAL_UPDATE_DIFF", false)
11+
PrintCentralUpdateDiff = registerFeature("Print the diff of the central update", "RHACS_PRINT_CENTRAL_UPDATE_DIFF", true)
1212
)

pkg/server/profiler/profiler_server.go

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -39,25 +39,32 @@ var (
3939
// SingletonPprofServer returns the PprofServer
4040
func SingletonPprofServer() *PprofServer {
4141
oncePprofServer.Do(func() {
42-
router := mux.NewRouter()
43-
router.Handle("/debug/pprof/", http.HandlerFunc(pprof.Index))
44-
router.Handle("/debug/pprof/cmdline", http.HandlerFunc(pprof.Cmdline))
45-
router.Handle("/debug/pprof/profile", http.HandlerFunc(pprof.Profile))
46-
router.Handle("/debug/pprof/symbol", http.HandlerFunc(pprof.Symbol))
47-
router.Handle("/debug/pprof/trace", http.HandlerFunc(pprof.Trace))
48-
router.Handle("/debug/pprof/{cmd}", http.HandlerFunc(pprof.Index)) // special handling for Gorilla mux
49-
httpServer := &http.Server{
50-
Addr: "localhost:6060",
51-
Handler: router,
52-
}
53-
54-
pprofServerInstance = &PprofServer{
55-
httpServer: httpServer,
56-
}
42+
pprofServerInstance = newPprofServer()
5743
})
5844
return pprofServerInstance
5945
}
6046

47+
func getRouter() *mux.Router {
48+
router := mux.NewRouter()
49+
router.Handle("/debug/pprof/", http.HandlerFunc(pprof.Index))
50+
router.Handle("/debug/pprof/cmdline", http.HandlerFunc(pprof.Cmdline))
51+
router.Handle("/debug/pprof/profile", http.HandlerFunc(pprof.Profile))
52+
router.Handle("/debug/pprof/symbol", http.HandlerFunc(pprof.Symbol))
53+
router.Handle("/debug/pprof/trace", http.HandlerFunc(pprof.Trace))
54+
router.Handle("/debug/pprof/{cmd}", http.HandlerFunc(pprof.Index)) // special handling for Gorilla mux
55+
return router
56+
}
57+
58+
func newPprofServer() *PprofServer {
59+
httpServer := &http.Server{
60+
Addr: "localhost:6060",
61+
Handler: getRouter(),
62+
}
63+
return &PprofServer{
64+
httpServer: httpServer,
65+
}
66+
}
67+
6168
// Stop ...
6269
func (p *PprofServer) Stop() {
6370
err := p.httpServer.Shutdown(context.Background())

pkg/server/profiler/profiler_server_test.go

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,16 @@ func TestPprofProfiler(t *testing.T) {
1212
server := SingletonPprofServer()
1313
server.Start()
1414

15-
for {
16-
conn, err := net.DialTimeout("tcp", net.JoinHostPort("localhost", "6060"), 5*time.Second)
17-
require.NoError(t, err)
18-
if conn != nil {
19-
require.NoError(t, conn.Close())
20-
break
21-
}
22-
time.Sleep(50 * time.Millisecond)
15+
// Test server is reachable
16+
conn, err := net.DialTimeout("tcp", net.JoinHostPort("localhost", "6060"), 60*time.Second)
17+
require.NoError(t, err)
18+
if conn != nil {
19+
require.NoError(t, conn.Close())
2320
}
2421

2522
// Test server was stopped
2623
server.Stop()
27-
conn, err := net.DialTimeout("tcp", net.JoinHostPort("localhost", "6060"), 5*time.Second)
24+
conn, err = net.DialTimeout("tcp", net.JoinHostPort("localhost", "6060"), 2*time.Second)
2825
require.Error(t, err)
2926
require.Nil(t, conn)
3027
}

0 commit comments

Comments
 (0)