Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cryostat3): deploy Cryostat 3.0 #815

Merged
merged 54 commits into from
Jun 6, 2024
Merged
Changes from 1 commit
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
a57cc03
feat(csv): require AllNamespaces install mode (#719)
ebaron Feb 12, 2024
1a66780
feat(discovery): options to configure discovery port names and number…
mergify[bot] Feb 12, 2024
c981a96
feat(api): combine Cryostat and ClusterCryostat CRDs (#721)
ebaron Feb 13, 2024
1613624
feat(discovery): discovery port name/number options for v1betav2 (#733)
tthvo Feb 15, 2024
5b66ff1
chore(api): remove ClusterCryostat CRD (#737)
ebaron Feb 20, 2024
830046d
add scorecard test/suite selection (#746) (#747)
mergify[bot] Feb 28, 2024
f204ab3
ci(gh): add comment when /build_test is finished (#745) (#748)
mergify[bot] Feb 28, 2024
46c70ce
chore(api): remove MaxWsConnections (#742)
mwangggg Mar 5, 2024
fcf7a8c
test(scorecard): scorecard tests for recording management (backport #…
mergify[bot] Mar 6, 2024
385f81e
test(scorecard): scorecard test for Cryostat CR configuration changes…
mergify[bot] Mar 8, 2024
5917c22
chore(api): remove CommandConfig from NetworkOptions (#743)
mwangggg Mar 15, 2024
8f807ef
test(scorecard): scorecard test for report generator (backport #753)…
mergify[bot] Mar 15, 2024
8fd5307
fix(build-ci): fix scorecard image tag returned as null (#760) (#768)
mergify[bot] Mar 15, 2024
2619ae0
chore(api): remove minimal option from CR spec (#751)
tthvo Mar 19, 2024
9f1fdee
test(scorecard): add container logs to scorecard results (backport #7…
mergify[bot] Mar 19, 2024
b19e8f9
add permission to publish comment when ci fails (#769) (#771)
mergify[bot] Mar 19, 2024
ecd45b3
build(go): update Golang to 1.21 (#777) (#778)
mergify[bot] Mar 27, 2024
3306fff
test(scorecard): logWorkloadEvent for cryostat-recording errors (back…
mergify[bot] Mar 27, 2024
db115b3
chore(version): bump version to 3.0.0-dev (#781)
ebaron Mar 27, 2024
0b380d2
test(scorecard): fix rebasing skipped commit (#780) (#782)
mergify[bot] Mar 27, 2024
3fcbfab
ci(branch): run push workflows on cryostat3 branch (#786)
ebaron Apr 3, 2024
461096c
test(scorecard): multi-namespace scorecard test for 3.0 (#773)
mwangggg Apr 5, 2024
f799098
test(scorecard): add container logs for report sidecard test (backpor…
mergify[bot] Apr 16, 2024
8ed858b
test(scorecard): retry on cryostat update conflict (backport #774) (#…
mergify[bot] Apr 16, 2024
53d2b73
feat(deploy): deploy cryostat 3.0 (#727)
Josh-Matsuoka Apr 23, 2024
9593e8a
build(insights): consume out-of-tree Insights module (#800)
ebaron Apr 25, 2024
a26ff9c
feat(auth): deploy openshift auth proxy (#799)
andrewazores Apr 26, 2024
d455719
feat(auth): add configuration for htpasswd basic auth (#802)
andrewazores Apr 29, 2024
b9b0365
feat(auth): add config option to deploy oauth2_proxy instead of opens…
andrewazores May 3, 2024
c1c350c
fix(discovery): correct k8s API discovery configuration (#804)
andrewazores May 3, 2024
4a72b4c
feat(ocp): add optional flag to force platform as openshift (#810)
tthvo May 3, 2024
6e7e17e
fix(csv): add related images for storage and db (#812)
ebaron May 3, 2024
0a3021f
chore(cryostat3): various cleanups (#808)
andrewazores May 8, 2024
70351e1
chore(grafana): remove separate Grafana service/route/ingress (#809)
andrewazores May 8, 2024
dc5df9b
feat(tls): enable TLS on authproxies (#813)
andrewazores May 8, 2024
efec98e
fix(reports): update deprecated quarkus properties (backport #818) (#…
mergify[bot] May 10, 2024
95fa911
test(scorecard): fix broken scorecard tests for 3.0 (#820)
tthvo May 13, 2024
9fa1007
Merge branch 'main' into cryostat3
andrewazores May 13, 2024
b300689
feat(scorecard): allow running scorecard test locally (#821)
tthvo May 15, 2024
13e6a20
fix(status): controller should set approriate status in CR (#825)
tthvo May 21, 2024
ad96512
fix(secret): database should use user-defined secret if specified (#827)
tthvo May 21, 2024
f692e47
chore(storage): rename storage secret (#833)
mwangggg May 27, 2024
ec50b88
chore(jmx): remove configuration for JMX server, service, and auth se…
andrewazores May 28, 2024
7918cf9
chore(discovery): ensure consistent names for discovery options in CR…
tthvo May 28, 2024
04e0331
fix(scorecard): print newline instead of \n in local scorecard test o…
mwangggg May 29, 2024
374c576
chore(CI): update OLM to 0.28.0 (#837)
mwangggg May 30, 2024
0832d98
fix(proxy): do not pass unused credentials upstream (#839)
andrewazores Jun 4, 2024
28f6976
test(envtest): add validations for auth proxy arguments (#844)
tthvo Jun 5, 2024
5a7c4c3
test(proxy): add missing args to proxy expectations (#845)
andrewazores Jun 5, 2024
7025c66
replace v1beta1 resources (#847)
mwangggg Jun 5, 2024
e7b7afc
fix(scorecard): error when constructing request should be checked (#843)
tthvo Jun 5, 2024
48128d1
build(golang): build images with Go 1.22 (#850)
ebaron Jun 5, 2024
eba4fb2
fix(crd): restrict database secret name to be immutable (#831)
tthvo Jun 5, 2024
1be75e9
build(deps): bump controller-tools version to 0.14.0 (#851)
tthvo Jun 6, 2024
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
Prev Previous commit
Next Next commit
test(scorecard): add container logs for report sidecard test (backport
…#772) (#796)

* test(scorecard): add container logs for report sidecard test (#772)

* test(scorecard): add container logs for report sidecard test

odified:   internal/test/scorecard/common_utils.go

* test(scorecard): clean up

(cherry picked from commit 4b8ad76)

# Conflicts:
#	bundle/manifests/cryostat-operator.clusterserviceversion.yaml
#	bundle/tests/scorecard/config.yaml
#	config/scorecard/patches/custom.config.yaml
#	internal/test/scorecard/logger.go

* Fix conflicts

---------

Co-authored-by: Thuan Vo <thuan.votann@gmail.com>
Co-authored-by: Elliott Baron <ebaron@redhat.com>
  • Loading branch information
3 people authored Apr 16, 2024
commit f7990987afe40e9d36d1639a25c68be2bca0930e
Original file line number Diff line number Diff line change
@@ -53,7 +53,7 @@ metadata:
capabilities: Seamless Upgrades
categories: Monitoring, Developer Tools
containerImage: quay.io/cryostat/cryostat-operator:3.0.0-dev
createdAt: "2024-04-04T17:19:02Z"
createdAt: "2024-04-16T19:14:19Z"
description: JVM monitoring and profiling tool
operatorframework.io/initialization-resource: |-
{
12 changes: 6 additions & 6 deletions bundle/tests/scorecard/config.yaml
Original file line number Diff line number Diff line change
@@ -70,7 +70,7 @@ stages:
- entrypoint:
- cryostat-scorecard-tests
- operator-install
image: quay.io/cryostat/cryostat-operator-scorecard:3.0.0-20240404165315
image: quay.io/cryostat/cryostat-operator-scorecard:3.0.0-20240416191245
labels:
suite: cryostat
test: operator-install
@@ -80,7 +80,7 @@ stages:
- entrypoint:
- cryostat-scorecard-tests
- cryostat-cr
image: quay.io/cryostat/cryostat-operator-scorecard:3.0.0-20240404165315
image: quay.io/cryostat/cryostat-operator-scorecard:3.0.0-20240416191245
labels:
suite: cryostat
test: cryostat-cr
@@ -90,7 +90,7 @@ stages:
- entrypoint:
- cryostat-scorecard-tests
- cryostat-multi-namespace
image: quay.io/cryostat/cryostat-operator-scorecard:3.0.0-20240404165315
image: quay.io/cryostat/cryostat-operator-scorecard:3.0.0-20240416191245
labels:
suite: cryostat
test: cryostat-multi-namespace
@@ -100,7 +100,7 @@ stages:
- entrypoint:
- cryostat-scorecard-tests
- cryostat-recording
image: quay.io/cryostat/cryostat-operator-scorecard:3.0.0-20240404165315
image: quay.io/cryostat/cryostat-operator-scorecard:3.0.0-20240416191245
labels:
suite: cryostat
test: cryostat-recording
@@ -110,7 +110,7 @@ stages:
- entrypoint:
- cryostat-scorecard-tests
- cryostat-config-change
image: quay.io/cryostat/cryostat-operator-scorecard:3.0.0-20240404165315
image: quay.io/cryostat/cryostat-operator-scorecard:3.0.0-20240416191245
labels:
suite: cryostat
test: cryostat-config-change
@@ -120,7 +120,7 @@ stages:
- entrypoint:
- cryostat-scorecard-tests
- cryostat-report
image: quay.io/cryostat/cryostat-operator-scorecard:3.0.0-20240404165315
image: quay.io/cryostat/cryostat-operator-scorecard:3.0.0-20240416191245
labels:
suite: cryostat
test: cryostat-report
12 changes: 6 additions & 6 deletions config/scorecard/patches/custom.config.yaml
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
entrypoint:
- cryostat-scorecard-tests
- operator-install
image: "quay.io/cryostat/cryostat-operator-scorecard:3.0.0-20240404171904"
image: "quay.io/cryostat/cryostat-operator-scorecard:3.0.0-20240416191245"
labels:
suite: cryostat
test: operator-install
@@ -18,7 +18,7 @@
entrypoint:
- cryostat-scorecard-tests
- cryostat-cr
image: "quay.io/cryostat/cryostat-operator-scorecard:3.0.0-20240404171904"
image: "quay.io/cryostat/cryostat-operator-scorecard:3.0.0-20240416191245"
labels:
suite: cryostat
test: cryostat-cr
@@ -28,7 +28,7 @@
entrypoint:
- cryostat-scorecard-tests
- cryostat-multi-namespace
image: "quay.io/cryostat/cryostat-operator-scorecard:3.0.0-20240404171904"
image: "quay.io/cryostat/cryostat-operator-scorecard:3.0.0-20240416191245"
labels:
suite: cryostat
test: cryostat-multi-namespace
@@ -38,7 +38,7 @@
entrypoint:
- cryostat-scorecard-tests
- cryostat-recording
image: "quay.io/cryostat/cryostat-operator-scorecard:3.0.0-20240404171904"
image: "quay.io/cryostat/cryostat-operator-scorecard:3.0.0-20240416191245"
labels:
suite: cryostat
test: cryostat-recording
@@ -48,7 +48,7 @@
entrypoint:
- cryostat-scorecard-tests
- cryostat-config-change
image: "quay.io/cryostat/cryostat-operator-scorecard:3.0.0-20240404171904"
image: "quay.io/cryostat/cryostat-operator-scorecard:3.0.0-20240416191245"
labels:
suite: cryostat
test: cryostat-config-change
@@ -58,7 +58,7 @@
entrypoint:
- cryostat-scorecard-tests
- cryostat-report
image: "quay.io/cryostat/cryostat-operator-scorecard:3.0.0-20240404171904"
image: "quay.io/cryostat/cryostat-operator-scorecard:3.0.0-20240416191245"
labels:
suite: cryostat
test: cryostat-report
42 changes: 34 additions & 8 deletions internal/test/scorecard/common_utils.go
Original file line number Diff line number Diff line change
@@ -571,24 +571,50 @@ func (r *TestResources) getCryostatPodNameForCR(cr *operatorv1beta2.Cryostat) (s
selector := metav1.LabelSelector{
MatchLabels: map[string]string{
"app": cr.Name,
"kind": "cryostat",
"component": "cryostat",
},
}
opts := metav1.ListOptions{
LabelSelector: labels.Set(selector.MatchLabels).String(),

names, err := r.getPodnamesForSelector(cr.Namespace, selector)
if err != nil {
return "", err
}

ctx, cancel := context.WithTimeout(context.TODO(), testTimeout)
defer cancel()
if len(names) == 0 {
return "", fmt.Errorf("no matching cryostat pods for cr: %s", cr.Name)
}
return names[0].ObjectMeta.Name, nil
}

pods, err := r.Client.CoreV1().Pods(cr.Namespace).List(ctx, opts)
func (r *TestResources) getReportPodNameForCR(cr *operatorv1beta2.Cryostat) (string, error) {
selector := metav1.LabelSelector{
MatchLabels: map[string]string{
"app": cr.Name,
"kind": "cryostat",
"component": "reports",
},
}

names, err := r.getPodnamesForSelector(cr.Namespace, selector)
if err != nil {
return "", err
}

if len(pods.Items) == 0 {
return "", fmt.Errorf("no matching cryostat pods for cr: %s", cr.Name)
if len(names) == 0 {
return "", fmt.Errorf("no matching report sidecar pods for cr: %s", cr.Name)
}
return names[0].ObjectMeta.Name, nil
}

return pods.Items[0].ObjectMeta.Name, nil
func (r *TestResources) getPodnamesForSelector(namespace string, selector metav1.LabelSelector) ([]corev1.Pod, error) {
labelSelector := labels.Set(selector.MatchLabels).String()

ctx, cancel := context.WithTimeout(context.TODO(), testTimeout)
defer cancel()

pods, err := r.Client.CoreV1().Pods(namespace).List(ctx, metav1.ListOptions{
LabelSelector: labelSelector,
})
return pods.Items, err
}
41 changes: 32 additions & 9 deletions internal/test/scorecard/logger.go
Original file line number Diff line number Diff line change
@@ -25,12 +25,16 @@ import (
)

type ContainerLog struct {
Namespace string
Pod string
Container string
Log string
}

func (r *TestResources) logContainer(namespace, podName, containerName string) {
containerLog := &ContainerLog{
Namespace: namespace,
Pod: podName,
Container: containerName,
}
buf := &strings.Builder{}
@@ -77,27 +81,46 @@ func (r *TestResources) CollectContainersLogsToResult() {
logs := r.CollectLogs()
for _, log := range logs {
if log != nil {
r.Log += fmt.Sprintf("\n%s CONTAINER LOG:\n\n\t%s\n", strings.ToUpper(log.Container), log.Log)
r.Log += fmt.Sprintf("\nNAMESPACE: %s\nPOD: %s\nCONTAINER: %s\nLOG:\n\t%s\n",
strings.ToUpper(log.Namespace),
strings.ToUpper(log.Pod),
strings.ToUpper(log.Container),
log.Log,
)
}
}
}

func (r *TestResources) StartLogs(cr *operatorv1beta2.Cryostat) error {
podName, err := r.getCryostatPodNameForCR(cr)
cryostatPodName, err := r.getCryostatPodNameForCR(cr)
if err != nil {
return fmt.Errorf("failed to get pod name for CR: %s", err.Error())
}

containerNames := []string{
cr.Name,
cr.Name + "-grafana",
cr.Name + "-jfr-datasource",
logSelections := map[string][]string{
cryostatPodName: {
cr.Name,
cr.Name + "-grafana",
cr.Name + "-jfr-datasource",
},
}
bufferSize := 3

r.LogChannel = make(chan *ContainerLog, len(containerNames))
if cr.Spec.ReportOptions != nil && cr.Spec.ReportOptions.Replicas > 0 {
reportPodName, err := r.getReportPodNameForCR(cr)
if err != nil {
return fmt.Errorf("failed to get pod name for report sidecar: %s", err.Error())
}
logSelections[reportPodName] = []string{cr.Name + "-reports"}
bufferSize++
}

for _, containerName := range containerNames {
go r.logContainer(cr.Namespace, podName, containerName)
r.LogChannel = make(chan *ContainerLog, bufferSize)

for pod, containers := range logSelections {
for _, container := range containers {
go r.logContainer(cr.Namespace, pod, container)
}
}

return nil
5 changes: 5 additions & 0 deletions internal/test/scorecard/tests.go
Original file line number Diff line number Diff line change
@@ -339,5 +339,10 @@ func CryostatReportTest(bundle *apimanifests.Bundle, namespace string, openShift
return r.fail(fmt.Sprintf("failed to reach the application: %s", err.Error()))
}

err = r.StartLogs(cr)
if err != nil {
r.Log += fmt.Sprintf("failed to retrieve logs for the application: %s", err.Error())
}

return r.TestResult
}
Loading