-
Notifications
You must be signed in to change notification settings - Fork 244
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
Dropping support for service catalog based services #4906
Dropping support for service catalog based services #4906
Conversation
fea4d1c
to
0ce112d
Compare
✔️ Deploy Preview for odo-docusaurus-preview ready! 🔨 Explore the source changes: 9571113 🔍 Inspect the deploy log: https://app.netlify.com/sites/odo-docusaurus-preview/deploys/6119f3cb9650f10008db0189 😎 Browse the preview: https://deploy-preview-4906--odo-docusaurus-preview.netlify.app |
prow error |
5b04584
to
dea2b25
Compare
/refresh |
timeout |
timeouts |
a3c592e
to
e77c423
Compare
timed out |
ci error |
e77c423
to
ef23dd5
Compare
macos machine issue |
167e549
to
f075005
Compare
/test v4.7-integration-e2e |
/retest |
f075005
to
596511a
Compare
/retest |
1 similar comment
/retest |
596511a
to
2602f7c
Compare
service svc.ServiceClass | ||
plans []svc.ServicePlan | ||
// service svc.ServiceClass | ||
// plans []svc.ServicePlan |
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.
These fields are all related to Service Catalog. Remove them. We don't need them.
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.
removed
o.backend = NewServiceCatalogBackend() | ||
_, _, err = service.IsOperatorServiceNameValid(args[0]) | ||
if err != nil { | ||
return fmt.Errorf("invalid operator name and service catalog not supported %w", err) |
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 don't need to mention in CLI output that Service Catalog is not supported anymore. We should put it on our project documentation on the website and the changelog.
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.
removed
// Kubernetes or OpenShift 4.x cluster. It doesn't occur when there are | ||
// no operators installed. |
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.
I don't think we should remove these comments.
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.
I can still see them
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.
I'm seeing below:
// Error only occurs when OperatorHub is not installed/enabled on the
// Kubernetes or OpenShift 4.x cluster.
// Neither OperatorHub nor Service Catalog is enabled on the cluster
IMO, it should be:
// Error only occurs when OperatorHub is not installed/enabled on the
// Kubernetes or OpenShift 4.x cluster. It doesn't occur when there are
// no operators installed.
// OperatorHub is not enabled on the cluster
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.
Updated ptal
pkg/odo/cli/component/common_link.go
Outdated
cmpExists, err := component.Exists(o.Client, suppliedName, o.Application) | ||
if err != nil { | ||
return fmt.Errorf("Unable to determine if component exists:\n%v", err) | ||
} | ||
|
||
if !cmpExists && !svcExists { | ||
if !cmpExists { | ||
return fmt.Errorf("Neither a service nor a component named %s could be located. Please create one of the two before attempting to use 'odo %s'", suppliedName, o.operationName) |
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.
I know it's not modified as a part of this PR but errors shouldn't start with capital letter. Can you please change it?
return fmt.Errorf("Neither a service nor a component named %s could be located. Please create one of the two before attempting to use 'odo %s'", suppliedName, o.operationName) | |
return fmt.Errorf("neither a service nor a component named %s could be located. Please create one of the two before attempting to use 'odo %s'", suppliedName, o.operationName) |
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.
updated
pkg/odo/cli/service/list.go
Outdated
if o.Context.Project == "" || o.Context.Application == "" { | ||
return odoutil.ThrowContextError() | ||
} | ||
return fmt.Errorf("operator backed services not installed and service catalog is no longer supported") |
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.
Same suggestion. We don't need to mention Service Catalog on CLI any more.
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.
removed
pkg/odo/cli/service/service_test.go
Outdated
} | ||
return true | ||
} | ||
//func equal(s1, s2 []string) bool { |
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.
Why are we commenting? We can just remove it, no?
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.
removed file as it is last thing remaining
pkg/odo/cli/service/ui/ui.go
Outdated
"k8s.io/klog" | ||
|
||
scv1beta1 "github.com/kubernetes-sigs/service-catalog/pkg/apis/servicecatalog/v1beta1" |
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.
This import corresponds to Service Catalog. Is something in this file still doing something with it? Can we remove it?
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.
removed
When("user runs odo service commands with help flag", func() { | ||
It("should display the help for odo service -h", func() { | ||
appHelp := helper.Cmd("odo", "service", "-h").ShouldPass().Out() | ||
Expect(appHelp).To(ContainSubstring("Perform service catalog operations")) |
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.
IMO, we sholdn't be showing "service catalog" on CLI. I couldn't find another occurrence of this string being checked with a Ctrl+F
. We should remove it, IMO.
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.
updated
Co-authored-by: Parthvi Vala <pvala@redhat.com>
Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>
Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>
Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>
Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>
52f9ab9
to
9571113
Compare
reset and rebased, now il ensure some of the docs changes did not disappear |
Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>
Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>
@mohammedzee1000: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
project json format error |
Then perhaps we should consider renaming the interface to something like |
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.
Some little comments, LGTM otherwise
@@ -59,7 +47,7 @@ func (o *DescribeServiceOptions) Complete(name string, cmd *cobra.Command, args | |||
if _, _, err := service.SplitServiceKindName(args[0]); err == nil { |
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.
You can as usual handle the error case first:
if _, _, err := service.SplitServiceKindName(args[0]); err != nil {
return fmt.Errorf("no deployable operators found")
}
o.backend = NewOperatorBackend()
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.
I have a few concerns about the deleted unit tests and completion handlers, which still seem relevant, but they definitely need refactoring. Maybe we can comment the tests for now, and refactor them to work with services that we still support, i.e. Operator Backed Services.
Other than that, since the integration tests pass and no other irrelevant integration tests were deleted or modified, I am inclined to do a lgtm.
} | ||
} | ||
|
||
func TestLinkCompletionHandler(t *testing.T) { |
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.
I am not sure if we should completely remove these tests. I understand that they might need modification, but I don't think it's a good idea to completely remove them.
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.
Recorded an issue
} | ||
} | ||
|
||
func TestUnlinkCompletionHandler(t *testing.T) { |
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.
Same comment as TestLinkCompletionHandlers.
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.
Recorded in issue
} | ||
} | ||
|
||
func TestServiceClassCompletionHandler(t *testing.T) { |
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.
Which command does this handler test?
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.
Recorded in issue
@@ -1,9 +1,6 @@ | |||
package service |
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.
Are you sure unit tests in this file are not relevant anymore, even with the operator backed services?
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.
Recorded in issue before
@@ -1,124 +0,0 @@ | |||
package service |
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.
I don't think we should completely remove this unit test file, it is still relevant to operator backed services because we still have this command in odo. What it needs is refactoring.
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.
Recorded in issue before
"github.com/openshift/odo/pkg/storage" | ||
"github.com/openshift/odo/pkg/url" | ||
"github.com/openshift/odo/pkg/util" | ||
"github.com/posener/complete" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
// ServiceCompletionHandler provides service name completion for the current project and application |
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.
Are you sure we want to remove this handler? Wouldn't it be helpful with the OBS?
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.
Recorded in issue before
Co-authored-by: Philippe Martin <contact@elol.fr>
@valaparthvi opened issues as per discussion |
Co-authored-by: Philippe Martin <contact@elol.fr>
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
@mohammedzee1000 I am curious, why have you not removed the serviceCatalog references from the kclient package? Are they still relevant or are you planning to take them up in part 2? |
Yes, there are still usages in link and unlink and both should be dropped simultanously |
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.
No major changes have been made to the integration tests (except that of Service Catalog's) and they are all passing; all the remaining references will be removed in the next PR, hence I'm approving this PR.
Signed-off-by: Mohammed Zeeshan Ahmed mohammed.zee1000@gmail.com
What type of PR is this?
/kind code-refactoring
/kind cleanup
What does this PR do / why we need it:
We are dropping support for service catalog based services
Which issue(s) this PR fixes:
Fixes #4890
Fixes #5004
PR acceptance criteria:
Unit test
Integration test
Documentation
Update changelog
I have read the test guidelines
How to test changes / Special notes to the reviewer:
odo catalog list services
should not list service catalog even if it is available in cluster> ./odo catalog list services Services available through Operators NAME CRDs redis-operator.v0.6.0 RedisCluster, Redis service-binding-operator.v0.8.0 ServiceBinding
odo catalog describe service x/y
should describe operator backed service and fail otherwiseodo service create
should successfully create operator backed services and attempts to create service catalog should failodo service list
should only list operator backed servicesodo service delete
should successfully delete operator backed services