Skip to content

Conversation

@adellape
Copy link
Contributor

@adellape adellape commented Oct 10, 2020

@adellape adellape added this to the Future Release milestone Oct 10, 2020
@openshift-ci-robot openshift-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 10, 2020
@openshift-docs-preview-bot

The preview will be available shortly at:

@adellape adellape force-pushed the 46_scorecard branch 2 times, most recently from 35f044b to 3b399aa Compare October 10, 2020 05:24

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adellape operator-sdk scorecard is still available in 4.6. but per the NOTE, it seems it is not available in 4.6.

Copy link
Contributor Author

@adellape adellape Oct 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're claiming support of OSDK 0.19.4 in OCP 4.6, which doesn't have operator-sdk scorecard available anymore (checked with @jmccormick2001 as well):

$ operator-sdk version
operator-sdk version: "v0.19.4", commit: "125d0dfcc71fef4f9d7e2a42b1354cb79ffdee03", kubernetes version: "v1.18.2", go version: "go1.13.15 linux/amd64"

$ operator-sdk scorecard
Error: unknown command "scorecard" for "operator-sdk"
Run 'operator-sdk --help' for usage.
FATA[0000] unknown command "scorecard" for "operator-sdk" 

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adellape I tried v0.19.3 which has that. now I tried v0.19.4 which has no that. so, you are correct, and please ignore my comment.

Copy link

@kuiwang02 kuiwang02 Oct 12, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adellape sorry. I build operator-sdk with the latest code (commit id ef0bc885e40e6c86c0c079bea612b4eb908f6ec5 which is latest than your version). There is still scorecard.

[root@preserve-olm-env memcached-operator-scorecard]# /root/kuiwang/bin/operator-sdk version
operator-sdk version: "v0.19.4-5-gef0bc88", commit: "ef0bc885e40e6c86c0c079bea612b4eb908f6ec5", kubernetes version: "v1.18.2", go version: "go1.14 linux/amd64"
[root@preserve-olm-env memcached-operator-scorecard]# /root/kuiwang/bin/operator-sdk -h
An SDK for building operators with ease

Usage:
  operator-sdk [command]

Available Commands:
  add         Adds a controller or resource to the project
  alpha       Run an alpha subcommand
  build       Compiles code and builds artifacts
  bundle      Manage operator bundle metadata
  cleanup     Delete and clean up after a running Operator
  completion  Generators for shell completions
  generate    Invokes a specific generator
  help        Help about any command
  new         Creates a new operator application
  olm         Manage the Operator Lifecycle Manager installation in your cluster
  print-deps  Print Golang packages and versions required to run the operator
  run         Run an Operator in a variety of environments
  scorecard   Run scorecard tests
  test        Tests the operator
  version     Prints the version of operator-sdk

Flags:
  -h, --help      help for operator-sdk
      --verbose   Enable verbose logging

Use "operator-sdk [command] --help" for more information about a command.
[root@preserve-olm-env memcached-operator-scorecard]# /root/kuiwang/bin/operator-sdk scorecard -h
Runs blackbox scorecard tests on an operator

Usage:
  operator-sdk scorecard [flags]

Flags:
  -b, --bundle string       OLM bundle directory path, when specified runs bundle validation
      --config string       config file (default is '<project_dir>/.osdk-scorecard.yaml'; the config file's extension and format must be .yaml
  -h, --help                help for scorecard
      --kubeconfig string   Path to kubeconfig of custom resource created in cluster
  -L, --list                If true, only print the test names that would be run based on selector filtering
  -o, --output string       Output format for results. Valid values: text, json (default "text")
  -l, --selector string     selector (label query) to filter tests on
      --version string      scorecard version. Valid values: v1alpha2 (default "v1alpha2")

Global Flags:
      --verbose   Enable verbose logging
[root@preserve-olm-env memcached-operator-scorecard]#  /root/kuiwang/bin/operator-sdk scorecard  --kubeconfig /root/kubeconf/kubeconfig -o text
INFO[0000] Using config file: /root/kuiwang/github/operator-framework/operator-samples-for-sdk-019/ansible/memcached-operator-scorecard/.osdk-scorecard.yaml 
I1012 01:54:23.239078    6757 request.go:621] Throttling request took 1.121372108s, request: GET:https://api.kui101229.qe.devcluster.openshift.com:6443/apis/scheduling.k8s.io/v1?timeout=32s
basic:
	Spec Block Exists                   : pass
	CR: example-memcached
	Labels: 
		"necessity":"required"
		"suite":"basic"
		"test":"checkspectest"
...

so, need to change description for it. Thanks

