-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add alpha scorecard to OSDK #26315
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
Add alpha scorecard to OSDK #26315
Conversation
6e3b164 to
433cb56
Compare
|
The preview will be available shortly at: |
35f044b to
3b399aa
Compare
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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"
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for helping clarify, all! Relevant code:
|
/assign @kuiwang02 |
3b399aa to
9ebb80c
Compare
9ebb80c to
71679c1
Compare
|
@kuiwang02 Thanks! Updates pushed. PTAL. |
|
/lgtm |
|
Issues go stale after 90d of inactivity. Mark the issue as fresh by commenting If this issue is safe to close now please do so with /lifecycle stale |
|
Closing in favor of #29274 |
https://issues.redhat.com/browse/OSDOCS-1091
Preview (internal): http://file.rdu.redhat.com/~adellape/100920/46_scorecard/operators/operator_sdk/osdk-new-scorecard.html
TODO: After QE review, break assembly up into modules before peer review.