* Change NewRunHandler params with Options
* Pass an options to RunHandler to show logs
* Hide spinner and std output since outputs are displayed
* Integration tests with failing command
* Fix outputs
* use raw terminal and local standard i/o streams
* Fix podman i/o
* Fix stdout/err
* Test if in/out are terminal
* command reference doc
* Add a run command
* Check command name passed as arg
* Check platform is available
* Add a Run method to the DevClient
* Run command on cluster
* Add test with run command on cluster
* Implement and test run on podman
* Enhance test to check that command has been executed in container
* Fix `odo help` test
* Refactor common code for podman/cluster
* Test Apply commands on Kubernetes/Images
* Test a msg is displayed when executing odo run without odo dev
* Review
* makes GetRunningPodFromSelector return only Running pods on Podman
* Add test cases simulating build or run commands that take very long
* Pass a context around to relevant functions and methods
This will allow to handle cancellations and timeouts and deadlines as needed
* Pass the context to Podman exec command too
* fixup! Add test cases simulating build or run commands that take very long
* Panic if platform for Exec is not supported yet
This will make the error more visible,
instead of hiding it.
* Use a consistent receiver name in 'pkg/kclient.Client#DeploymentWatcher'
* Make 'pkg/logs/LogsClient' rely on the generic 'platform.Client'
Co-authored-by: Philippe Martin <phmartin@redhat.com>
* Make 'pkg/component#Log' function rely on the generic 'platform.Client'
Co-authored-by: Philippe Martin <phmartin@redhat.com>
* Make the 'execHandler' in 'pkg/component' rely on the generic 'platform.Client'
Co-authored-by: Philippe Martin <phmartin@redhat.com>
* Move 'matchOwnerReferenceWithResources' unit tests from 'pkg/logs' to 'pkg/kclient'
Those tests are specific to the Kubernetes implementation.
Co-authored-by: Philippe Martin <phmartin@redhat.com>
* Remove kclient from interface / signatures
* Create Exec package
* Call ExecuteCommand with client
* Call ExecuteCommand with client from sync package
* Fix order of dependencies
* refactor: simplify execution of devfile commands
Fixes#3518
* fix: remove mistakenly re-added PlatformAdapter interface
* refactor: move catalog list output to where it's actually needed
This simplifies the package organization by avoiding to import catalog-
related packages in the lower-level machine output package.
* feat: add LoggingClient method on ComponentAdapter interface
* refactor: rename all receivers similarly
* fix: typo
* refactor: ComponentAdapter implements ExecClient, simplify Execute
* fix: typo
* refactor: introduce GenericAdapter to share more code
* chore: remove now unneeded methods
* fix: update from master
* fix: improper code to ExecuteCommand
* fix: properly initialize Client in adapters
* fix: update tests
* chore: add docs [skip ci]
* refactor: expose component info factory methods
* feat: add ExplicitSpinner function
* refactor: simplify adapters using NewMachineEventLoggingClient factory
* refactor: introduce command concept following the composite pattern
Still needs a lot of work to accommodate composite-support changes
* refactor: re-implement command execution using composite commands
* refactor: re-organize command implementations in multiple files
* doc: document New and command
* fix: typo
* fix: change var name
* fix: improper check for composite command
* clean-up: unneeded code
* refactor: rename ExecuteDevfileCommandSynchronously more appropriately
* chore: re-add some tests
* fix: init the ComponentInfoFactories after the GenericAdapter is created
This is needed because the previous implementation resulted in the
componentInfo and supervisorComponentInfo variables capturing
uninitialized adapters and thus causing errors.
* chore: add documentation
* fix: use Errorf instead of Wrapf since there is no error to wrap
* fix: infinite loop
* fix: do not report an error if the supervisor container is not found
* fix: only start the supervisor if we found its container
* fix: remove redundant check
* fix: supervisor commands now use proper component info
Introduced newSupervisor*Command to encapsulate supervisor command
details.
* fix: do not add to composite if supervisor command is nil
* fix: supervisor start/stop should be more like regular simple commands
* fix: add newline at the end of output
* doc: add documentation
[skip ci]
* refactor: rename createFrom to createCommandFrom
* refactor: make sourcePath a const and move it where it's used
* fix: comment out failing tests
See #3685
* fix: typo
* doc: clarify simpleCommand's behavior with respect to commands
[skip ci]
* feat: do not show spinner if message is empty
* fix: do not show spinner for stop command
* fix: remove unneeded fmt.Sprintf call
* chore: update after rebase
* Adds debug command for devfiles
* Fixes comments and variable names
* Adds devfile debug test on kubernetes cluster
* Fixes adapter code for debug
Signed-off-by: mik-dass <mrinald7@gmail.com>
* Converts v1 debug test devfile to v2
* Moves container arg and command overriding to a new function
* Simplifies conditions in test
* Modifies execDevfile for kubernetes component adapter
* Simplies error checking logic in TestUpdateContainersWithSupervisord
* Removes unnecessary else if conditions
* Installs socat before running tests on kubernetes cluster
**What type of PR is this?**
/kind bug
**What does does this PR do / why we need it**:
Fixes a potential flake with regards to when writing to cmdOutput at the
same time that log.ErrorF(...) is reading from it.
**Which issue(s) this PR fixes**:
Closes https://github.com/openshift/odo/issues/2828
**How to test changes / Special notes to the reviewer**:
N/A, honestly not too sure
* Add Devfile Parser V2, Update Common Structs (#3188)
* Add Devfile Parser for Version 2.0.0
Added Devfile V2 Go Structures
Added converter for v2 ro common types
Signed-off-by: adisky <adsharma@redhat.com>
* Add example V2 devfile
added example nodejs V2 devfile
* Add Common Types as V2
Add common types as v2
Add Converter from common to v1
* Updated example devfile with group
* Fixes command.go and kubernetes adapter (#3194)
Signed-off-by: mik-dass <mrinald7@gmail.com>
* Fixes utils of k8s adapter (#3195)
* Update Command Logic to use groups (#3196)
* Updates create logic to v2 (#3200)
* Fixes utils of docker docker adapter (#3198)
Signed-off-by: mik-dass <mrinald7@gmail.com>
* Update Docker and Kubernetes adapter to use groups (#3206)
* Update Docker and Kubernetes adapter to use groups
* Update Some Validation
Incorporate some review comments for commands Map
Update Some Validation logic
* Updated Logs for V2 (#3208)
Fixed interface implementation for v2
Updated logs
refactored commands.go
* Avoid String Pointers (#3209)
While converting v1 to v2 types, string pointers are prone to cause
null pointer error. This PR updates struct fields from string
pointers to string
* Update commands check
* Fixes lower and upper case for commands (#3219)
* Fixes type of project and components for devfile v1 (#3228)
* Update testing utils (#3220)
* Update command tests
Updated Command tests to v2
Removed some cases like command type validation, that will be
validated by schema only.
* Fix common adapters tests
All devfile.adapters.common unit tests are fixed
* Add tests for Mismatched type
Fix devfile.adapters.Kubernetes.Component unit tests
* Add TestCase for default command
* Design proposal: Event notification support for build and application status for IDE integration for devfile scenarios (#2550) (#3177)
* Add event notification proposal
[skip ci]
* Update event-notification.md
* Update event-notification.md
* Update event-notification.md
* Update event-notification.md
* Update event-notification.md
* Update event-notification.md
* Update event-notification.md
* Update event-notification.md
* Fix Integration tests for devfile v2 (#3236)
* Fix Integration tests
Correct volume structure
Fix supervisord binary insertion for docker
Insert command and args in build container fr docker
* Fix Integration tests
Revert commands, args removal
Add commands, args in v2 common structs
Fix duplicate volume error
* Fixes unit tests (#3240)
Signed-off-by: mik-dass <mrinald7@gmail.com>
* Add devfiles V2 examples (#3253)
Add devfiles v2 examples for springboot and nodejs
* Fix regression by sparse checkout dir PR (#3258)
fix regression caused by rebase to master.
Also add github, zip as supported project types.
* Address review comments (#3267)
* Address review comments part 2
fix log levels to v4
fix error formatting
add case no's in test cases
update some comments
* Address review comments part 2
Remove validation for group
Co-authored-by: Mrinal Das <mrinald7@gmail.com>
Co-authored-by: Jonathan West <jgwest@users.noreply.github.com>
* Add Support of attribute restart
If command attribute restart is false in devfile, then the
devRun command would not be restarted.
* Add Intregration test for attribute restart
* Added Support of restart attribute for docker type component
Signed-off-by: adisky <adsharma@redhat.com>