* Make sure to run parallel commands part of a composite command in parallel
* Display warnings in case there are errors when executing pre-stop events
* Fix the command_composite_parallel.go implementation by lowering the case of the sub-command names
Since this passed the Devfile validation logic, we should use the same logic as in command_composite.go
* Remove API Server from experimental mode, set UI Server as experimental
* Adapt api-server integration tests
* Disable --api-server by default in the tests
They are enabled only if `options.StartAPIServer`
is explicitly enabled.
This is to avoid potential port conflicting issue,
especially on Windows - see [1]
[1] https://github.com/redhat-developer/odo/issues/6939
* Error out if `--api-server-port` is set but `--api-server` is false
---------
Co-authored-by: Armel Soro <asoro@redhat.com>
* refactor: Set the experimental mode env var in a single place for the '--api-server' related tests
* Add integration tests highlighting the expectations
* Make the state client return the API server ports per platform
'odo dev' might be running on both cluster and podman,
so we might end up with several API servers.
* Make 'odo describe component' return information about the API Server and web UI
This is viewable only when running 'odo describe component'
with the experimental mode enabled.
* fixup! refactor: Set the experimental mode env var in a single place for the '--api-server' related tests
* Unit-test describe#filterByPlatform logic
* Simplify logic for 'describe#filterByPlatform', as suggested in review
Co-authored-by: Philippe Martin <phmartin@redhat.com>
---------
Co-authored-by: Philippe Martin <phmartin@redhat.com>
* Add integration tests highlighting the expectations
* Add and fill a 'Commands' field from the DevfileData struct returned by `describe`
* Display commands in the human-readable output of 'odo describe'
* Add documentation and sample outputs
* Pass odo context to api server
* Get /instance
* DELETE /instance implementation
* Move describe logic to pkg/component/describe
* Get /component implementation
* POST /component/command implementation
* Fix example by replacing action with name
* Fix integration test
* Integration tests
* Add comment for PushWatcher
* Test DELETE /instance without --no-watch
* Apply suggestions from code review
Co-authored-by: Armel Soro <armel@rm3l.org>
* Return an error if not ready for push
* Fix windows tests
* Fix tests for Windows
---------
Co-authored-by: Armel Soro <armel@rm3l.org>
* 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
* Document current implementations of command handlers
* Add unit tests for execHAndler
* Refactor pkg/devfile/image to inject Backend as dependency
* Use same handler for kubedev/podmandev
* Fail after SelectBackend==nil only if backend is needed
* Move runHandler to dev/common
* Unit tests for runHandler
* Create a component.ExecuteTerminatingCommand
* ExecuteTerminatingCommand/ExecuteNonTerminatingCommand for Handler
* Fix calling other command types
* Consider parent group to determine if a command is terminating
* Replace component.execHandler by common.runHandler
* Remove execHandler
* Make runHandler and most of fields private and pass containersRunning to handler
* Pass containersRunning value
* deploy using common Handler
* Fix tests
* Use specific Dev/Deploy mode for Apply
* Fix cmdline for job
* Fix unit tests
* Pass appName and componentName with ctx to handler
* Move handler to pkg/component package
* Update doc
* Unit tests Deploy
* Unit tests Build
* Unit tests Run
* Unit tests PostStart
* Unit tests PreStop
* Update doc
* Fix Podman tests
* Fix hotReload on podman
* Change podman version timeout to 30s for tests
* Cleanup + fix doc
* Add integration tests highlighting our expectations
* Bump Devfile library to latest commit
f041d79870
* Expose preference that allows users to globally configure an image registry
* Return the effective Devfile view by default from the initial context
This is supposed to be read-only, so that tools can rely on it
and to the operations they need to perform right away.
Raw Devfile objects can still be obtained upon request
if there is need to update them (for example via 'odo add/remove
binding' commands.
* Pass the image registry preference to the Devfile parser to build the effective view
* Fix 'odo init' integration tests
- The test spec was actually not doing what it was supposed to do
- Now 'odo init' returns a complete Devfile, where the parent is flattened,
because the goal of 'odo init' is to bootstrap a Devfile.
Previously, 'odo init' would not download the parent referenced,
making it hard to understand the resulting Devfile.
* Document how odo now handles relative image names as selectors
* fixup! Document how odo now handles relative image names as selectors
Co-authored-by: Philippe Martin <phmartin@redhat.com>
* Revert "Fix 'odo init' integration tests"
This reverts commit 78868b03fd.
Co-authored-by: Philippe Martin <phmartin@redhat.com>
* Do not make `odo init` return an effective Devfile as a result
This would change the behavior of `odo init`.
Furthermore, due to an issue [1] in the Devfile library,
it is not possible to parse some Devfiles with parents linked as GitHub URLs (like GitHub release artifacts).
[1] https://github.com/devfile/api/issues/1119
Co-authored-by: Philippe Martin <phmartin@redhat.com>
* fixup! Document how odo now handles relative image names as selectors
---------
Co-authored-by: Philippe Martin <phmartin@redhat.com>
* On cluster, run Build command again only if Build command itself is not hotReloadCapable
* On Podman, execute Build command only if itself is not hotReloadcapable
* Handle hotReloadCapable in handler
* Add integration tests
* Update doc
* review
* 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
* Remove podman from experimental mode
* Remove env var for odo dev
* Cleanup tests and sources about experimental mode
* Hide "Experimental mode" doc page
* Cleanup latest commit
* doc odo dev --platform podman
* Doc other commands
* Apply suggestions from code review
Co-authored-by: Armel Soro <armel@rm3l.org>
* Remove more ODO_EXPERIMENTAL_MODE from latest commits on main
* Remove reference to Experimental mode from blog posts
---------
Co-authored-by: Armel Soro <armel@rm3l.org>
* Do not display the full command-line when handling exec commands and no msg is specified
Displaying it adds a lot of unnecessary clutter.
* Display a shorter message when handling commands bound to 'pre-stop' events
This is to be more consistent with how the other messages are displayed.
* Display a shorter message when handling commands bound to 'post-start' events
This is to be more consistent with how the other messages are displayed.
* Fix integration tests
* fixup! Fix integration tests
* Add integration test case
Co-authored-by: Anand Kumar Singh <anandrkskd@gmail.com>
Co-authored-by: Philippe Martin <phmartin@redhat.com>
* Add ApplyOpenShift method to handler
* Test openhift component with odo dev
* Rename GetKubernetesComponentsToPush to GetK8sAndOcComponentsToPush and modify if to obtain both k8s and oc components
Signed-off-by: Parthvi Vala <pvala@redhat.com>
* Fix unit test failures with delete_test
Signed-off-by: Parthvi Vala <pvala@redhat.com>
* update ListClusterResourcesToDeleteFromDevfile to fetch openshift component,Add ListOpenShiftComponents
Signed-off-by: anandrkskd <anandrkskd@gmail.com>
* fix testcase 'should have deleted the old resource and created the new resource' and add helper function ReplaceStrings
Signed-off-by: anandrkskd <anandrkskd@gmail.com>
* fix debug test to check openshift component
Signed-off-by: anandrkskd <anandrkskd@gmail.com>
* Update GetBindingsFromDevfile to include openshift components
* Update offline tests
* Add openshift component to devfiles
* Update tests
* Fix binding tests
* Fix RemoveBinding unit tests
* Handle OpenShift components when removing binding
* odo describe component displaysOpenShift components
* Remove unused function
---------
Signed-off-by: Parthvi Vala <pvala@redhat.com>
Signed-off-by: anandrkskd <anandrkskd@gmail.com>
Co-authored-by: Anand Kumar Singh <anandrkskd@gmail.com>
Co-authored-by: Philippe Martin <phmartin@redhat.com>
Co-authored-by: Parthvi Vala <pvala@redhat.com>
* Add '--running-in' CLI flag to 'odo delete component'
* Use the provided 'running-in' to filter resources candidate for deletion on both cluster and Podman
* Update 'odo delete component' confirmation and success messages to mention the provided value for 'running-in'
* Add unit test cases
* Add integration test cases
* Extract sample outputs from delete-component command reference docs
* Add documentation for the '--running-in' flag
* Update the Devfile library
* Add test for container-overrides and pod-overrides attributes
Signed-off-by: Parthvi Vala <pvala@redhat.com>
Attempt at fixing CI failures
Signed-off-by: Parthvi Vala <pvala@redhat.com>
* Fix CI failure
* Attempt at fixing OC integration test failures
Signed-off-by: Parthvi Vala <pvala@redhat.com>
* Use random name in integration test
Signed-off-by: Parthvi Vala <pvala@redhat.com>
* Rebase and fix integration test failure
Signed-off-by: Parthvi Vala <pvala@redhat.com>
* Make integration test work for podman
Signed-off-by: Parthvi Vala <pvala@redhat.com>
* Temp attempt at fixing podman test for GH
Signed-off-by: Parthvi Vala <pvala@redhat.com>
* Another attempt at fixing CI test for podman
Signed-off-by: Parthvi Vala <pvala@redhat.com>
* One more attempt at fixing integration test for podman
Signed-off-by: Parthvi Vala <pvala@redhat.com>
Signed-off-by: Parthvi Vala <pvala@redhat.com>
* Implement GetRunningPodFromSelector for podman
* Implement GetPodLogs for podman
* Same message in podman/cluster
* Integration tests
* Return stream of stdout/err
* Rename pkg/odo/commonflags/run_on.go to pkg/odo/commonflags/platform.go and change runOn to platform
* Rename feature
* Rename into pkg/odo/commonflags/context/
* Update comments
* Update doc
* fix comment
* Update integration tests
* Duplicate runningOn field with platform + deprecated runningOn
* Mark RunningOn as Deprecated
* Do not modify blog post
* Fix typo
* Add exception for SA1019
* odo describe component
* Fix integration tests for odo describe component
* Allow using the '--run-on' flag with 'odo describe component'
* Add "platform" to the ForwardedPort output
* Move RunningMode* structs to a dedicated file and add (tested) method for merging running modes
* Add RunningOn field to the Component API
* Make component#GetRunningModes able to return all modes for all specified platforms
* Do not display the namespace from NoComponentFoundError if no namespace is set
* Add more validation logic to the 'describe component' CLI
* Update 'odo describe component' logic for Devfile-based component
* Update 'odo describe component' logic for name-based component
This checks for the component with such name on all platforms.
If it finds several components on both platforms, it needs to extract
Devfile information from those resources.
To do so, it checks if the relevant labels (project type and name) are matching.
It errors out if they do not match, because this would imply that we
don't know what to display as Devfile information.
* Conditionally display "running on" information in human-readable output.
This is displayed only if the "run-on" feature is enabled.
* Implement GetAllResourcesFromSelector in the PodmanCli client
* Add more unit tests
* Update integration tests
* fixup! Update integration tests
* fixup! fixup! Update integration tests
* odo delete component with name
* Add unit test
* Add integration tests
* common printDevfileComponents
* fix name
* spinners + newlines
* Update info message with podman and/or cluster
* Make odo delete component work without kubeconfig
* Make odo delete component work when non auth
* Support run-on flag
* Do not delete cluster resources when running on podman
* No error when deleting component by name without cluster
* Refacto cleanup pod
* Add PodLs and KubeGenerate methods to pkg/podman
* List and delete Podman Pods
* Add integration tests
* Fix msg + when experimental is disabled
* Review (except UT)
* Add unit test
* restrict platforms earlier
* Rename GetK8sManifestWithVariablesSubstituted to GetK8sManifestsWithVariablesSubstituted
* Add GetK8sComponentAsUnstructuredList; add support for multiple manifests in a single k8s component
Signed-off-by: Parthvi Vala <pvala@redhat.com>
* Use GetK8sComponentAsUnstructuredList in binding/remove.go
* Use GetK8sComponentAsUnstructuredList in component/component_test.go
* Use GetK8sComponentAsUnstructuredList in libdevfile/component_kubernetes_utils.go
* Use GetK8sComponentAsUnstructuredList in service/service.go
* Use GetK8sComponentAsUnstructuredList in devfile/adapters/kubernetes/component/adapter.go
* Add documentation for GetK8sComponentAsUnstructuredList and remove GetK8sComponentAsUnstructured
* Fix createOrUpdateServiceForComponent to fetch only the service created for the component
* Add integration test for odo deploy
* Add integration test for odo dev
* Attempt at fixing list/describe binding tests; fixes old mishap
Signed-off-by: Parthvi Vala <pvala@redhat.com>
* Check for empty list of binding
Signed-off-by: Parthvi Vala <pvala@redhat.com>
Signed-off-by: Parthvi Vala <pvala@redhat.com>
* Enable run-on flag
* List all components
* Select specific platform with --run-on flag
* Make podmanClient nil if no podman client is accessible
* integration test
* Delay the display of warnings related to experimental features
* Add logs displaying podman commands executed
* Use None when Running On is empty
* odo list
* Run build-images command without cluster
* Test odo remove binding without cluster
* Make odo describe component work without cluster
* Tests: configure cluster depending on nocluster label
* Make odo list component work when --namespace is not used
* Test odo list component before deployment without cluster
* Some Generic tests
* Unset KUBERNETES_SERVICE_HOST to disable in-cluster config
* Set KUBECONFIG to empty file for no-cluster tests
* Run no-cluster tests on Windows
* Fix ListIngresses related changes
* Add warning/error when no cluster connection is available
* List routes/ingresses deployed by odo in the describe output
* Remove ListDyanmicResourcesFromSelector and use ListDyanmicResources instead by add a selector argument to it
Signed-off-by: Parthvi Vala <pvala@redhat.com>
* Update pkg/api/component.go
Co-authored-by: Armel Soro <armel@rm3l.org>
* Replace DyanmicClient for ingress with a kubeclient
* Show ing/route name if *.hosts is empty
* Change API format
* Ignore owned ing/routes
* Add devfile with default backend ingress
* Add tests for named describe command
* mock kclient
* Fix integration test failure
* Fix integration test failure with registry
* Add test for ingress with default backend
* Add unit test for ListRoutesAndIngresses
* Add documentation
* Fix circular dependency and test failures
* Update upstream docs
* Fix integration test and add unit test for owner reference
* DRY the unit test code
* Update pkg/component/component.go
Co-authored-by: Philippe Martin <contact@elol.fr>
* Use context to obtain app
* rm3l's review
Signed-off-by: Parthvi Vala <pvala@redhat.com>
Co-authored-by: Armel Soro <armel@rm3l.org>
Co-authored-by: Philippe Martin <contact@elol.fr>
* 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 non existing --project flag
* do not set the namespace as it is already the set one
* Use ctx to pass namespace
* Remove KClient from old context
* Pass appname through Context
* Remove unnecessary ctx builders
* Remove unused LocalConfigProvider from old context
* Move DevfileObj outside of Context EnvSpecificInfo
* Move DevfilePath outside of Context EnvSpecificInfoD
* Remove unused componentContext from old context
* Remove context flag
* Pre-run Init in a generic way
* Pass working directory in context
* Get Devfile and pass it in ctx, and use it for odo dev
* add binding: use new context
* build-images: use new context
* create namespace: use new context
* list namespace: use new context
* set namespace: use new context
* delete namespace: use new context
* delete component: use new context
* deploy: use new context
* describe binding: use new context
* list binding: use new context
* remove binding: use new context
* describe component: use new context
* list component: use new context
* list: use new context
* list services: use new context
* logout: use new context
* logs: use new context
* Remove old context code
* Some refactoring to avoid passing ctx when building it
to avoid complex dependency management during this building
* More doc on context.Get* functions
* Remove kclient from interface / signatures
* Create Exec package
* Call ExecuteCommand with client
* Call ExecuteCommand with client from sync package
* Fix order of dependencies
* Add runtime label based on metadata:language/projectType
* Add integration tests for odo dev
* odo deploy integration test
* Reverse priority between pojectType and language
* Use map for runningIn instead of array
* Set false entries in runningIn map
* Rename RunningModeList to RunningModes + fix doc
* Fix integration test
* Move 'starter_project.go' from 'pkg/component' to 'pkg/registry'
Functions in this file are only called from the 'registry' package,
so it makes sense for this file to belong to this package.
Furthermore, this paves the way to calling 'alizer.DetectName' from 'component.go',
thus avoiding a cyclic dependency between packages.
* Introduce central logic for determining component names in 'pkg/component/component.go'
This rewrites the 'component#GatherName' function that was already there,
but not used, to meet the expectations, i.e.:
- use 'metadata.name' field (after sanitizing it) if it is defined in the Devfile
- otherwise, use Alizer to detect the name. Under the hood, this leverages the 'alizer#DetectName' introduced in 83ad3ee, which means that:
-- use Alizer to detect the name automatically
-- otherwise, use the name of the Devfile base directory after sanitizing it
* Compute and store the component name in the CLI context, and pass it as needed
As commented out in [1], the context should ideally be built
and passed down to the business clients structs.
[1] https://github.com/redhat-developer/odo/pull/6015#discussion_r957005479
* Enrich relevant integration test cases
For the sake of both performance and readability,
only the tests that break in the absence of a 'metadata.name'
field in their Devfiles have been updated (to test this specific case).
* Add test case for 'odo dev' when a project with no source code is used with no 'metadata.name' in the Devfile
The rationale behind this is to purposely make
the Alizer library unable to detect the project.
Per the requirements, this would force us to use the project
directory name as component name.
This highlights an interesting behavior if the project
directory name is all-numeric (as is the case in our tests);
our sanitization logic automatically prepends an "x" prefix
to the directory name, so it can be used as a valid name
for the component.
* Remove GetApplication from LocalConfigProvider interface and all related stuff
* Remove GetName from LocalConfigProvider interface and all related stuff
* Remove GetContainers from LocalConfigProvider interface
* Remove Exists method from LocalConfigProvider interface and stop odo dev writing env.yaml file
* Remove GetDebugort method from LocalConfigProvider interface + fix#6056
* Remove unnecessary fields from EnvInfo structure
* Remove all references to env.yaml file
* Review
* Test for #6056
* Create auxialiary functions to find current deployment and pod name
* Create auxialiary function for pushing Kubernetes components to cluster
* Auxiliary function getPushDevfileCommands and remocve RunModeChanged flag as it is not possible anymore with long running dev command
+ move prelimiray tests at the beginning
* Create auxiliary function updatePVCsOwnerReferences + move isMainStorageEphemeral inside aux. function
* Watch for deployments in addition to watching for files during odo dev
* - Check the Deployment Generation to return earlier when generation changed
- Return earlier when pod is not ready
* Push receives a Status that it can update, to indicate the status of the component when the function returns. This status is passed from Start to Watch
* Use status to decide to sync files
* Simplify getting pod
* Status for PostStartEvents
* - Touch .gitignore earlier so it is not synced
- Add devstate.jso file to .gitignore
* Fix the integration tests.
* Make --no-watch work again
* Get smaller volumes for tests
* Quit when fail to exec port forwarding
* Exponential delay after an error
* Fix: get running pod
* Remove testing odo dev stops when the build command fails. odo dev now gives a change to the user to fix the problem
* Fix order or volumes and volume mounts in pod spec
* Use server side apply for updating PVC when supported
* Watch Devfile separately
* Adapt tests for devfile handled separately
* Update forwarded ports when necessary
* Display kubernetes resources created only when created/updated
* Do not set ResourceVersion when patching
* TEMP: Add more logs on failing integrattests
* Tests: select the *running* pod
* Use forward slashes for .gitignore content, even on Windows
* Rename GetOnePodFromSelector to GetRunningPodFromSelector
* Cleanup logs
* Fix 'odo log' integration test
* Add log "Waiting for Kubernetes resources"
* Fail if service bindings are not injected
* Rename sources related watcher, timer
* Fix delay after error
* Display info about Pod
* Disambiguate error messages
* Display events related to components pod
* Remove now unused functions used to wait for Deployment / Pod
* Typos + function renaming
* Do not watch devfile with --no-watch
* Use type switch for Kubernertes watch event
* Do not fail when watching Events is Forbidden
* Do not fail when servicebinding resources are forbidden
* Exit when build command fails on no-watch mode
* Sync devfile.yaml by default, workaround when commands change on devfile
* Rename to warningsWatcher
* Fix comment
* Change integration test expectations regarding composite run commands
* Add integration test supporting composite debug commands
* Rename in-container pid file from '.odo_devfile_cmd_<name>.pid' into '.odo_cmd_<name>.pid'
The implementation in kubeexec.go is indeed able to run any kind of commands,
not only Devfile-related.
* Pave the way to supporting composite run/debug commands
Drop validation rules that prevented from going further
with composite run or debug commands.
* Update logic for determining which containers should have their entrypoint overridden or env vars updated
The previous implementation was limited to Exec commands solely.
This now makes it easier to support other kind of commands.
For example, when handling a composite command, we are now recursively
determining the containers (a.k.a components) that would get used by this composite command.
* Store the process exit code in the pid file handled by kubeexec.go
This allows to more accurately determine how the process could be reported.
* Fix issue with util#DisplayLogs potentially not picking the last element of lines
* Make sure to execute the Build command only once when running a composite command
* Test that the Build command is executed once running a composite command
* Make sure not to retrieve the parent default command uselessly
* Log the command Id when it is about to be restarted
* Redirect build command logs to PID 1 process
This way, users would be able to display them (and follow them) with `odo logs` or `kubectl logs`
* Handle Errored case when logging information about the process that exited
* Make sure to override container entrypoint if needed for Build commands
Build commands (which could also be composite ones)
might be executed in a container different from the run or debug ones.
* Redirect output from commands handled by component.exec_handler to PID 1 process streams
This way, we can also have them displayed with `odo logs` or `kubectl logs`.
This includes Build and Devfile events commands.
* Make remotecmd#ExecuteCommand log stdout or stderr content only if there not empty
This reduces the clutter in case of an error with the command execution.
* Add integration test with more complex Devfile (composite build/run/debug commands running in different containers and with a shared volume)
* Update the 'Executing the application' spinner accordingly when the related command is done
* Introduce new 'pkg/remotecmd' package
This package allows to execute commands in remote packages
and exposes an interface for managing processes associated
to given Devfile commands.
* Rely on 'pkg/libdevfile' as much as possible for Devfile command execution
This requires passing a handler at the odo side,
which in turns uses the 'pkg/remotecmd' package to
run commands in remote containers.
* Switch to running without Supervisord as PID 1 in containers
To do this, the idea is to start the container component:
1- using the command/args defined in the Devfile
2- using whatever was defined in the container image
if there is no command/args defined in the Devfile
Then, once the container is started, we would execute the Devfile
commands directly in the container component, just like a simple
'kubectl exec' command would do.
Since this is a long-running command (and potentially never ending),
we would need to run it in the background, i.e. in a side goroutine.
Point 2) above requires implementing a temporary hack (as discussed in [1]),
without us having to wait for [2] to be merged on the Devfile side.
This temporary hack overrides the container entrypoint with "tail -f /dev/null"
if the component defines no command or args (in which case we should have
used whatever is defined in the image, per the specification).
[1] https://github.com/redhat-developer/odo/pull/5768#issuecomment-1147190409
[2] https://github.com/devfile/registry/pull/102
* Rename K8s adapter struct 'client' field into 'kubeClient', as suggested in review
* Rename sync adapter struct 'client' fields to better distinguish between them
* Make sure messages displayed to users running 'odo dev' are the same
* Update temporary hack log message
Co-authored-by: Philippe Martin <contact@elol.fr>
* Make sure to handle process output line by line, for performance purposes
* Handle remote process output and errors in the Devfile command handler
The implementation in kubeexec.go should remain
as generic as possible
* Keep retrying remote process status until timeout, rather than just waiting for 1 sec
Now that the command is run via a goroutine,
there might be some situations where we were checking
the status just before the goroutine had a chance to start.
* Handle remote process output and errors in the Devfile command handler
The implementation in kubeexec.go should remain
as generic as possible
* Update kubeexec StopProcessForCommand implementation such that it relies on /proc to kill the parent children processes
* Ignore missing children file in getProcessChildren
* Unit-test methods in kubexec.go
* Fix missing logs when build command does not pass when running 'odo dev'
Also add integration test case
* Fix spinner status when commands passed to exec_handler do not pass
* Make sure to check process status right after stopping it
The process just stopped might take longer to exit (it might have caught
the signal and is performing additional cleanup)
* Keep retrying remote process status until timeout, rather than just waiting for 1 sec
Now that the command is run via a goroutine,
there might be some situations where we were checking
the status just before the goroutine had a chance to start.
* Fix potential deadlock when reading output from remotecmd#ExecuteCommandAndGetOutput
Rely on the same logic in ExecuteCommand
* Add more unit tests
* Remove block that used to check debug port from env info
As commented out in [1], we don't store anymore the debug port value in the ENV file.
[1] https://github.com/redhat-developer/odo/pull/5768#discussion_r893163382
* Rename 'getCommandFromFlag' into 'getCommandByName', as suggested in review
* Make remotecmd package more generic
This package no longer depends on Devfile-related packages.
* Fix comments in libdevfile.go
* Move errorIfTimeout struct field as parameter of RetryWithSchedule
This boolean is tied to the given retry schedule,
so it makes sense for it to be passed with the schedule.
* Expose a single ExecuteCommand function that returns both stdout and stderr
Co-authored-by: Philippe Martin <contact@elol.fr>
* Add odo logs
* Nolint for random number generation
* Changes based on Philippe's PR review
* Add logs for `odo logs`
* Add nolint at the right place to fix unit tests
* Changes based on PR feedback
* Name the key in unstructured.Unstructured
* Name containers with same names as c, c1, c2
* Remove unused struct field
* Modify documentation to follow general pattern
* Undo the changes done in earlier commits
* odo logs help message is accurate
* Update docs/website/versioned_docs/version-3.0.0/command-reference/logs.md
Co-authored-by: Parthvi Vala <pvala@redhat.com>
* Fixes broken link rendering
* Correct the example used in odo logs doc
* Make container name clearer in odo logs output
* Wrap at 120 chars, not 80
* Fixes to the document after rebase mistake
Co-authored-by: Parthvi Vala <pvala@redhat.com>