Commit Graph

1778 Commits

Author SHA1 Message Date
Philippe Martin
3fc9f97063 Do not call LogErrorAndExit but return err in GenericRun (#6352)
* Do not call LogErrorAndExit but return err in GenericRun

* Review
2022-11-30 07:29:31 -05:00
Philippe Martin
c4c29a1f33 Fix completion error when command is empty (#6354) 2022-11-30 01:33:33 -05:00
Anand Kumar Singh
c9875200ed Downloading wrong starter project when using odo init (#6346)
* fix: downloading wrong starter project when using odo init in interactive mode

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* test: odo init downloads correct devfile-starter

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

Signed-off-by: anandrkskd <anandrkskd@gmail.com>
2022-11-24 10:32:17 -05:00
Armel Soro
5660093167 Use go-cmp instead of reflect.DeepEqual to compare unit test results (#6343) 2022-11-24 07:24:32 -05:00
Armel Soro
1bfb116b74 Fix potential unit tests failures caused by envconfig relying on the system environment (#6344)
* Fix potential unit tests failures caused by envconfig relying on the system env by default

See https://github.com/sethvargo/go-envconfig#testing for more details.

* Document functions in the 'config' package
2022-11-24 07:01:58 -05:00
Philippe Martin
872d7ae9ea odo dev on podman: Add support for devfile volume (#6328)
* Add support for devfile volume

* Add unit test

* Use same naming strategy as for cluster

* Apply suggestions from code review

Co-authored-by: Parthvi Vala <pvala@redhat.com>

Co-authored-by: Parthvi Vala <pvala@redhat.com>
2022-11-23 09:39:34 -05:00
Philippe Martin
b4b8a0c330 Set labels for component on podman (#6329) 2022-11-23 07:18:55 -05:00
Parthvi Vala
1d315866b6 Bump odo version to v3.3.0 (#6325) 2022-11-22 03:13:57 -05:00
Armel Soro
d921a17821 Implement odo delete component --files to delete files generated by odo (#6255)
* Add utility functions allowing to report files generated by odo

The end goal is for 'odo delete component --files' to gather a list of
files that were initially generated by odo, so as to delete only those.
This way, we are less likely to delete the wrong files.

This list is collected in a '.odo/generated' file.

It will then be up to odo commands to call those methods
accordingly. For example, this is called:
- by odo init, odo dev, or odo deploy, when generating a new devfile.yaml
- by odo dev, when there is no .gitignore file and odo generated one

Note that it is quite impossible to cover all scenarios; for example,
if odo generates a new devfile.yaml file, but the user deletes it
manually and recreates it, 'odo delete component --files'
will still list it as a possible candidate for deletion
(because it would be listed in .odo/generated).

* Report files generated by commands like init, dev or deploy

* Implement 'odo delete component --files'

* Add integration tests for 'odo delete component --files'

* Document the `--files` flag

Co-authored-by: Philippe Martin <contact@elol.fr>

* Do not delete the .gitignore file

It is more likely to be modified by the user afterward (for another
usage).

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

* fixup! Document the `--files` flag

* fixup! Implement 'odo delete component --files'

* Apply review suggestions on integration tests

Co-authored-by: Parthvi Vala <pvala@redhat.com>

* fixup! fixup! Document the `--files` flag

Co-authored-by: Philippe Martin <contact@elol.fr>
Co-authored-by: Philippe Martin <phmartin@redhat.com>
Co-authored-by: Parthvi Vala <pvala@redhat.com>
2022-11-22 00:47:01 -05:00
dependabot[bot]
b581f9d91a Go: Bump github.com/mattn/go-colorable from 0.1.9 to 0.1.13 (#6321)
* Go: Bump github.com/mattn/go-colorable from 0.1.9 to 0.1.13

Bumps [github.com/mattn/go-colorable](https://github.com/mattn/go-colorable) from 0.1.9 to 0.1.13.
- [Release notes](https://github.com/mattn/go-colorable/releases)
- [Commits](https://github.com/mattn/go-colorable/compare/v0.1.9...v0.1.13)

---
updated-dependencies:
- dependency-name: github.com/mattn/go-colorable
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Compare slices regardless of order in 'TestGetKubernetesComponentsToPush'

'GetKubernetesComponentsToPush' internally iterates over a map to return
the resulting slice, but the iteration order of a Map in Go is not guaranteed.

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Armel Soro <asoro@redhat.com>
2022-11-21 13:40:46 -05:00
Philippe Martin
4c30c8ef0c More tests without cluster (#6303)
* 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
2022-11-21 11:06:04 -05:00
Philippe Martin
20ea3a2043 Podman dev (#6183)
* Add runOn flag

* Instantiate Kube/Podman DevClient instance according to runOn flag

* Start and stop Podman Pod

* Unit tests for createPodFromComponent

* podman mode runs without Kube config

* Fix tests + rebase

* Add sync and exec clients to podman dev

* tbc: call sync

* Remove unnecessary kclient dependency from exec client

* Inject podman client

* Implement ExecCMDInContainer for podman client

* Move [gG]etFirstContainerWithSourceVolume to dev/common package and use it for Podman

* TBC: execute build/run commands

* Fix rebase

* Fix unit test

* Comments for refacto

* Prepare implementation of Platform

* Use ExecuteRunCommand for run handler

* Do not pass parameters present in context

* Move back instanciation of devclient to clientset package

* Move CleanupDevResources method from Watch to Dev package

* CleanupResources: Do not pass parameters present in context

* Fix deleting volumes at exit time

* Check volumes do not exist

* Add support for postStart event

* Make odo dev work when no cluster is configured

* Review

* Add more TODOs

* User interface

* More info on ExitError errors

* Display forwarded ports in output and devstate file

* Add tests for forwarded ports

* Create .odo when necessary

* Add keyboard commands message

* Add doc on podman platform
2022-11-21 08:56:44 -05:00
Dharmit Shah
d1d7ccebbf Remove Dharmit from OWNERS files across the repo (#6320)
* Remove Dharmit from OWNERS files across the repo

Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>

* Remove Dharmit and Charlie from OWNERS

* Adds Tomas to owners

Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>
2022-11-21 06:57:14 -05:00
Parthvi Vala
4c1982a6a5 odo dev deletes remote resources not present in the Devfile (#6189)
* Add integration test

* odo dev deletes remote resources not present in the Devfile

* Delete the servicebinding secret without SBO

* Fix integration tests failure for when SBO is installed

* code Refactor

* Refactor the code

* Fix components_test.go

* add todos to integration tests

* Code review from feloy

* Move secret removal out of UnbindWithLibrary; rename deleteServiceBindingSecrets; add spinner end defer

* Attempt at making resource deletion concurrent

* Temp changes

* temp change

* Use errgroup wg to handle go routines

* Use single spinner for all the resources

* Fix validation failures

* Temp changes

* Optimize the code

* Optimize error messages; remove the unnecessary use of 'Kubernetes'
2022-11-18 15:24:51 -05:00
Parthvi Vala
ec503536b7 List Routes/Ingresses created by odo deploy in odo describe component (#6244)
* 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>
2022-11-18 16:22:06 +00:00
Dharmit Shah
cc4c661a3c Adds ability to list namespaces in JSON format (#6295)
* Adds ability to list namespaces in JSON format

Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>

* Tests without Expect

Using `Expect` directly or through something that uses it under the hood
is a problem when using `Eventually`. In normal case, a failure in
matching test condition behaves like `continue` and `Evnetually` keeps
trying again till timeout is reached. But `Expect` changes that
behaviour to be like `break` and doesn't keep testing repeatedly as we
would like it to.

Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>

* UI fixes when there's no project on cluster

Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>

* Adds an import to fix unit tests

Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>

* More JSON specific checks

Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>

* Consistent JSON output for namespaces

JSON output for components, bindings and services when odo can't find
any of these resources is simply a `{}`. This commit makes output of
`odo list namespaces -o json` consistent with that of these commands.

Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>

* Add doc for namespaces JSON output

Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>

* Test if some other namespace is marked as active: false

Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>

Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>
2022-11-17 20:51:38 +00:00
Philippe Martin
712254ae66 Centralize environment configuration (#6293)
* Define central config

* Use envConfig in GenericRun for segment parameters

* Pass the env config into the context passed to CLI methods

* Use PodmanCmd and DockerCmd from context

* Remove tests now that ODO_DISABLE_TELEMETRY is checked for a bool value

* deploy.Deploy: Use values from ctx instead of parameters + use FS from DI

* dev.Start: Use values from ctx instead of parameters

* image.Build*: Use values from ctx instead of parameters

* Use telemetry file from context

* Pass ctx to segment.getTelemetryForDevfileRegistry

* Use ctx in getTelemetryForDevfileRegistry

* Call IsTelemetryEnabled once and use scontext.GetTelemetryStatus after

* Fix unit tests

* Use envConfig in segment.IsTelemetryEnabled

* Define TelemetryCaller constant in test helper

* IsTrackingConsentEnabled: get value from envconfig instead of env

* Use ctx instead of GLOBALODOCONFIG

* Place ODO_EXPERIMENTAL_MODE in configuration

* Use maintained envconfig package

* Define default values when exist

* Document accepted boolean values
2022-11-17 17:57:34 +00:00
Anand Kumar Singh
9a2aa229ce fix to prioritize newly added registry (#6289)
* fix to prioritize newly added registry

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* update RegistryList func to reverse the list and return []Registry

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* update the usage of RegistryList

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* update unit test and mock

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* fix: lint error and check for empty registry list

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* add documentation

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

Signed-off-by: anandrkskd <anandrkskd@gmail.com>
2022-11-16 17:31:52 +00:00
Philippe Martin
67272fd81d Remove localconfigLocalConfigProvider abstraction (#6285)
* Remove localconfigLocalConfigProvider abstraction

* Remove LocalConfigProvider interface

* Move LocalStorage to pkg/storage (with ListStorage)
2022-11-16 12:33:29 +00:00
Armel Soro
0b7de6631e Sanitize value for 'app.openshift.io/runtime' label (#6284)
* Add test cases highlighting the issue

* Sanitize value for 'app.openshift.io/runtime' label

* Lowercase value of 'app.openshift.io/runtime' label after sanitization

As suggested in review, this is to follow what's done by OpenShift console;
it is always lowercase when added by OpenShift Console.

Co-authored-by: Tomas Kral <tkral@redhat.com>

Co-authored-by: Tomas Kral <tkral@redhat.com>
2022-11-14 18:04:47 +00:00
Armel Soro
a811cc1bd0 Add support for an experimental mode (#6300)
* Add support for an experimental mode at the CLI level

This is backed by an "ODO_EXPERIMENTAL_MODE" environment variable.

* Mark the generic '--run-on' flag as experimental

Besides being hidden, it will error out as invalid flag
if the ODO_EXPERIMENTAL_MODE env var is not set to 'true'.

* Add integration test cases

* Document the experimental mode.

* fixup! Add support for an experimental mode at the CLI level

* fixup! Mark the generic '--run-on' flag as experimental
2022-11-14 12:11:50 +00:00
Tomas Kral
fd8ab0cb2f If command has only one command assume that it is default (#6281)
* if single command in group use it as default

* add and update tests for single command as default

* move condition to a better place
2022-11-10 17:47:08 +00:00
Dharmit Shah
f062c11a11 Update odo to use go 1.18 (#6166)
* Update odo to use go 1.18

Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>

* Update golangci-lint version in Makefile

Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>

* Use go 1.18, not go 1.19

Erroneously I had used go 1.19 at various places.

Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>

* Rearrange imports; fix golangci-lint errors

Fixed a bunch of golangci-lint errors like below:

`File is not `gofmt`-ed with `-s``

using the command: `golangci-lint run --fix`

Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>

* Use go install instead of go get

This is because with go 1.18, `go get` behaves as `go get -d` by
default. Which means that it will only download, but not install.

Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>

Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>
2022-11-09 05:31:38 -05:00
Philippe Martin
4c7ab35b76 Disable loading a single branch when getting git starter project (#6290)
* Disable loading a single branch when getting git starter project and reference is not defined

* Add integration test
2022-11-07 09:23:52 -05:00
Anand Kumar Singh
99f4a0dbc6 resolve inconsistent order of registries in preference view (#6266)
* resolve inconsistent order of registries in preference view

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* reverse regList on business layer

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* update unit test, add functional test and small refactor

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* update functional tests to use proxy

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

Signed-off-by: anandrkskd <anandrkskd@gmail.com>
2022-11-03 17:58:10 -04:00
Anand Kumar Singh
26c1d9be4a display equivalent odo init command for odo init interactive (#6265)
* display equivalent odo init command for odo init interactive

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* update the documentation to add the new returned values

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* update mock and functional tests

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

Signed-off-by: anandrkskd <anandrkskd@gmail.com>
2022-11-03 15:38:09 -04:00
Philippe Martin
e6fd6862ac Make functions for executing run command reusable (#6277) 2022-11-02 17:04:31 -04:00
Armel Soro
918a4e97fb Make 'pkg/logs' platform-agnostic (#6251)
* 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>
2022-11-01 10:59:17 -04:00
Philippe Martin
233c817c50 Bump odo to v3.2.0 (#6276) 2022-10-31 12:22:20 -04:00
Armel Soro
719fe99c21 Allow controlling telemetry via the ODO_TRACKING_CONSENT environment variable (#6258)
* Add support for ODO_TRACKING_CONSENT env variable

Co-authored-by: Armel Soro <asoro@redhat.com>

* Replace deprecated 'ODO_DISABLE_TELEMETRY' env var with 'ODO_TRACKING_CONSENT' in integration tests

* Log environment of process launched with 'helper_run' in integration tests

`odo` behavior might be altered based on certain environment variables.
So this is to help debug future issues that might happen.

Because the process environment also contains the
current OS environment, we purposely limit the content
to variables prefixed with 'ODO_' or particular ones
(like 'TELEMETRY_CALLER').

* Test conflicting situations when using both 'ODO_DISABLE_TELEMETRY' and 'ODO_TRACKING_CONSENT'

* Disable golangci-lint 'staticcheck' check about using the deprecated 'segment.DisableTelemetryEnv'

However, due to [1], line-based directives do not seem to be working.

* Make ODO_TRACKING_CONSENT env var take precedence over the ConsentTelemetry preference

See [1] for more context.

[1] https://github.com/redhat-developer/odo/pull/6258\#issuecomment-1293736398

* Add new 'segment#isTrackingConsentEnabled' function, as suggested in review

This would make it easier to rename the values if needed or add aliases later.

* Add more unit test cases, especially when any of the telemetry var is not there in the env

* Document ODO_TRACKING_CONSENT

* fixup! Add new 'segment#isTrackingConsentEnabled' function, as suggested in review

* fixup! fixup! Add new 'segment#isTrackingConsentEnabled' function, as suggested in review

Co-authored-by: Tomas Kral <tkral@redhat.com>
2022-10-31 09:57:35 -04:00
Philippe Martin
87fc43b58f Set empty component name in context if no devfile exists in the current directory (#6268)
* Set empty component name in context if no devfile exists in the current directory

* Add integration tests
2022-10-31 05:16:48 -04:00
Armel Soro
5db8c5eb85 Fix potential issue preventing application process from being restarted correctly (#6260)
For some reason, this happened with NodeJS starter projects for example,
where killing the parent pid for the application ('npm start')
would not stop the underlying 'node' process, causing the application
port to still being used.

Given the following process tree for the Node.JS application:
```
default       49  0.0  0.0  11924  2828 ?        Ss   20:23   0:00 /bin/sh -c echo $$ > /opt/odo/.odo_cmd_run.pid && cd ${PROJECT_SOURCE} &&  (npm start) 1>>/proc/1/fd/1 2>>/proc/1/fd/2; echo $? >> /opt/odo/.odo_cmd_run.pid
default       55  1.0  0.0 735940 62956 ?        Sl   20:23   0:00  \_npm start
default       66  0.0  0.0  11928  2760 ?        S    20:23   0:00    \_ sh /tmp/start-c40b5918.sh
default       67  0.5  0.0 624368 49772 ?        Sl   20:23   0:00      \_ node server.js
```
We were previously just killing the direct process (pid 55 here),
and it used to also stop all its descendents. This appears to no longer
be the case.

So to make sure the application is stopped correctly,
we are now making sure to traverse the full parent-child tree
using a post-order strategy, to start killing children processes first.
So in the example above, we would start killing pids 67, 66 and 55 in
this order.
2022-10-28 23:55:30 -04:00
Philippe Martin
014021d73a Make exec package agnostic of platform (#6217)
* Make exec pkg agnostic of platform

* Move ExtractProjectToComponent to sync package

* Parthvi's review
2022-10-21 04:50:25 -04:00
Philippe Martin
a2345c35c3 Build context as part of GenericRun (#6202)
* 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
2022-10-19 05:38:18 -04:00
Dharmit Shah
d02770fa30 Bump odo to v3.1.0 (#6231)
Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>

Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>
2022-10-18 04:10:11 -04:00
Armel Soro
1c9d6b36a8 Allow passing caller to telemetry (#6223)
* Add integration test cases highlighting the acceptance criteria

* Set the caller property for telemetry based on the 'TELEMETRY_CALLER' env var

Note that this property is set in telemetry even if it is not in the set
of allowed values, but does not prevent the odo command from running.

* Update documentation
2022-10-17 06:33:12 -04:00
Armel Soro
f26010864b Merge tag v3.0.0 2022-10-13 10:53:55 +02:00
Philippe Martin
e03b1e0a12 Move --var-file and --var as generic flags (#6201)
* Define --var-file and --var global flags

* Fix sync mock

* Fix comments

* odo deploy: Use variables from context

* Change FlagValuesIfSet with FlagValues
2022-10-10 13:54:37 +02:00
Philippe Martin
1b552e0fbf Support a generic --run-on flag (#6187)
* Centralize code about o flag into commonflags pkg

* Add generic --run-on flag

* Pass ctx to Complete and Validate

* Pass value of -o in ctx

* Pass value of --run-on in ctx

* Add unit tests

* Fix functions names
2022-10-06 16:38:24 +02:00
Armel Soro
8694f19469 Bump version to v3.0.0 (#6197) 2022-10-05 11:06:56 +02:00
Armel Soro
3281c997c4 Fix help and doc for odo completion zsh (#6167) 2022-10-03 23:10:11 +02:00
Tomas Kral
86334d1cc7 telemetry: start tracking flags usage (#6168)
* telementry: start tracking flags usage

* remove forgotten debut print, add test case

* ignore errcheck in tests

* update tests to test telemetry flags
2022-10-03 18:55:47 +02:00
Philippe Martin
f78096d264 Refactor remotecmd (#6169)
* Remove kclient from interface / signatures

* Create Exec package

* Call ExecuteCommand with client

* Call ExecuteCommand with client from sync package

* Fix order of dependencies
2022-09-27 09:38:54 +02:00
Philippe Martin
2c0b2ee2a6 Refacto sync pkg (#6163)
* Rename interface to SyncExtracter

* Inline PushParameters fields into SyncParameters

* Move SyncParameters to sync package

* Move ComponentName as parameter to SyncFiles

* Move SyncAdapter as handler

* Build syncclient with dependency injection system

* Move ForcePush logic outside of sync package + remove unused ForceBuild option
2022-09-23 16:30:55 +02:00
Charlie Drage
dbf594054c Add extra output when init project using odo dev or deploy (#6127)
* Add extra output when init project using odo dev

<!--
Thank you for opening a PR! Here are some things you need to know before submitting:

1. Please read our developer guideline: https://github.com/redhat-developer/odo/wiki/Dev:-odo-Dev-Guidelines
2. Label this PR accordingly with the '/kind' line
3. Ensure you have written and ran the appropriate tests: https://github.com/redhat-developer/odo/wiki/Dev:-Writing-and-running-tests
4. Read how we approve and LGTM each PR: https://github.com/redhat-developer/odo/wiki/Pull-Requests:-Review-guideline

Documentation:

If you are pushing a change to documentation, please read: https://github.com/redhat-developer/odo/wiki/Documentation:-Contributing
-->

**What type of PR is this:**

<!--
Add one of the following kinds:
/kind bug
/kind feature
/kind tests
/kind documentation

Feel free to use other [labels](https://github.com/redhat-developer/odo/labels) as needed. However one of the above labels must be present or the PR will not be reviewed. This instruction is for reviewers as well.
-->
/kind cleanup

**What does this PR do / why we need it:**

Updates the messaging when you run `odo dev` and there is no
`devfile.yaml` available. Outputs more information that makes it similar
to running `odo dev` or `odo init`

**Which issue(s) this PR fixes:**
<!--
Specifying the issue will automatically close it when this PR is merged
-->

Fixes https://github.com/redhat-developer/odo/issues/5679

Signed-off-by: Charlie Drage <charlie@charliedrage.com>

* Update based on review

* fix tests

* update based on review

Signed-off-by: Charlie Drage <charlie@charliedrage.com>

Signed-off-by: Charlie Drage <charlie@charliedrage.com>
2022-09-23 15:23:32 +02:00
Parthvi Vala
486060701c Fix message for interactive odo delete project (#6154)
Signed-off-by: Parthvi Vala <pvala@redhat.com>

Signed-off-by: Parthvi Vala <pvala@redhat.com>
2022-09-22 20:11:56 +02:00
Philippe Martin
aaf64c5899 Refacto odo dev (#6141)
* Move Dev Handler to specific file

* Do not pass unnecessary namespace to Dev package

* Pass FS with dependency injection

* Merge Dev.Start and Dev.Watch

* Simplify Handler

* Move Dev Handler inside the Dev package

* Update mock

* Review
2022-09-22 19:08:39 +02:00
Philippe Martin
6dcc11af3a Fix panic when component name is long but not app (#6136)
* Fix panic when component name is long but not app

* Fix comment

* No more magic numbers
2022-09-21 15:46:19 +02:00
Dharmit Shah
39a9a28747 Bump odo to v3.0.0-rc2 (#6137)
Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>

Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>
2022-09-20 16:20:57 +02:00
Philippe Martin
1d78b85093 Try to reload config when disconnected from the cluster (#6130)
* Try to reload config when disconnected from the cluster

* Fix integration test

* Message also when isForbidden
2022-09-20 08:55:40 +02:00