Skip to content
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

Man's Search for Operators #1462

Merged
merged 4 commits into from
Apr 14, 2020
Merged

Man's Search for Operators #1462

merged 4 commits into from
Apr 14, 2020

Conversation

kensipe
Copy link
Member

@kensipe kensipe commented Apr 13, 2020

KUDO search for Operators

new command: kudo search <fo>
Provides ability to search for operators in the repository.
The search is a "contains" in the name of the operator and does not require a *
By default it returns the firstMatch based on install criteria, which means the result will be any match with operator and app version that is "current"

go run cmd/kubectl-kudo/main.go search kafka
Name 	Operator Version	App Version
kafka	1.2.0           	2.4.0    

It is possible to get all the versions with -a flag

go run cmd/kubectl-kudo/main.go search kafka -a
Name 	Operator Version	App Version
kafka	1.2.0           	2.4.0      
     	1.1.1           	2.4.0      
     	1.1.0           	2.4.0      
     	1.0.2           	2.3.1      
     	1.0.1           	2.3.1      
     	1.0.0           	2.3.0      
     	0.1.3           	2.2.1    

names are skipped if a list contains multiple version of the same operator name

 $ go run cmd/kubectl-kudo/main.go search fl -a
Name                     	Operator Version	App Version
confluent-rest-proxy     	0.2.0           	5.3.2      
                         	0.1.0           	5.3.2      
flink-demo               	0.1.4           	           
confluent-schema-registry	0.2.0           	5.3.2      
                         	0.1.0           	5.3.2      
flink                    	0.2.1           	1.7.2      
                         	0.2.0           	1.7.2      
                         	0.1.2           	1.7.2      
                         	0.1.1           	1.7.2 

you can get all operators with go run cmd/kubectl-kudo/main.go search ""

you can switch repos with the --repo=xyz flag

$ go run cmd/kubectl-kudo/main.go search fl --repo private
Name                    	Operator Version	App Version
kubeflow                	0.1.0           	1.0.0      
flink                   	0.2.1           	1.7.2      
kubeflow-knative-serving	0.1.0           	0.7        

Signed-off-by: Ken Sipe kensipe@gmail.com

Fixes #332

Signed-off-by: Ken Sipe <kensipe@gmail.com>
@kensipe kensipe added the release/highlight This PR is a highlight for the next release label Apr 13, 2020
@kensipe kensipe changed the title Operator Search Man's Search for Operators Apr 13, 2020
@runyontr
Copy link
Member

Ken,
This looks great and is a much desired feature to the CLI. A couple questions comments:

  1. How is the order returned? I assume its grouped by repo and sorted within a repo. This might become more apparent with an answer to the next:
  2. Should we put the repo as another column so they know which apps are from which repos?

@kensipe
Copy link
Member Author

kensipe commented Apr 13, 2020

currently there is only a search against 1 repo at a time... when the search spans across multiple repos (which seems like a good idea) adding the repo to a column certainly will make a lot of sense.

let me fix the order now tho

Signed-off-by: Ken Sipe <kensipe@gmail.com>
Signed-off-by: Ken Sipe <kensipe@gmail.com>
Signed-off-by: Ken Sipe <kensipe@gmail.com>
@gerred
Copy link
Member

gerred commented Apr 13, 2020

This is nice. Something to consider for the future:

We should use https://blevesearch.com/ down the road, and store the search index DB alongside our operators (if it's not too large), and potentially cache it locally. Why, you ask?!

It'd be super nice to add some of the Bleve facets into this search (show me all 1.x operators for Kafka), and we can also facet on other interesting things that are either in the documentation, etc when we actually generate the index, but doesn't quite exist in the index.yaml. Tons of possibilities here to enhance this feature to the moon!

I've used Bleve a lot for this purpose in the past years - small, portable indexes that are a single file (same with BoltDB in Go) - and it's amazing what you can do with it without hosting any infrastructure.

@kensipe kensipe merged commit c8e4295 into master Apr 14, 2020
@kensipe kensipe deleted the ken/search branch April 14, 2020 01:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release/highlight This PR is a highlight for the next release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability to search for available Frameworks
3 participants