1783 Commits

Author SHA1 Message Date
Armel Soro
eeda644cc9 Add support for OpenShift Devfile components (#6548)
* 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>
2023-02-03 14:30:24 +01:00
Parthvi Vala
d1fa996a25 Log error when podman client cannot be initialized (#6538)
* Log error when podman client cannot be initialized

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Return error if platform is podman

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Refactor errors related to cluster/podman inaccessible

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Fix integration test

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* fix validation failure

* rm3l's review

* Attempt at fixing CI failures

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Log error when unable to find podman client in NewPodmanCli

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Update pkg/podman/podman.go

Co-authored-by: Armel Soro <armel@rm3l.org>

* Update pkg/podman/errors.go

Co-authored-by: Armel Soro <armel@rm3l.org>

* Fix integration test

Signed-off-by: Parthvi Vala <pvala@redhat.com>

---------

Signed-off-by: Parthvi Vala <pvala@redhat.com>
Co-authored-by: Armel Soro <armel@rm3l.org>
2023-02-03 09:47:58 +01:00
Philippe Martin
a94a5feaf7 Implement odo logs on podman (#6550)
* Implement odo logs for podman

* Test odo logs on podman

* Update pkg/podman/logs.go

Co-authored-by: Armel Soro <armel@rm3l.org>

---------

Co-authored-by: Armel Soro <armel@rm3l.org>
2023-01-31 12:38:33 -05:00
Philippe Martin
0bce606cfc Set platform and platformVersion in telemetry (#6540)
* Set platform and platformVersion in telemetry

* Vendor oc config client

* Get OC version

* Integration tests for odo dev

* Integration tests for odo deploy

* Update doc

* Apply suggestions from code review

Co-authored-by: Armel Soro <armel@rm3l.org>

* Add integration test on odo init

* Fix OC version when no complete version status

---------

Co-authored-by: Armel Soro <armel@rm3l.org>
2023-01-28 11:20:56 -05:00
Armel Soro
9a39462615 Show information about forwarded debug ports in odo describe component (#6537)
* Refactor 'libdevfile#GetContainerEndpointMapping' so it returns the whole Endpoint struct

It will help extract useful information like the port name and exposure.

* Fix typo in parameter name (in portForward#Client interface)

* Display the port names in the output of 'odo describe component'

* Display the port exposures in the output of 'odo describe component'

* Tell whether the port is a debug one or not in the output of 'odo describe component'

* Add integration tests meeting the expectations

* Update documentation
2023-01-27 12:02:57 -05:00
Eng Zer Jun
0f1d226431 test: use t.TempDir to create temporary test directory (#6533)
This commit replaces `ioutil.TempDir` with `t.TempDir` in tests. The
directory created by `t.TempDir` is automatically removed when the test
and all its subtests [complete.

Prior to this commit, temporary directory created using `ioutil.TempDir`
needs to be removed manually by calling `os.RemoveAll`, which is omitted
in some tests. The error handling boilerplate e.g.
	defer func() {
		if err := os.RemoveAll(dir); err != nil {
			t.Fatal(err)
		}
	}
is also tedious, but `t.TempDir` handles this for us nicely.

Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2023-01-25 07:02:46 -05:00
Parthvi Vala
e3e8b341ef Display error message when odo dev fails on podman and clean resources (#6522)
* Display error message when odo dev fails on podman and clean resources on error

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* show complete podman output on error

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Only set deployedPod if it exists

Signed-off-by: Parthvi Vala <pvala@redhat.com>

Signed-off-by: Parthvi Vala <pvala@redhat.com>
2023-01-24 07:40:48 -05:00
Parthvi Vala
5b4959272f Version bump to 3.6.0 (#6528)
Signed-off-by: Parthvi Vala <pvala@redhat.com>

Signed-off-by: Parthvi Vala <pvala@redhat.com>
2023-01-24 02:49:55 -05:00
Armel Soro
83d98c2a52 Implement odo delete component --running-in (#6485)
* 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
2023-01-23 17:50:22 -05:00
Parthvi Vala
19f8e0ebdb Update devfile/library to support pod-overrides and container-overrides attributes and add integration test for it (#6512)
* 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>
2023-01-23 15:21:18 -05:00
Philippe Martin
d2443d0fc0 Change port range used for port-forwarding endpoints to start at 20001 (#6519)
* Change port forward to start at 20001

* Update docs
2023-01-23 13:21:00 -05:00
Armel Soro
511792a62c Isolate Podman tests in namespaces (#6499)
* Rename SetProjectName into GetProjectName

Co-authored-by: Anand Singh <ansingh@redhat.com>
Co-authored-by: Parthvi Vala <pvala@redhat.com>
Co-authored-by: Philippe Martin <phmartin@redhat.com>

* Generate specific containers.conf file for each test spec using a dedicated engine namespace

Co-authored-by: Anand Singh <ansingh@redhat.com>
Co-authored-by: Parthvi Vala <pvala@redhat.com>
Co-authored-by: Philippe Martin <phmartin@redhat.com>

* Listen on random ports on Podman when '--random-ports' is used

This reduces the risks of port conflicts when running test specs in parallel.

Co-authored-by: Philippe Martin <phmartin@redhat.com>

* Exclude Gosec G404 (use of math/rand) rule

Co-authored-by: Philippe Martin <phmartin@redhat.com>

* Run Podman specs in parallel

* Output the Pod spec to be played by Podman depending on verbosity level

This will help debug potential issues.

* Use random name in 'using devfile that contains K8s resource to run it on podman' test

* Use random component name in sample java-quarkus project used in 'a hotReload capable project is used with odo dev' test

* Revert "Run Podman specs in parallel"

Parallelization works great on GitHub Actions, but I experimented a lot
of issues when running locally with a lot (~11) of parallel test nodes.
Not sure why exactly, but some containers created by Podman had a lot of
networking issues.
We can look into parallelizing the runs later in a subsequent PR.

This reverts commit 64d5d31248a62f355a32ca245ba399a723fdb22f.

* Allow overridding the number of parallel nodes for Podman integration tests

This way, we could be able to run them in parallel on GitHub
but sequentially (default) locally.
This will still benefit us by reducing the time it takes to run such tests on GitHub.

Meanwhile, we can look into the issues we have locally with parallelization.

Note that it is still possible to run them locally in parallel via
the PODMAN_EXEC_NODE env var.

Co-authored-by: Anand Singh <ansingh@redhat.com>
Co-authored-by: Parthvi Vala <pvala@redhat.com>
Co-authored-by: Philippe Martin <phmartin@redhat.com>
2023-01-23 09:25:57 -05:00
Philippe Martin
f089cba02a Set experimental mode in telemetry (#6520)
* Set experimental mode in telemetry

* Add integration tests
2023-01-23 06:47:43 -05:00
Parthvi Vala
aa8a3c7c79 Fix: odo dev unable to sync files with name containing special characters (#6507)
* Fix: odo dev unable to sync files with name containing special characters

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Cover in unit tests and refactor them

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Add test for globEscape

Signed-off-by: Parthvi Vala <pvala@redhat.com>

Signed-off-by: Parthvi Vala <pvala@redhat.com>
2023-01-20 14:05:42 -05:00
Philippe Martin
ae82d18928 Make doc tests pass (#6516)
* Fix docs

* Display env vars in a sorted order

* Run on quickstart-demo
2023-01-20 09:53:51 -05:00
Parthvi Vala
992c48a7d1 odo describe component: display remote source code location for each container component (#6497)
* Describe remote source code location for container component

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Add integration test

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Fix cI failures

* Add extra check for .mountSources and add more integration tests

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Use GetMountSources() instead of property

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Use random name in integration test

Signed-off-by: Parthvi Vala <pvala@redhat.com>

Signed-off-by: Parthvi Vala <pvala@redhat.com>
2023-01-19 17:00:39 -05:00
Philippe Martin
6d9bb37acb hotReloadCapable recognized on podman (#6509)
* Fix

* Add integration tests
2023-01-19 11:24:42 -05:00
Armel Soro
d468842a32 Port-forward Debug endpoints only when running odo dev with --debug (#6505)
* Add integration tests meeting the expectations

* Refactor 'libdevfile.GetContainerEndpointMapping' such that it returns debug endpoints only if told so

* [Kubernetes] Port-forward Debug endpoints only if running in Debug mode

* [Podman] Port-forward Debug endpoints only if running in Debug mode

* Use '--inspect' instead of '--inspect-brk' to run the "debug" script in Node.JS sample projects

'--inspect-brk' stops the execution at the start of the command
(waiting for a debugger to attach to it) while '--inspect' does not.
We need the application to be started regardless of whether a debugger
is attached or not, as we are testing that we can communicate with
the forwarded ports.

* Temporarily skip the test step on Podman that connects to the forwarded debug port until [1] is fixed

We can work on fixing the issue on Podman in a separate PR.

[1] https://github.com/redhat-developer/odo/issues/6510
2023-01-19 06:21:55 -05:00
Parthvi Vala
8dbf42e5e1 Fix typo with file_indexer.go (#6502)
Signed-off-by: Parthvi Vala <pvala@redhat.com>

Signed-off-by: Parthvi Vala <pvala@redhat.com>
2023-01-18 04:32:09 -05:00
Parthvi Vala
53a2a23b3a Ignore and show warning when handling Kubernetes components on Podman (#6471)
* Ignore and show warning when handling Kubernetes components on Podman

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Only use comp names

* Add integration test

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* return early when there are no k8s resources to be created; get resources referenced by apply command and add test for it

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Warn about k8s resources that match the given CommandGroupKind

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Only warn about k8s resources for a given command and groupkind

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Amend the test case

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Add warning about image components referenced by an apply command and attempt at fixing CI failures

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Add warning inside ApplyImage and ApplyKubernetes methods

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Update pkg/dev/podmandev/reconcile.go

Co-authored-by: Armel Soro <armel@rm3l.org>

Signed-off-by: Parthvi Vala <pvala@redhat.com>
Co-authored-by: Armel Soro <armel@rm3l.org>
2023-01-17 23:28:35 -05:00
Philippe Martin
38273df019 Fix adding .odo to .gitignore file (#6495) 2023-01-17 11:47:16 -05:00
Philippe Martin
682e5176d2 [podman] show logs when command fails (#6481)
* Implement GetRunningPodFromSelector for podman

* Implement GetPodLogs for podman

* Same message in podman/cluster

* Integration tests

* Return stream of stdout/err
2023-01-16 10:52:07 -05:00
Armel Soro
da9a9efb8f Display a warning that "odo dev" on Podman needs to be restarted if the Devfile is changed (#6477)
* Display a warning that "odo dev" on Podman might need to be restarted when local changes are detected

The initial idea was to display such a warning only
when changes are detected in the Devfile,
which are not yet handled completely at this time.
But to take into account the manual synchronization case (where
there is no file watcher (and therefore no way to determine which
files have actually been modified)), a generic warning is being
displayed whenever the Podman-specific watch handler is called.

* Add integration test case

* fixup! Add integration test case

* amend! Display a warning that "odo dev" on Podman might need to be restarted when local changes are detected

Display a warning that "odo dev" on Podman might need to be restarted when the Devfile is modified

* fixup! Add integration test case

* Assert that no warning is displayed if the Devfile has not changed
2023-01-10 15:42:52 -05:00
Philippe Martin
06b95fc0bd Change wording for dev/deploy (#6408)
* Change wording for dev/deploy

* Update doc

* Fix help tests

* Update deploy help message
2023-01-09 14:34:05 -05:00
Philippe Martin
020009b33c Compatibility with podman v3 (#6474)
* Use podman generate kube instead podman kube generate

* get env from exec -it env (to be continued)

* Fix podman test

* Export function to make validate tests pass

* review

* Check podman tests result

Co-authored-by: Parthvi Vala <pvala@redhat.com>
2023-01-09 08:32:31 -05:00
Philippe Martin
32ef20d894 Get binding information without cluster connection (#6432)
* Do not use restmapper to map resource->kind for application. Juct copy Kind and Resource to json output

* Fix panic when no kubeclient

* Fix panic when odo list binding with --name

* Fix integration tests with new output
2023-01-09 05:49:42 -05:00
Philippe Martin
d982a751d6 Make odo dev work if no endpoint is defined (#6472)
* odo dev works if no endpoint is defined

* Update tests/integration/cmd_dev_test.go

Co-authored-by: Armel Soro <armel@rm3l.org>

* Add log when no port to forward

Co-authored-by: Armel Soro <armel@rm3l.org>
2023-01-06 15:14:22 -05:00
Philippe Martin
2beda42c01 Do not output log to stdout (#6473) 2023-01-06 08:50:23 -05:00
Philippe Martin
b98c4e2f5c Bump to v3.5.0 (#6450) 2023-01-04 05:29:37 -05:00
Parthvi Vala
520a31e9ba Fix typo in odo remove binding (#6449)
* Fix typo in odo remove binding

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Use add instead of create

Signed-off-by: Parthvi Vala <pvala@redhat.com>

Signed-off-by: Parthvi Vala <pvala@redhat.com>
2023-01-03 16:54:57 -05:00
Philippe Martin
ce8fdc1d5b Rename generic run-on flag into platform (#6445)
* 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
2023-01-03 13:51:51 -05:00
Armel Soro
6ed95b7e6f Make odo describe component show information about components running on Podman (#6431)
* 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
2023-01-02 14:12:58 -05:00
Philippe Martin
451d8106da odo delete component on podman with --name (#6437)
* 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
2023-01-02 05:44:42 -05:00
Philippe Martin
4617cfdfff odo delete component deletes components running on podman (#6418)
* 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
2022-12-22 10:57:35 -05:00
Parthvi Vala
0d392ef5bd Allow fetching specific devfile stack version (#6429)
* Ask for stack version in the interactive mode; downloading still doesn't work as expected

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Download the versioned Devfile for interactive mode

* Download the versioned Devfile for flag mode

* Download the versioned Devfile for the alizer mode

* Add support for 'latest' stack

* Update init automation message with devfile-version

* Mark the default version in interactive mode

* Fix interactive tests

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Add integration tests for odo init flag mode

* Fix unit and validation tests

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Add to the documentation

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Add information about the default version

Signed-off-by: Parthvi Vala <pvala@redhat.com>
2022-12-21 09:14:40 -05:00
Armel Soro
46abd92226 Display a generic Experimental mode warning message when this mode is enabled (#6426)
* Display a generic Experimental mode warning message when this mode is enabled

This fixes the issue of having this warning displayed for a specific feature
that might not be used by the user.
Instead, we are now displaying a more generic and feature-agnostic warning
message once.

* Drop useless 'id' field in OdoFeature struct
2022-12-20 07:37:13 -05:00
Philippe Martin
1807939c7b Fix preference not taken into account for odo version (#6415)
* Quick fix

* Test grouping of comands in odo help

* Create a CommandGroup abstraction

* Expect a non-nil Preference Client

Co-authored-by: Armel Soro <armel@rm3l.org>

Co-authored-by: Armel Soro <armel@rm3l.org>
2022-12-15 09:40:08 -05:00
Philippe Martin
6ed12871f9 Enable use of ImageStreams on OpenShift (#6406)
* Enable use of ImageStreams on OpenShift

* Add annotation in examples
2022-12-15 07:11:05 -05:00
Armel Soro
af911dd576 Fallback to interactive mode if there is no match from Alizer when initializing a component (#6410)
* Add integration tests highlighting the issue and setting the expectations

* Fallback to interactive questions if there is no match from Alizer when initializing a component

This applies to odo init, odo dev and odo deploy
2022-12-15 02:43:04 -05:00
Armel Soro
3cf729c346 Bump version to v3.4.0 (#6404) 2022-12-13 10:07:51 -05:00
Armel Soro
9f866985c0 Show Devfile Stack versions in "odo registry" output (#6397)
* Make the registry client collect and return all stack versions

* Call the '/v2index' endpoint first and fallback to the index endpoint when listing Stack versions

* Display the Stack versions in the 'odo registry' human-readable output

* For convenience, sort stack versions based on the semantic version

This allows seeing them in a meaningful order in both
human-readable and JSON outputs.

* Enrich unit tests for 'getRegistryStacks'

* Fill the "starterProjects" field for backward compatibility

Similar to the "version" field, this represents
the list of starter projects of the default Stack version.

* Update integration tests

* Update documentation
2022-12-09 11:50:38 -05:00
Philippe Martin
60732d871b Display a warning when connection to cluster fails (#6384)
* Display a warning when connection to cluster fails

* Fix json output

* Move tests with previous LabelNoCluster

* Add test for unauth
2022-12-09 09:23:47 -05:00
Philippe Martin
6c99ca1024 Get next free port when forwarding ports on podman (#6377)
* Refacto get first free port

* Use next free port for Podman

* Save used ports to reuse them

* Fix unit tests

* Do not rely on system for ports during tests
2022-12-09 06:41:29 -05:00
Philippe Martin
ac19ece039 Pass caller to registry telemetry (#6382)
* Pass caller to registry telemetry

* Add unit test
2022-12-08 14:07:56 -05:00
Armel Soro
9815b60e78 Improve confirmation message for namespace/project deletion (#6383)
* Improve confirmation message for namespace/project deletion

* Update sample output in ´delete namespace/project' command reference

* Use oc binary instead of odo in DeleteNamespaceProject 'helper_oc' implementation

This way, we do not rely on some other odo command (odo delete project command) in unrelated tests

This also makes it more consistent with the implementation in 'helper_kubectl'
2022-12-07 12:10:47 -05:00
Parthvi Vala
a39931388e Add support for parsing multiple k8s definition in a single Devfile K8s component (#6372)
* 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>
2022-12-07 03:24:02 -05:00
Philippe Martin
0c008c6be9 odo list component shows components running on podman (#6366)
* 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
2022-12-06 11:01:56 -05:00
Philippe Martin
623a145e76 Delay the display of warnings related to experimental features (#6375) 2022-12-06 10:07:39 -05:00
Armel Soro
3c87ecdc8f Support Alizer-based automatic port detection with odo init interactive mode (#6365)
* Do not display "Port configuration using flag is currently not supported"

This is confusing to users.

* Display ports detected as part of the Alizer component detection logic

This is because we specifically need to display the ports
at the same moment when the language, project type and Devfile
are displayed to the end user (when source code is present)

* Update the loaded Devfile object with the application ports detected prior to asking for its customization

The case of multi-container components will be handled in [1].
Otherwise, the container component ports (all but the Debug ports) are replaced with the right application ports.

[1] https://github.com/redhat-developer/odo/issues/6264

* Add integration test case

* Add application ports detected to "odo analyze -o json" output

* Update documentation

* Add utility functions for helping handle Debug endpoints

* Make application ports detected appear first in the endpoint list

This allows such ports to be port-forwarded first, before the Debug ones.
2022-12-06 02:50:07 -05:00
Tomas Kral
6883fb9de1 Update to latest Alizer (#6378)
* update to latest Alizer version

* run scripts/mockgen.sh

* go mod tidy; go mod vendor

* add wwhrd exceptions for MIT
2022-12-05 12:21:42 -05:00