Operator-sdk Scorecard

How to use operator-sdk?

routerhan
3 min readAug 25, 2024
redhat

This article introduces you to Scorecard, an Operator-SDK tool for testing deployed operators. A Scorecard test consists of one or more images that are configured with config files and then executed within a pod running on the cluster. Results of the tests are emitted as logs from the pod.

Scorecard has a built-in suite of tests that exercise some of the basic functionality of your operator and OLM. The tool also provides a format for where you can create custom tests that are specific to your operator.

Configure Scorecard for testing

Operator-SDK generates the scaffolding for a Scorecard config when you run operator-sdk init. You can view these base files in config/scorecard/.

A full config file is generated based on these when you run make bundle at bundle/tests/scorecard/config.yaml that will look something like this:

apiVersion: scorecard.operatorframework.io/v1alpha3
kind: Configuration
metadata:
name: config
stages:
- parallel: true
tests:
- entrypoint:
- scorecard-test
- basic-check-spec
image: quay.io/operator-framework/scorecard-test:v1.7.2
labels:
suite: basic
test: basic-check-spec-test
- entrypoint:
- scorecard-test
- olm-bundle-validation
image…

--

--

routerhan

R&D Software Engineer @IBM Germany. This blog is an independent research of cloud computing.