-
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
Add and remove service info from devfile #4465
Add and remove service info from devfile #4465
Conversation
Skipping CI for Draft Pull Request. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dharmit The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Unit test failed locally with following error: ? github.com/openshift/odo/cmd/cli-doc [no test files]
? github.com/openshift/odo/cmd/odo [no test files]
ok github.com/openshift/odo/pkg/application (cached)
ok github.com/openshift/odo/pkg/application/labels (cached)
? github.com/openshift/odo/pkg/auth [no test files]
ok github.com/openshift/odo/pkg/catalog (cached)
ok github.com/openshift/odo/pkg/component (cached)
ok github.com/openshift/odo/pkg/component/labels (cached)
ok github.com/openshift/odo/pkg/config (cached)
ok github.com/openshift/odo/pkg/debug (cached)
ok github.com/openshift/odo/pkg/devfile/adapters (cached)
⚠ there should be exactly one default command for command group build, currently there is no default command
⚠ there should be exactly one default command for command group debug, currently there is no default command
--- FAIL: TestGetCommandFromFlag (0.00s)
--- FAIL: TestGetCommandFromFlag/Case_9:_Valid_devfile_with_invalid_composite_commands (0.00s)
command_test.go:803: TestGetCommand unexpected error for command: build wantErr: true err: <nil>
• Executing command1 command "" ...
✓ Executing command1 command "" [1ms]
• Executing command2 command "" ...
✓ Executing command2 command "" [3ms]
• Executing command1 command "" ...
✗ Executing command1 command "" [734461ns]
• Executing command1 command "" ...
• Executing command2 command "" ...
✓ Executing command1 command "" [6ms]
✓ Executing command2 command "" [6ms]
• Executing command2 command "" ...
• Executing command1 command "" ...
✗ Executing command2 command "" [1ms]
✗ Executing command1 command "" [1ms]
• Executing command1 command "" ...
✓ Executing command1 command "" [448100ns]
• Executing command1 command "" ...
✓ Executing command1 command "" [478143ns]
• Executing command2 command "" ...
✓ Executing command2 command "" [519094ns]
• Executing command1 command "" ...
• Executing command1 command "" ...
✓ Executing command1 command "" [5ms]
✓ Executing command1 command "" [1ms]
• Executing command2 command "" ...
✓ Executing command2 command "" [577013ns]
FAIL
FAIL github.com/openshift/odo/pkg/devfile/adapters/common 0.205s
? github.com/openshift/odo/pkg/devfile/adapters/docker [no test files]
ok github.com/openshift/odo/pkg/devfile/adapters/docker/component (cached)
ok github.com/openshift/odo/pkg/devfile/adapters/docker/storage (cached)
ok github.com/openshift/odo/pkg/devfile/adapters/docker/utils (cached)
? github.com/openshift/odo/pkg/devfile/adapters/kubernetes [no test files]
ok github.com/openshift/odo/pkg/devfile/adapters/kubernetes/component (cached)
ok github.com/openshift/odo/pkg/devfile/adapters/kubernetes/storage (cached)
ok github.com/openshift/odo/pkg/devfile/adapters/kubernetes/utils (cached)
? github.com/openshift/odo/pkg/devfile/convert [no test files]
ok github.com/openshift/odo/pkg/devfile/validate (cached)
--- FAIL: TestValidateCommands (0.00s)
--- FAIL: TestValidateCommands/Case_8:_Duplicate_commands (0.00s)
commands_test.go:197: TestValidateAction unexpected error: <nil>
FAIL
FAIL github.com/openshift/odo/pkg/devfile/validate/generic 0.089s
ok github.com/openshift/odo/pkg/envinfo (cached)
ok github.com/openshift/odo/pkg/kclient (cached)
? github.com/openshift/odo/pkg/kclient/fake [no test files]
ok github.com/openshift/odo/pkg/lclient (cached)
? github.com/openshift/odo/pkg/localConfigProvider [no test files]
? github.com/openshift/odo/pkg/log [no test files]
? github.com/openshift/odo/pkg/log/fidget [no test files]
? github.com/openshift/odo/pkg/machineoutput [no test files]
ok github.com/openshift/odo/pkg/notify (cached) [no tests to run]
ok github.com/openshift/odo/pkg/occlient (cached)
? github.com/openshift/odo/pkg/odo/cli [no test files]
? github.com/openshift/odo/pkg/odo/cli/application [no test files]
? github.com/openshift/odo/pkg/odo/cli/catalog [no test files]
? github.com/openshift/odo/pkg/odo/cli/catalog/describe [no test files]
? github.com/openshift/odo/pkg/odo/cli/catalog/list [no test files]
? github.com/openshift/odo/pkg/odo/cli/catalog/search [no test files]
ok github.com/openshift/odo/pkg/odo/cli/catalog/util (cached)
? github.com/openshift/odo/pkg/odo/cli/component [no test files]
? github.com/openshift/odo/pkg/odo/cli/component/ui [no test files]
? github.com/openshift/odo/pkg/odo/cli/config [no test files]
? github.com/openshift/odo/pkg/odo/cli/debug [no test files]
ok github.com/openshift/odo/pkg/odo/cli/env (cached)
? github.com/openshift/odo/pkg/odo/cli/login [no test files]
? github.com/openshift/odo/pkg/odo/cli/logout [no test files]
? github.com/openshift/odo/pkg/odo/cli/plugins [no test files]
? github.com/openshift/odo/pkg/odo/cli/preference [no test files]
? github.com/openshift/odo/pkg/odo/cli/project [no test files]
? github.com/openshift/odo/pkg/odo/cli/registry [no test files]
ok github.com/openshift/odo/pkg/odo/cli/registry/util (cached)
ok github.com/openshift/odo/pkg/odo/cli/service (cached)
ok github.com/openshift/odo/pkg/odo/cli/service/ui (cached)
ok github.com/openshift/odo/pkg/odo/cli/storage (cached)
? github.com/openshift/odo/pkg/odo/cli/ui [no test files]
? github.com/openshift/odo/pkg/odo/cli/url [no test files]
ok github.com/openshift/odo/pkg/odo/cli/utils (cached)
? github.com/openshift/odo/pkg/odo/cli/version [no test files]
? github.com/openshift/odo/pkg/odo/genericclioptions [no test files]
ok github.com/openshift/odo/pkg/odo/util (cached)
ok github.com/openshift/odo/pkg/odo/util/completion (cached)
ok github.com/openshift/odo/pkg/odo/util/experimental (cached)
ok github.com/openshift/odo/pkg/odo/util/pushtarget (cached)
ok github.com/openshift/odo/pkg/odo/util/validation (cached)
ok github.com/openshift/odo/pkg/preference (cached)
ok github.com/openshift/odo/pkg/project (cached)
ok github.com/openshift/odo/pkg/secret (cached)
ok github.com/openshift/odo/pkg/service (cached)
ok github.com/openshift/odo/pkg/storage (cached)
ok github.com/openshift/odo/pkg/storage/labels (cached)
ok github.com/openshift/odo/pkg/sync (cached)
? github.com/openshift/odo/pkg/sync/mock [no test files]
ok github.com/openshift/odo/pkg/testingutil (cached)
? github.com/openshift/odo/pkg/testingutil/filesystem [no test files]
ok github.com/openshift/odo/pkg/url (cached)
ok github.com/openshift/odo/pkg/url/labels (cached)
ok github.com/openshift/odo/pkg/util (cached)
? github.com/openshift/odo/pkg/version [no test files]
ok github.com/openshift/odo/pkg/watch (cached)
FAIL
make: *** [Makefile:156: test] Error 1 |
Holding since creating a service from outside the component directory is resulting in panic instead of a proper error message: $ odo service create etcdoperator.v0.9.4-clusterwide/EtcdCluster
Deploying service "example" of type: "EtcdCluster"
✗ Deploying service [4ms]
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0xb0 pc=0x1439e65]
goroutine 1 [running]:
github.com/openshift/odo/pkg/envinfo.(*EnvSpecificInfo).AddServiceToDevfile(0x0, 0xc0006c2000, 0xba, 0xc000677830, 0x7, 0xba, 0x0)
/home/dshah/go/src/github.com/openshift/odo/pkg/envinfo/service.go:29 +0x125
github.com/openshift/odo/pkg/service.CreateOperatorService(0xc0005b99e0, 0x0, 0xc000677830, 0x7, 0xc000a30a2d, 0x18, 0xc000676d86, 0x7, 0xc000a30a20, 0xc, ...)
/home/dshah/go/src/github.com/openshift/odo/pkg/service/service.go:117 +0x12e
github.com/openshift/odo/pkg/odo/cli/service.(*OperatorBackend).RunServiceCreate(0xc0004403c0, 0xc000835e40, 0x0, 0x0)
/home/dshah/go/src/github.com/openshift/odo/pkg/odo/cli/service/backends.go:223 +0x2a3
github.com/openshift/odo/pkg/odo/cli/service.(*CreateOptions).Run(0xc000835e40, 0x0, 0x0)
/home/dshah/go/src/github.com/openshift/odo/pkg/odo/cli/service/create.go:168 +0x43
github.com/openshift/odo/pkg/odo/genericclioptions.GenericRun(0x232a180, 0xc000835e40, 0xc00075f180, 0xc00076e950, 0x1, 0x1)
/home/dshah/go/src/github.com/openshift/odo/pkg/odo/genericclioptions/runnable.go:31 +0x13c
github.com/openshift/odo/pkg/odo/cli/service.NewCmdServiceCreate.func1(0xc00075f180, 0xc00076e950, 0x1, 0x1)
/home/dshah/go/src/github.com/openshift/odo/pkg/odo/cli/service/create.go:194 +0x5e
github.com/spf13/cobra.(*Command).execute(0xc00075f180, 0xc00076e930, 0x1, 0x1, 0xc00075f180, 0xc00076e930)
/home/dshah/go/src/github.com/openshift/odo/vendor/github.com/spf13/cobra/command.go:830 +0x2aa
github.com/spf13/cobra.(*Command).ExecuteC(0xc000612c80, 0x20beed0, 0xc00005c360, 0x3)
/home/dshah/go/src/github.com/openshift/odo/vendor/github.com/spf13/cobra/command.go:914 +0x2fb
github.com/spf13/cobra.(*Command).Execute(...)
/home/dshah/go/src/github.com/openshift/odo/vendor/github.com/spf13/cobra/command.go:864
main.main()
/home/dshah/go/src/github.com/openshift/odo/cmd/odo/odo.go:67 +0x330 /hold |
Unit test failure:
|
@kadel @mik-dass @girishramnani @valaparthvi This PR is ready for review now. TBH, there was a lot of tangential stuff I had to address while working on this, so apologies in advance if I missed something obvious. 😄 Also, I have skipped adding integration tests but added unit tests. I'd prefer not to add more integration tests unless it's really, really required. |
Test failures are showing up at places that have not been modified by this PR. /test v4.7-integration-e2e |
Things that still need to be addressed:
|
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 comments around new devfile/library funcs
|
/test v4.7-integration-e2e |
Changed function name from `AddServiceToDevfile` to `AddKubernetesComponentToDevfile`. Similar name change for delete function. Also, moves it from `pkg/envinfo` to `pkg/service` package
"odo service create" without any arguments was panicking.
Fixing issues to play well with ConsentTelemetry being set to false before each test runs and with the change in this PR to execute service create and delete commands from the component's directory.
@dharmit: The following tests 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. |
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.
/lgtm
What type of PR is this?
/kind feature
/kind code-refactoring
What does this PR do / why we need it:
devfile.yaml
odo service create
andodo service delete
CLI packages to use interfaceWhich issue(s) this PR fixes:
Addresses acceptance criteria discussed in:
It also makes changes to
pkg/envinfo/storage.go
to be compatible with changes introduced indevfile/library
.PR acceptance criteria:
Unit test
Integration test
Documentation
I have read the test guidelines
How to test changes / Special notes to the reviewer:
odo service create
should add CRD and ServiceInstance information todevfile.yaml
.odo service delete
should remove the CRD information fromdevfile.yaml
.odo storage create
andodo storage delete
should work as they work in currentmaster
branch. Code for these commands was changed to be compatible with changes introduced indevfile/library
.