Commit Graph

1779 Commits

Author SHA1 Message Date
Daniele Rossi
b5bad42f91 fix: manage podman inspect result as a list also (#7269)
* fix: manage podman inspect result as a list also

* fix: variable shadowing

* Update pkg/podman/inspect.go

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

---------

Co-authored-by: Armel Soro <asoro@redhat.com>
2024-10-12 14:18:56 +02:00
Armel Soro
ffcf90b395 Fix issues with check-ui-static-files CI by regenerating dev UI static files 2024-09-02 18:24:32 +02:00
Armel Soro
cd346c5e6c Bump version to 3.16.1
This is to try a workaround for an internal build issue
2024-06-18 08:53:18 +02:00
Armel Soro
167aec1892 Bump version to 3.16.0 (#7247) 2024-06-17 09:46:46 +00:00
Armel Soro
cf2e64a827 Fix potential panic when following logs, due to a nil pod watcher interface returned by K8s client-go
Fixes https://github.com/redhat-developer/odo/issues/7140
2024-06-17 10:18:00 +02:00
Armel Soro
1c0b7e62ef Commit dev UI changes 2024-02-09 23:52:09 +01:00
dependabot[bot]
74f295d6ba Go: Bump github.com/sethvargo/go-envconfig from 0.9.0 to 1.0.0 (#7190)
* Go: Bump github.com/sethvargo/go-envconfig from 0.9.0 to 1.0.0

Bumps [github.com/sethvargo/go-envconfig](https://github.com/sethvargo/go-envconfig) from 0.9.0 to 1.0.0.
- [Release notes](https://github.com/sethvargo/go-envconfig/releases)
- [Commits](https://github.com/sethvargo/go-envconfig/compare/v0.9.0...v1.0.0)

---
updated-dependencies:
- dependency-name: github.com/sethvargo/go-envconfig
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

* Fix breaking change

---------

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>
2024-01-30 08:33:43 +00:00
Eng Zer Jun
943490b821 Replace github.com/pborman/uuid with github.com/google/uuid (#7173)
* Replace `github.com/pborman/uuid` with `github.com/google/uuid`

`github.com/pborman/uuid` is no longer being actively maintained (last
release was 2019). So we should just use the newer
`github.com/google/uuid`.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>

* fix: handle error and convert to string properly

Reference: https://github.com/redhat-developer/odo/pull/7173#pullrequestreview-1835954554
Co-authored-by: Armel Soro <asoro@redhat.com>
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>

---------

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
Co-authored-by: Armel Soro <asoro@redhat.com>
2024-01-22 11:34:01 +00:00
Armel Soro
0f2103e7d7 Recognize devfile.yml and .devfile.yml as Devfiles (#7130) 2023-12-01 12:10:19 +01:00
Armel Soro
5d4a6ef325 Use staging Devfile registry for PR tests (#7129)
* Revert using a DEVFILE_PROXY env var

There is no proxy deployed in the internal test cluster.
As such, this env var no longer makes sense.

* To help troubleshoot, display the resolved Devfile registry URL

* Make interactive tests more resilient with stack versions

They are now able to determine if the "Select version" prompt
should be asked by "odo init" or not:

* Make sure doc automation tests do not rely on hard-coded namespaces

* Allow to run doc automation tests with more parallel Ginkgo nodes

This is possible now that those tests no longer
depend on a single hard-coded namespace.

* Remove occurrences of the DEVFILE_REGISTRY env var in IBM Pipelines scripts

* Reuse logic for determining the Devfile Registry URL in "odo registry" tests

* Clarify what openshiftci-config.sh is used for
2023-10-27 07:54:14 +00:00
dependabot[bot]
d77ca3e95a Go: Bump github.com/devfile/alizer from 1.0.1 to 1.2.1 (#7126)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Armel Soro <asoro@redhat.com>
2023-10-23 18:09:52 +02:00
Philippe Martin
1f2214c08c [ui] Fix Default command checkbox (#7104)
* [ui] Fix Default command checkbox

* Regenerate static ui files
2023-10-02 10:22:38 -04:00
Philippe Martin
10b5e8a8f5 Bump to v3.15.0 (#7096) 2023-09-26 03:39:55 -04:00
Armel Soro
d34fbaed1a Make warning messages more visible (#7097)
* Wrap warning messages to make them more visible

For example, instead of displaying:
```
⚠  You are using "default" project, odo may not work as expected in the default project.
```

We are now displaying:
```
========================================================================================
⚠  You are using "default" project, odo may not work as expected in the default project.
========================================================================================
```

* Display warning message about default project/namespace in a single block

* Add unit test

* Fix sample outputs for doc automation tests

* Revert "Fix sample outputs for doc automation tests"

This reverts commit 98a6554c34.

* Ignore '===' warning header and footer for doc automation tests
2023-09-26 02:53:45 -04:00
Eng Zer Jun
0959b56285 Replace github.com/ghodss/yaml with sigs.k8s.io/yaml (#7005)
At the time of making this commit, the package `github.com/ghodss/yaml`
is no longer actively maintained.

`sigs.k8s.io/yaml` is a permanent fork of `ghodss/yaml` and is actively
maintained by Kubernetes SIG.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2023-09-22 06:23:09 -04:00
Philippe Martin
0f828ec99f Ignore devstate when existing process name is not odo + delete devstate files with odo delete component (#7090)
* Ignore devstate when existing process name is not odo

* Delete orphan devstate files with odo delete component

* Update unit tests

* Create fake system

* Add unit tests for odo delete component

* Integration tests for odo dev

* Troubleshooting

* First process on Windows is 4

* Use go-ps lib for pidExists
2023-09-20 14:20:53 +02:00
Armel Soro
1ab0178cef Make sure a Deploy command is present in the Devfile before auto-applying components (#7093)
* Add integration test case highlighting the issue

* Make sure a Deploy command is present in the Devfile before auto-applying components

* Fix expected output in 'odo deploy' interactive tests
2023-09-20 14:06:56 +02:00
Armel Soro
9724292dfa [UI] Allow single item deletion from multi-value fields (#7084)
* Support single endpoint deletion from multi-endpoints component

* Support single command deletion from multi-commands component

* Support single key-value item deletion from multi-key-value component

* Support single text item deletion from multi-text component

* Support single volume mount item deletion from multi-volume-mounts component

* Add Cypress test cases

* Git-ignore Cypress screenshots folder

* Generate static UI

* Update Delete icon and add tooltip to it

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

* Move the "delete endpoint" button closer to the element it is attached to

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

* Generate static UI

* Revert "Move the "delete endpoint" button closer to the element it is attached to"

This reverts commit 4bf895f272.

* Move the "delete endpoint" buttons closer to the elements they are attached to

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

* Generate static UI

---------

Co-authored-by: Philippe Martin <phmartin@redhat.com>
2023-09-18 10:17:32 +02:00
Armel Soro
0deb3de931 Fix API Server panic when volume component has no ephemeral field set (#7080)
* Add unit test highlighting the issue

* Safely dereference volume component 'ephemeral' field
2023-09-09 00:18:05 +02:00
Philippe Martin
bfffaa8879 Display icon in metadata (#7078)
* Display metadata icon

* UI static files
2023-09-08 14:45:21 +02:00
Philippe Martin
1d96115c45 [ui] Edit container (#7077)
* [api] patch container

* [ui] edit container

* [ui] Initialize endpoint component

* e2e tests

* static ui files
2023-09-08 11:48:53 +02:00
Philippe Martin
56b868d16c [ui] Update commands (#7073)
* [api] patch exec command

* Common changes for all command types

* [ui] edit exec command

* [api] patch Apply Command

* [ui] edit apply command

* [ui] Update image command

* [api] update composite command

* [ui] Update composite command

* [uui] Make select-container component not valid when (new ...) is selected

* [ui] e2e tests

* static ui files
2023-09-07 10:58:16 +02:00
Armel Soro
00d39889b7 Make sure to run parallel commands part of a composite command in parallel (#7075)
* 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
2023-09-06 21:15:01 +02:00
Armel Soro
725a64014a Display Git commit ID in output of odo commands where the version is shown (#7074)
* Display Git commit ID in output of odo commands where the version is displayed

This covers:
- odo init
- odo dev
- odo deploy

Displaying the commit ID (same as in `odo version`) will help quickly pinpoint the exact commit without having to run `odo version`.

See #6131 for more context

* Append the state of the working tree next to the Git commit ID

`git describe` is much more helpful to quickly understand the state of the working tree.

For backward compatibility, we are defaulting to `git rev-parse`,
just in case `git describe` does not work correctly.

* Fix integration tests

* Fix doc automation tests

Strip the Git commit ID from the full odo version string
prior to comparing the outputs.
We still want to compare the tag displayed.
2023-09-06 20:36:13 +02:00
Armel Soro
adc96994d9 [UI] Make sure form validation displays non-valid fields as red in all forms (#7064)
* Add validation to multi-container component

This covers the following forms:
- Add commands when adding a Composite Command

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

* Add validation to multi-key-value component

This covers the following forms:
- Add Environment variables in Create Container
- Add Deployment annotations in Create Container
- Add Service annotations in Create Container

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

* Add validation to multi-text component

This covers the following forms:
- Add Command in Create Container
- Add Args in Create Container
- Add Args in Create Image

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

* Add validation to select-container component

This covers the following forms:
- Select or Create container in Add Exec Command
- Select or create image component in Add Image Command
- Select or create Resource in Add Apply command

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

* Add validation to volume-mounts component

This covers the following forms:
- Select or Create volume mount in Create container

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

* Add error helper message for invalid volume size quantities

* Fix Cypress tests

* Generate static UI

* fixup! Add error helper message for invalid volume size quantities

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

* Generate static UI

---------

Co-authored-by: Philippe Martin <phmartin@redhat.com>
2023-09-05 17:14:37 +02:00
Philippe Martin
3f93ac0744 Warning if version of Devfile is different from 2.2.0 (#7065)
* Warning if version of Devfile is different from 2.2.0

* Fix unit tests
2023-09-05 11:30:51 +02:00
Philippe Martin
a65812143c Add a Devfile dependency for commands (#7063)
* Define Devfile dependency for commands

* Remove MarkDevfileNotNeeded

* More commands not using Devfile

* Tests with invalid devfiles
2023-09-04 18:12:34 +02:00
Philippe Martin
03c109a6e2 [ui] Fix Resource URI button not checked (#7070)
* [u] Fix Resource URI button not checked

* Generate static UI

---------

Co-authored-by: Armel Soro <asoro@redhat.com>
2023-09-04 17:21:31 +02:00
Philippe Martin
8051843d89 [ui] Edit images (#7068)
* [api] Update Image

* [ui] edit images

* static ui files
2023-09-04 15:48:06 +02:00
Philippe Martin
cb8494387d [ui] Edit resources (#7062)
* [ui] Edit Resource

* Add deployByDefault
2023-09-01 16:12:07 +02:00
Philippe Martin
e9dbded83b [ui] Set AutoBuild and DeployByDefault (#7051)
* Get and display autoBuild / deployByDefault

* Set autoBuild / deployByDefault

* Update ui static files

* [api] Add orpahn field to Image/Resource

* Display more info about Build / Deploy at startup

* Update ui static files

* e2e tests

* Update ui static files

* Fix unit tests

* 3-states button for AutoBuild

* 3-states button for DeployByDefault

* static ui files
2023-09-01 10:18:49 +02:00
Philippe Martin
7ff38b7965 [ui] Edit volumes (#7061)
* Update volumes

* Proxy use ipv4

* Static ui files

* e2e tests
2023-08-31 10:49:27 +02:00
Philippe Martin
e59cfa8852 [ui] Complete container creation (#7035)
* API returns more info about container

* Display more info about containers

* Update UI static files

* Fix unit tests

* Get/Set sources configuration

* [ui] create container with sources mount configuration

* e2e tests + ui static files

* Set containers's envvars

* Regenerate UI static files

* Add Annotation to POST /container

* [api] Create Container with Annotations

* [ui] Annotations when creating container

* Regenerate UI static files

* [api] Endpoints when adding container

* [ui] Endpoints when adding container

* Regenerate UI static files
2023-08-29 09:28:03 +02:00
Armel Soro
a9492307d7 Make sure to API Server listens on 127.0.0.1 (#7041)
This ensures the same local address is used for listening and checking if a given port is free.
Otherwise, `net.listen("tcp", ":$port")` would listen on `0.0.0.0:$port`,
and, on some operating systems like Windows 11, `127.0.0.1:$port` is surprisingly considered as free
(see output below). This, as a consequence, made it impossible to run multiple Dev Sessions on Windows.

```
PS C:\Users\asoro> netstat -aon | grep 2000
  TCP    0.0.0.0:20000          0.0.0.0:0              LISTENING       11044
  TCP    127.0.0.1:20001        0.0.0.0:0              LISTENING       11044
  TCP    [::]:20000             [::]:0                 LISTENING       11044
  TCP    [::1]:20000            [::1]:53656            ESTABLISHED     11044
  TCP    [::1]:53656            [::1]:20000            ESTABLISHED     9984
```

Using the same local address for listening and checking if the port is free would be safer.
If we decide to support passing a custom address, we would use that address instead.
2023-08-28 15:49:56 +02:00
dependabot[bot]
319adfa724 Go: Bump github.com/securego/gosec/v2 from 2.15.0 to 2.17.0 (#7033)
* Go: Bump github.com/securego/gosec/v2 from 2.15.0 to 2.17.0

Bumps [github.com/securego/gosec/v2](https://github.com/securego/gosec) from 2.15.0 to 2.17.0.
- [Release notes](https://github.com/securego/gosec/releases)
- [Changelog](https://github.com/securego/gosec/blob/master/.goreleaser.yml)
- [Commits](https://github.com/securego/gosec/compare/v2.15.0...v2.17.0)

---
updated-dependencies:
- dependency-name: github.com/securego/gosec/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

* Go: Bump github.com/securego/gosec/v2 from 2.15.0 to 2.17.0

Bumps [github.com/securego/gosec/v2](https://github.com/securego/gosec) from 2.15.0 to 2.17.0.
- [Release notes](https://github.com/securego/gosec/releases)
- [Changelog](https://github.com/securego/gosec/blob/master/.goreleaser.yml)
- [Commits](https://github.com/securego/gosec/compare/v2.15.0...v2.17.0)

---
updated-dependencies:
- dependency-name: github.com/securego/gosec/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

* Ignore gosec error

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Philippe Martin <phmartin@redhat.com>
2023-08-28 15:18:08 +02:00
Armel Soro
471928fead Bump version to 3.14.0 (#7038) 2023-08-22 11:38:04 -02:30
Philippe Martin
edf0bf38d4 [ui] Create/Delete volumes (#7029)
* [api/devstate] Add volumes to Devfile content

* Add Volume related endpoints to API

* Create/Delete volumes from the Volumes Tab

* Update UI static files

* API Devstate returns VolumeMounts

* Display volume mounts in containers

* [api] Add VolumeMounts to containers

* [ui] Define container's volume mounts

* [ui] e2e  tests

* Update UI static files

* [ui] create volumes from container / exec command creation

* Update UI static files

* Update container display

* Update UI static files

* Regenerate UI static files
2023-08-21 13:32:55 -02:30
Philippe Martin
fcc1cd880d [ui] Fix Add/Remove events (#7027)
* Fix add/remove events UI

* Update ui static files
2023-08-21 10:00:39 -02:30
Philippe Martin
51c079c83a Do not set Memory limit on podman when cgroup is v1 (#7028) 2023-08-21 09:26:03 -02:30
Philippe Martin
b93a75c11a Move UI out of experimental mode (#7012)
* Make UI not experimental

* Display API and UI URLs

* Remove link to old sources

* Fix integration tests

* Add UI to Usage Data

* Add a "Using the GUI to edit the Devfile" page to doc

* Add link to odo.dev specific page

* Apply suggestions from code review

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

* Change favicon with odo logo

* Display web console URL as part of the Dev status

* Update UI static files

* Document that Comments not supported

* Add UI screenshots

---------

Co-authored-by: Armel Soro <armel@rm3l.org>
2023-08-04 13:02:34 +02:00
Philippe Martin
7c976f1bf1 Remove kubeconfig flag (#7017)
* Remove kubeconfig flag

* Do not check file exists from KUBECONFIG, as KUBECONFIG can be a list of files and this is done by clientcmd library

* Fix odo --help

* Add integration test to check flag is not supported
2023-08-04 11:52:19 +02:00
Philippe Martin
84bfb227c8 Set Save button on top, enable it only when devfile changed (#7015)
* Set Save button on top, enable it only when devfile changed

* Use snackbar to display parse errors

* Do not alert devfile modified when user clicks Save

* Update UI static files
2023-08-03 14:51:46 +02:00
Philippe Martin
4361b9f39a Makes stopped command terminate normally (#7011) 2023-08-02 14:44:04 +02:00
Philippe Martin
d41364e68e odo init filters devfile stacks by supported architectures (#7004)
* Add --architecture flag

* Ask architecture during interactive mode

* Display architectures of detected Devfile

* Fix integration tests

* Fix automated doc

* Fix e2e tests

* Ignore empty lines on doc automation tests

* Update pkg/odo/cli/registry/registry.go

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

* Fix Architectures field in API

* Change "select architectures" prompt

---------

Co-authored-by: Armel Soro <armel@rm3l.org>
2023-08-01 19:36:48 +02:00
Philippe Martin
3cb1f5c66c Fix podman version check (#7010)
* Fix podman version check

* Try to decode podman version output even if command not finished

* Return timeout error if any and decode error
2023-08-01 16:07:41 +02:00
Philippe Martin
49e38f553e Do not display API logs (#7008)
* Do not regenerate apiserver-gen/go/routers.go

* Regenerate after changes done in pr#6989

* Do not regenerate apiserver-gen/go/logger.go

* Change logs

* Fix comments
2023-08-01 11:58:18 +02:00
Philippe Martin
0d1cf6e365 Bump to version 3.13.0 (#7000) 2023-07-24 10:52:16 +02:00
Philippe Martin
fdafabe617 Alert user when Devfile is synced (#6996)
* Alert user when Devfile is synced

* Update UI static files

* Fix UI e2e test
2023-07-21 13:39:46 +02:00
Philippe Martin
9605c92ede Remove API Server from experimental mode, set UI Server as experimental (#6985)
* 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>
2023-07-21 12:11:08 +02:00
Philippe Martin
251648998c Serve SwaggerUI (#6989)
* Serve SwaggerUI

* Add api server doc

* Copy swagger.yaml when running `make install`

* Check swagger.yaml if up-to-date

* Script to copy swagger-ui files
2023-07-21 10:39:31 +02:00