Operator-sdk: Basic Scorecard Test not Working

Created on 5 Nov 2020  路  4Comments  路  Source: operator-framework/operator-sdk

Type of question


How to implement a specific feature

Question

I'm trying to get a scorecard to work for an operator we created at work. We thought something as simple as defining an .osdk-scorecard.yaml and running operator-sdk scorecard would work. Unfortunately, the results say were encountering a fatal error[0000] (a bundle image or directory is required). What would I need to do to get this scorecard to work?

What did you do?

1) Clone repo
2) Create .osdk-scorecard in project root

Screen Shot 2020-11-04 at 11 45 29 PM

What did you expect to see?

What did you see instead? Under which circumstances?

Environment

Operator type:

/language go

Kubernetes cluster type:

Openshift 4.3

$ operator-sdk version

operator-sdk version: "v1.1.0", commit: "9d27e224efac78fcc9354ece4e43a50eb30ea968", kubernetes version: "v1.18.2", go version: "go1.15 linux/amd64", GOOS: "linux", GOARCH: "amd64"

$ go version (if language is Go)

go version go1.15.3 linux/amd64

$ kubectl version

Client Version: version.Info{Major:"", Minor:"", GitVersion:"v0.0.0-master+$Format:%h$", GitCommit:"$Format:%H$", GitTreeState:"", BuildDate:"1970-01-01T00:00:00Z", GoVersion:"go1.12.12", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"16+", GitVersion:"v1.16.2", GitCommit:"a02f27a", GitTreeState:"clean", BuildDate:"2020-04-13T12:04:13Z", GoVersion:"go1.12.12", Compiler:"gc", Platform:"linux/amd64"}

Additional context

scorecard triagsupport

Most helpful comment

.osdk-scorecard.yaml was the older style scorecard configuration, you will want to be using the new scorecard config.yaml file, there is a sample of it in the SDK repo and it also gets scaffolded out when you create a new project.

All 4 comments

Hi @lsalazar1,

Could you please provide further information to let us know the following?

  • What is the command used to run the scorecard ? Is it operator-sdk scorecard bundle --selector=suite=basic --output=json --wait-time=60s?
  • Did you build the bundle (make bundle) and its image before running the scorecard (make bundle IMG=/:)?
  • Could you please provide the full output of the error?

.osdk-scorecard.yaml was the older style scorecard configuration, you will want to be using the new scorecard config.yaml file, there is a sample of it in the SDK repo and it also gets scaffolded out when you create a new project.

@jmccormick2001

Ah okay, I was running v1.1.0 when I should've been using v.0.17.0 (squad set this version as mandatory). The scorecard command has been somewhat functional.

We've had times were it will output what we're expecting
Screen Shot 2020-11-05 at 11 21 04 AM

and other times we're it says that it failed due to some namespaced resources not being created.
Screen Shot 2020-11-05 at 12 08 08 PM

Is there a way to update this config file to locate the correct role and role binding files? Our team uses cluster roles and cluster role bindings.

namespaced-manifest string manifest file with all resources that run within a namespace. By default, the scorecard will combine service_account.yaml, role.yaml, role_binding.yaml, and operator.yaml from the deploy directory into a temporary manifest to use as the namespaced manifest.....that is from the 0.17 documentation for scorecard...however, not sure if it will cover your situation but its something you might experiment with.

Was this page helpful?
0 / 5 - 0 ratings