and more, I got the reason why you do not see that.
If you execute it out of the project, it does not display it. for example /root/kuiwang/github/operator-framework is not project

[root@preserve-olm-env operator-framework]# pwd
/root/kuiwang/github/operator-framework
[root@preserve-olm-env operator-framework]# /root/kuiwang/bin/operator-sdk -h
Development kit for building Kubernetes extensions and tools.

Provides libraries and tools to create new projects, APIs and controllers.
Includes tools for packaging artifacts into an installer container.

Typical project lifecycle:

- initialize a project:

  operator-sdk init --domain example.com --license apache2 --owner "The Kubernetes authors"

- create one or more a new resource APIs and add your code to them:

  operator-sdk create api --group <group> --version <version> --kind <Kind>

Create resource will prompt the user for if it should scaffold the Resource and / or Controller. To only
scaffold a Controller for an existing Resource, select "n" for Resource. To only define
the schema for a Resource without writing a Controller, select "n" for Controller.

After the scaffold is written, api will run make on the project.

Usage:
  operator-sdk [flags]
  operator-sdk [command]

Examples:

  # Initialize your project
  operator-sdk init --domain example.com --license apache2 --owner "The Kubernetes authors"

  # Create a frigates API with Group: ship, Version: v1beta1 and Kind: Frigate
  operator-sdk create api --group ship --version v1beta1 --kind Frigate

  # Edit the API Scheme
  nano api/v1beta1/frigate_types.go

  # Edit the Controller
  nano controllers/frigate_controller.go

  # Install CRDs into the Kubernetes cluster using kubectl apply
  make install

  # Regenerate code and run against the Kubernetes cluster configured by ~/.kube/config
  make run


Available Commands:
  alpha       Run an alpha subcommand
  build       Compiles code and builds artifacts
  bundle      Manage operator bundle metadata
  cleanup     Clean up an Operator deployed with the 'run' subcommand
  completion  Generators for shell completions
  create      Scaffold a Kubernetes API or webhook
  generate    Invokes a specific generator
  help        Help about any command
  init        Initialize a new project
  new         Creates a new operator application
  olm         Manage the Operator Lifecycle Manager installation in your cluster
  run         Run an Operator in a variety of environments
  version     Prints the version of operator-sdk

Flags:
  -h, --help      help for operator-sdk
      --verbose   Enable verbose logging

Use "operator-sdk [command] --help" for more information about a command.

if you execute it in project directory, it has option and can execute it. for example, /root/kuiwang/github/operator-framework/operator-samples-for-sdk-019/ansible/memcached-operator-scorecard is project

[root@preserve-olm-env memcached-operator-scorecard]# pwd
/root/kuiwang/github/operator-framework/operator-samples-for-sdk-019/ansible/memcached-operator-scorecard
[root@preserve-olm-env memcached-operator-scorecard]# /root/kuiwang/bin/operator-sdk -h
An SDK for building operators with ease

Usage:
  operator-sdk [command]

Available Commands:
  add         Adds a controller or resource to the project
  alpha       Run an alpha subcommand
  build       Compiles code and builds artifacts
  bundle      Manage operator bundle metadata
  cleanup     Delete and clean up after a running Operator
  completion  Generators for shell completions
  generate    Invokes a specific generator
  help        Help about any command
  new         Creates a new operator application
  olm         Manage the Operator Lifecycle Manager installation in your cluster
  print-deps  Print Golang packages and versions required to run the operator
  run         Run an Operator in a variety of environments
  scorecard   Run scorecard tests
  test        Tests the operator
  version     Prints the version of operator-sdk

Flags:
  -h, --help      help for operator-sdk
      --verbose   Enable verbose logging

Use "operator-sdk [command] --help" for more information about a command.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kuiwang02 is correct.

v0.19.x has a dual-mode CLI, where it supports legacy projects (with a deprecation warning) and new kubebuilder-based projects.

If operator-sdk is executed in a "legacy" project, it reverts to the old CLI that supports the old scorecard. Otherwise it uses the new kubebuilder-based CLI.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jianzhangbjz
Copy link
Member

/assign @kuiwang02

@adellape
Copy link
Contributor Author

@kuiwang02 Thanks! Updates pushed. PTAL.

@kuiwang02
Copy link

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 12, 2020
@openshift-bot
Copy link

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci-robot openshift-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 11, 2021
@adellape
Copy link
Contributor Author

adellape commented Feb 9, 2021

Closing in favor of #29274

@adellape adellape closed this Feb 9, 2021
@kalexand-rh kalexand-rh removed this from the Future Release milestone Aug 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm Indicates that a PR is ready to be merged. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants