Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
mwangggg committed Apr 10, 2024
1 parent 38e4d6e commit 2f7b5e6
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ metadata:
capabilities: Seamless Upgrades
categories: Monitoring, Developer Tools
containerImage: quay.io/cryostat/cryostat-operator:2.5.0-dev
createdAt: "2024-03-27T17:54:03Z"
createdAt: "2024-04-10T02:34:20Z"
description: JVM monitoring and profiling tool
operatorframework.io/initialization-resource: |-
{
Expand Down
12 changes: 6 additions & 6 deletions bundle/tests/scorecard/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ stages:
- entrypoint:
- cryostat-scorecard-tests
- operator-install
image: quay.io/cryostat/cryostat-operator-scorecard:2.5.0-20240404171629
image: quay.io/cryostat/cryostat-operator-scorecard:2.5.0-20240410022739
labels:
suite: cryostat
test: operator-install
Expand All @@ -80,7 +80,7 @@ stages:
- entrypoint:
- cryostat-scorecard-tests
- cryostat-cr
image: quay.io/cryostat/cryostat-operator-scorecard:2.5.0-20240404171629
image: quay.io/cryostat/cryostat-operator-scorecard:2.5.0-20240410022739
labels:
suite: cryostat
test: cryostat-cr
Expand All @@ -90,7 +90,7 @@ stages:
- entrypoint:
- cryostat-scorecard-tests
- cryostat-multi-namespace
image: quay.io/cryostat/cryostat-operator-scorecard:2.5.0-20240404171629
image: quay.io/cryostat/cryostat-operator-scorecard:2.5.0-20240410022739
labels:
suite: cryostat
test: cryostat-multi-namespace
Expand All @@ -100,7 +100,7 @@ stages:
- entrypoint:
- cryostat-scorecard-tests
- cryostat-recording
image: quay.io/cryostat/cryostat-operator-scorecard:2.5.0-20240404171629
image: quay.io/cryostat/cryostat-operator-scorecard:2.5.0-20240410022739
labels:
suite: cryostat
test: cryostat-recording
Expand All @@ -110,7 +110,7 @@ stages:
- entrypoint:
- cryostat-scorecard-tests
- cryostat-config-change
image: quay.io/cryostat/cryostat-operator-scorecard:2.5.0-20240404171629
image: quay.io/cryostat/cryostat-operator-scorecard:2.5.0-20240410022739
labels:
suite: cryostat
test: cryostat-config-change
Expand All @@ -120,7 +120,7 @@ stages:
- entrypoint:
- cryostat-scorecard-tests
- cryostat-report
image: quay.io/cryostat/cryostat-operator-scorecard:2.5.0-20240404171629
image: quay.io/cryostat/cryostat-operator-scorecard:2.5.0-20240410022739
labels:
suite: cryostat
test: cryostat-report
Expand Down
12 changes: 6 additions & 6 deletions config/scorecard/patches/custom.config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
entrypoint:
- cryostat-scorecard-tests
- operator-install
image: "quay.io/cryostat/cryostat-operator-scorecard:2.5.0-20240327175405"
image: "quay.io/cryostat/cryostat-operator-scorecard:2.5.0-20240410022739"
labels:
suite: cryostat
test: operator-install
Expand All @@ -18,7 +18,7 @@
entrypoint:
- cryostat-scorecard-tests
- cryostat-cr
image: "quay.io/cryostat/cryostat-operator-scorecard:2.5.0-20240327175405"
image: "quay.io/cryostat/cryostat-operator-scorecard:2.5.0-20240410022739"
labels:
suite: cryostat
test: cryostat-cr
Expand All @@ -28,7 +28,7 @@
entrypoint:
- cryostat-scorecard-tests
- cryostat-multi-namespace
image: "quay.io/cryostat/cryostat-operator-scorecard:2.5.0-20240404171725"
image: "quay.io/cryostat/cryostat-operator-scorecard:2.5.0-20240410022739"
labels:
suite: cryostat
test: cryostat-multi-namespace
Expand All @@ -38,7 +38,7 @@
entrypoint:
- cryostat-scorecard-tests
- cryostat-recording
image: "quay.io/cryostat/cryostat-operator-scorecard:2.5.0-20240327175405"
image: "quay.io/cryostat/cryostat-operator-scorecard:2.5.0-20240410022739"
labels:
suite: cryostat
test: cryostat-recording
Expand All @@ -48,7 +48,7 @@
entrypoint:
- cryostat-scorecard-tests
- cryostat-config-change
image: "quay.io/cryostat/cryostat-operator-scorecard:2.5.0-20240327175405"
image: "quay.io/cryostat/cryostat-operator-scorecard:2.5.0-20240410022739"
labels:
suite: cryostat
test: cryostat-config-change
Expand All @@ -58,7 +58,7 @@
entrypoint:
- cryostat-scorecard-tests
- cryostat-report
image: "quay.io/cryostat/cryostat-operator-scorecard:2.5.0-20240327175405"
image: "quay.io/cryostat/cryostat-operator-scorecard:2.5.0-20240410022739"
labels:
suite: cryostat
test: cryostat-report
12 changes: 6 additions & 6 deletions internal/test/scorecard/common_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -513,11 +513,11 @@ func (r *TestResources) sendHealthRequest(base *url.URL, healthCheck func(resp *
return err
}

func (r *TestResources) updateAndWaitTillCryostatAvailable(cr *operatorv1beta1.Cryostat) error {
func (r *TestResources) updateAndWaitTillCryostatAvailable(cr *operatorv1beta1.Cryostat) (*operatorv1beta1.Cryostat, error) {
ctx := context.Background()

err := retry.RetryOnConflict(retry.DefaultRetry, func() error {
cr, err := r.Client.OperatorCRDs().Cryostats(cr.Namespace).Get(ctx, CryostatConfigChangeTestName)
cr, err := r.Client.OperatorCRDs().Cryostats(cr.Namespace).Get(ctx, cr.Name)
if err != nil {
return fmt.Errorf("failed to get Cryostat CR: %s", err.Error())
}
Expand All @@ -535,11 +535,11 @@ func (r *TestResources) updateAndWaitTillCryostatAvailable(cr *operatorv1beta1.C
},
}

_, err = r.Client.OperatorCRDs().Cryostats(cr.Namespace).Update(context.Background(), cr)
cr, err = r.Client.OperatorCRDs().Cryostats(cr.Namespace).Update(context.Background(), cr)
return err
})
if err != nil {
return fmt.Errorf("failed to update Cryostat CR: %s", err.Error())
return nil, fmt.Errorf("failed to update Cryostat CR: %s", err.Error())
}

// Poll the deployment until it becomes available or we timeout
Expand Down Expand Up @@ -593,9 +593,9 @@ func (r *TestResources) updateAndWaitTillCryostatAvailable(cr *operatorv1beta1.C
return false, nil
})
if err != nil {
return fmt.Errorf("failed to look up deployment errors: %s", err.Error())
return nil, fmt.Errorf("failed to look up deployment errors: %s", err.Error())
}
return err
return cr, err
}

func (r *TestResources) cleanupAndLogs(name string, namespace string) {
Expand Down
3 changes: 2 additions & 1 deletion internal/test/scorecard/tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,14 @@ func CryostatConfigChangeTest(bundle *apimanifests.Bundle, namespace string, ope
}

// Switch Cryostat CR to PVC for redeployment
err = r.updateAndWaitTillCryostatAvailable(cr)
cr, err = r.updateAndWaitTillCryostatAvailable(cr)
if err != nil {
return r.fail(fmt.Sprintf("Cryostat redeployment did not become available: %s", err.Error()))
}
r.Log += "Cryostat deployment has successfully updated with new spec template\n"

base, err := url.Parse(cr.Status.ApplicationURL)
r.Log += fmt.Sprintf("base url: %s\n", base)
if err != nil {
return r.fail(fmt.Sprintf("application URL is invalid: %s", err.Error()))
}
Expand Down

0 comments on commit 2f7b5e6

Please sign in to comment.