29 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
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
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
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
Armel Soro
5660093167 Use go-cmp instead of reflect.DeepEqual to compare unit test results (#6343) 2022-11-24 07:24:32 -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
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
c2c0bddb7b Adds support for odo list services (#6118)
* Adds support for odo list services

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

* Aliases for simpler use

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

* Use slice instead of slice of map

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

* Address Philippe's PR feedback

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

* Add more usable fields to BindableService

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

* Add service field to the struct and JSON output

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

* Address Armel's PR feedback

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

* Ignore error assuming namespace is deleted/terminating

This is mainly a problem in integration tests where odo tries to list
bindable Operator backed services from namespaces that are deleted or
in Terminating state.

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

* klog when listing bindable services fails

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

* Move klog/v2 to indirect dependency

klog/v2, at the time of this commit, was used only in binding.go and
dev.go files. Rest of the code used the v1 of klog. To keep things
consistent, I removed klog/v2 from the go.mod file, and changed the
imports for the two files mentioned above to use v1 instead of klog/v2.
Next, I did `go mod vendor` which resulted in all the changes that are
carried by this commit.

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

Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>
2022-09-16 18:38:31 +02:00
Parthvi Vala
886b14d69c Fix broken links to installation guide (#6117)
Signed-off-by: Parthvi Vala <pvala@redhat.com>

Signed-off-by: Parthvi Vala <pvala@redhat.com>
2022-09-13 17:57:24 +02:00
Philippe Martin
9e39df37d3 Use map for runningIn instead of array in JSON output (#6094)
* Use map for runningIn instead of array

* Set false entries in runningIn map

* Rename RunningModeList to RunningModes + fix doc

* Fix integration test
2022-09-06 18:55:19 +02:00
Armel Soro
843717cab3 Make odo work if optional metadata.name field is missing in Devfile (#6015)
* 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.
2022-08-30 02:54:31 -04:00
Parthvi Vala
224069cd68 odo dev: Add support for non-exec commands part of a composite run or debug command (#5923)
* Initial commit

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

* Move ValidateResourceExist(s) from pkg/service to pkg/devfile/adapters/kubernetes/component

* Fix odo dev cleanup

* Fix multiple deployment issue

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

* DRY the code

* Fix unit test failure

* Add integration tests

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

* remove comment

* Add isPartOfComponent to GetLabels, and GetSelector

* Add unit tests for changes in ListResourcesToDeleteFromDevfile

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

* Fix unit test failures due to removal of component label

* Enhance integration tests

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

* Use a single devfile.yaml

* Fix test failures

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

* Fix rebase conflicts, add new tests for remote Dockerfile URI, and rm3l's review

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

Co-authored-by: Parthvi Vala <pvala@redhat.com>
Co-authored-by: Armel Soro <armel@rm3l.org>
Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Attempt at fixing integration tests

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

* Fix integration tests

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

* Mockgen

* Changes post rebase

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

* Attempt at fixing integration tests

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

* Fix rebase mishap

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

Co-authored-by: Armel Soro <armel@rm3l.org>
2022-08-10 10:41:43 +00:00
Philippe Martin
f22c3f854d odo dev: react to changes as soon as possible (#5933)
* 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
2022-08-08 10:20:55 +00:00
Armel Soro
7bd4d25de6 Allow binding to services from other namespaces (#5936)
* Allow Dynamic Client to list dynamic resources from a specified namespace

If the namespace specified is empty, it works as before
by returning resources from the current namespace.

Listing dynamic resources is used
when listing service binding instances.

* Allow users to select a namespace from which Service Binding Instances are retrieved

For consistency, this supports both interactive and non-interactive modes.
Non-interactive mode is supported via a '--service-namespace' flag.
As before, if this namespace is not specified, we default
to using the current namespace.

This also handles permission errors that might occur while listing namespaces/projects.
On Openshift, listing projects returns all the projects a user
effectively has access to, but this does not behave the same way
in vanilla K8s clusters. If user is allowed to list namespaces/projects,
the list returned is not filtered by any ACL filter [1].

In the case a user is not allowed to list namespaces/projects,
rather than returning an error, we are prompting them to manually
enter a different namespace (or nothing to use the current one).

[1] https://github.com/kubernetes/kubernetes/issues/48537

* Make the "No bindable service instances found" error message more explicit by mentioning the namespace

* Add namespace information to service (with or without Devfile)

* Add namespace information to 'list binding' and 'describe binding' output

* Check SBO availability before user is asked questions
2022-07-21 18:44:05 +02:00
Armel Soro
2ae27e9dcd Allow setting namingStrategy when using odo add binding (#5912)
* Add integration test for setting naming strategy non-interactively

* Add ability to set `namingStrategy` via `odo add binding`

For consistency, this supports both interactive and non-interactive modes.

More details about Service Binding naming strategies in [1].

[1] https://docs.openshift.com/container-platform/4.10/applications/connecting_applications_to_services/binding-workloads-using-sbo.html#sbo-naming-strategies_binding-workloads-using-sbo

* Update documentation

* Add information about the naming strategy to `odo describe binding`

* Test that naming strategy is part (or not) of `odo list binding` JSON output
2022-07-12 13:04:03 +00:00
Philippe Martin
336b9e1702 odo dev: handle port forwarding after pod restart (#5885)
* Move port forwarding to reconcile loop

* Add integration test

* Fix dependencies on cli/dev + remove message to restart odo dev after devfile.yaml changes

* Restart port forwarding when endpoints are modified in Devfile

* Fix setNamespace

* Fix componentName

* Move message back to CLI

* add doc

* Move port forwarding after starting application

* Remove unnecessary dependency to State module

* Fix err
2022-07-04 08:43:37 +00:00
Philippe Martin
062160280f Add assertions for types implementing interfaces (#5893) 2022-07-01 08:12:24 +00:00
Parthvi Vala
68626cd54b Fix misleading add binding error message (#5887)
* Fix misleading add binding  error message

* Fix and add unit tests
2022-06-29 13:38:19 +00:00
Philippe Martin
d74a1a8b81 odo add binding without devfile.yaml (#5858)
* Set Kind in servicebinding instead or Resource

* odo add binding without Devfile

* Force select at least one operation option

* Change message for selecting operations

* Add Go back when selecting resource name for waorkload

* Doc

* Enable interactive binding tests for Kubernetes

* Add integration tests

* Validate and Test workload flag

* Fix doc about workload flag

* Apply suggestions from code review

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

* Review

* Fix interactive test

Co-authored-by: Parthvi Vala <pvala@redhat.com>
2022-06-24 13:01:40 +00:00
Philippe Martin
87c8d2c72b odo list binding (#5823)
* CLI

* odo level with devfile only

* List from cluster

* Add running mode

* Doc + Integration tests + command works without Devfile

* Fix context.New / tests

* Human readable output

* Add namespace to human readable output

* Integration tests for human readable output

* Add doc

* Mutualize code for output table

* Refaactor + test ListAllBindings

* Move api functions to kclient

* Apply suggestions from code review

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

* Fix want1

* Review

Co-authored-by: Armel Soro <armel@rm3l.org>
2022-06-21 08:43:59 +00:00
Parthvi Vala
aa2d935e7f odo add binding - Bind as files UI update (#5817)
* odo add binding - Bind as files UI update

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

* Philippe's review

* Update docs/website/versioned_docs/version-3.0.0/command-reference/add-binding.md

Co-authored-by: Dharmit Shah <shahdharmit@gmail.com>

* Update docs/website/versioned_docs/version-3.0.0/command-reference/add-binding.md

Co-authored-by: Dharmit Shah <shahdharmit@gmail.com>

* Update docs/website/versioned_docs/version-3.0.0/command-reference/add-binding.md

Co-authored-by: Dharmit Shah <shahdharmit@gmail.com>

* Update docs/website/versioned_docs/version-3.0.0/command-reference/add-binding.md

Co-authored-by: Dharmit Shah <shahdharmit@gmail.com>

* Update docs/website/versioned_docs/version-3.0.0/command-reference/add-binding.md

Co-authored-by: Dharmit Shah <shahdharmit@gmail.com>

* Update pkg/odo/cli/add/binding/binding.go

Co-authored-by: Dharmit Shah <shahdharmit@gmail.com>

* Update docs/website/versioned_docs/version-3.0.0/command-reference/add-binding.md

Co-authored-by: Dharmit Shah <shahdharmit@gmail.com>

* Update docs/website/versioned_docs/version-3.0.0/command-reference/add-binding.md

Co-authored-by: Dharmit Shah <shahdharmit@gmail.com>

* make consts private

Co-authored-by: Dharmit Shah <shahdharmit@gmail.com>
2022-06-14 09:52:14 +00:00
Dharmit Shah
e3b3b8eb53 Add odo logs (#5760)
* 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>
2022-06-13 00:57:30 -04:00
Parthvi Vala
5a506eeff4 odo remove binding (#5787)
* odo remove binding

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

* Documentation

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

* Refactor pkg/binding and separate add and remove code

* Add unit test

* Rebase alterations

* Refactor

* Philippe's review

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

* Rebase
2022-06-08 08:14:56 -04:00
Parthvi Vala
1d48c49699 Add unit test for odo add binding (#5790)
* Add unit test for odo add binding

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

* Philippe's review

* Fix unit test failure
2022-06-08 04:32:27 -04:00
Philippe Martin
ba7f1a1cfc odo describe binding (#5773)
* List Servicebindings from SBO only

* Support both implementations

* Integration tests (TBC)

* Human readable output

* Support --name flag

* Reference doc

* fix

* self review

* Check for InjectionReady condition before to get bindings

* Fix comments

* Remove unnecessary error returned value

* Display info when status is unknown

* Sections in doc

* Review
2022-06-03 08:46:44 -04:00
Philippe Martin
a26aa6a398 odo registry -o json (#5739)
* Doc odo registry

* JSON output

* Move structure for JSON output to api package

* Doc for json output

* Add integration tests

* Review

* Do not rely on devfile version for tests as it is too unstable
2022-05-16 13:45:22 +02:00
Parthvi Vala
6cf24bbc33 Create binding between devfile component and existing service (#5641)
* Skeleton for odo create binding

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

* Add logic

* Add functions to add data to devfile and create files

* Dharmit's review + make it work with <name>/<kind>.<apigroup>

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

* Add support for more formats

* Add integration tests and supporting helper functions

* create > add

* Add default ServiceBinding name

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

* Fix timeout, and move cli/add/binding.go to cli/add/binding/binding.go

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

* Update pkg/binding/binding.go

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

* Update pkg/binding/binding.go

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

* Update pkg/binding/interface.go

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

* Philippe's review

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

* Self review

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

* Fix unit test failure

* Philippe's review: round 2

* Tomas review; self review

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

* Fix windows test failure

* Randomize binding name for test

Co-authored-by: Philippe Martin <phmartin@redhat.com>
Co-authored-by: Philippe Martin <contact@elol.fr>
2022-05-12 15:05:17 +02:00