Commit Graph

105 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
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
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
Armel Soro
5660093167 Use go-cmp instead of reflect.DeepEqual to compare unit test results (#6343) 2022-11-24 07:24:32 -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
Parthvi Vala
6d82a577a2 Fix: ServiceBinding resources are not deployed with odo deploy (#6029)
* Fix: ServiceBinding resources are not deployed with odo deploy

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

* Fix test failures

* Add owner reference before object creation

Signed-off-by: Parthvi Vala <pvala@redhat.com>
2022-08-24 14:37:04 -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
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
c777e3351a Wait for deployment rollout only when binding created / modified (#5785)
* Wait for deployment rollout only when binding created / modified

* Add integration test
2022-06-13 19:43:27 +00:00
Armel Soro
7c7e607542 Fix issue with variables not substituted in uri-referenced manifests (#5451) (#5711)
* Add integration test highlighting the issue

The devfile used is the same as devfile-deploy.yaml,
except that the the Kubernetes component is referenced via the URI.
This is why the same integration test logic is being reused here.

* Add higher-level function in 'libdevfile' allowing to load component resource manifest and substitute variables

This works with both Inlined or Uri resources.

Notes:
- Ideally, it would make more sense to rely on the same logic used in Devfile to
  substitute variables (defined in the 'variables' package),
  but this function is not exported;
  and the exported ones substitute variables only in the URI name,
  not in the content itself (it is not fetched),
  which is actually the issue we are trying to solve here.

* Switch to using 'uri' Kubernetes components in test Devfiles

This seems to be a much more realistic case when referencing external
Kubernetes manifests.

Notes:
Some tests, like for `odo deploy`, still test 'Inlined' manifests.

* Pass the component name to 'GetComponentResourceManifestContentWithVariablesResolved'

As suggested in review, this makes more sense
now that we are passing the entire devfile object

* Rename 'GetComponentResourceManifestContentWithVariablesResolved' with 'GetK8sManifestWithVariablesSubstituted'

Previous name was a bit long ^^

* Remove extra parentheses in error string returned by 'ComponentsWithSameNameError#Error', as suggested in review

* Revert "Switch to using 'uri' Kubernetes components in test Devfiles"

This reverts commit df1f19ed959b8c82aa17ac3cf12c343305789149.

This will be done in a separate PR, with ideally
changes that should allow to use the same set of
tests for testing both Inlined and
URI-referenced manifests.
2022-05-05 07:21:22 -04:00
Philippe Martin
feb49607d4 Refactor labels (#5618)
* refacto labels

* Getters

* Builder

* Do not export labels

* Move to pkg/labels + doc

* Fix rebase
2022-04-28 09:51:02 -04:00
Armel Soro
06550eb233 Add additional checks to golangci-lint (#5567) (#5687)
* Document golangci-lint configuration options

* Do not limit the number of issues reported per linter

* Add check preventing the use of the deprecated 'github.com/pkg/errors' package

* Upgrade golangci-lint to 1.37.0, so we can use 'revive' Linter

- revive is a drop-in replacement for the deprecated golint Linter
- revive will allow to check for error strings

Note: We are purposely not using the latest golangci-lint (1.45.0)
but the minimum version from which revive is available.
This is because the latest 1.45.0 reports additional linting issues
(from govet and staticcheck for example). And fixing those side errors
is outside of the scope of this issue.
Also some of those issues are already fixed in #5497 (update to Go 1.17).

* Configure revive to check for error strings

More rules can be added later on if needed

* Fix issues reported by revive's error-strings rule

Some rules are purposely ignored when the
error messages represent top-level errors that are
displayed to be displayed as is to end users

* Fix more error-strings issues

For some reason, those were not reported by revive's error-strings rule,
but only by GoLand inspection tool.

* Fix missing `revive:disable:error-strings` comment directive

Also replace "fmt.Errorf" by "errors.New" when the error message is static
2022-04-25 07:32:20 -04:00
Parthvi Vala
abc4b59369 Remove references to v2 commands, remove unused functions, and constants (#5638)
* Remove references to v2 commands, remove unused functions, and constants

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

* Dharmit's review

Signed-off-by: Parthvi Vala <pvala@redhat.com>
2022-04-20 00:54:15 -04:00
Philippe Martin
904dfa5a42 Wait deletion (#5604)
* odo delete component --wait flag

* Wait non blocking resources

* refactoring

* Add integration tests

* review

* Fix rebase: wait deletion when quitting odo dev

* Wait after Ctrl-C
2022-04-04 17:14:43 -04:00
Philippe Martin
b09928d1ba Remove odo push command (#5570)
* Remove odo push

* review

* Fix rebase

* Increase delay for odo dev
2022-03-28 07:27:33 +02:00
Charlie Drage
7618e8f3e4 Improve UX/UI of odo deploy and dev (#5539) 2022-03-22 19:58:38 +01:00
Philippe Martin
24fd02673d Remove github.com/pkg/errors dependency (#5557)
* Change errors.Wrapf

* Replace errors.Wrap

* Dont use pkg/errors (except error.Cause)

* Fix errors on Windows (do not test system underlying message)

* Replace errors.Cause

* Review
2022-03-21 11:32:42 +01:00
Parthvi Vala
1d2cf39cf7 Delete with devfile.yaml (#5500)
Signed-off-by: Parthvi Vala <pvala@redhat.com>
2022-03-20 18:20:52 +01:00
Charlie Drage
d48a607e9a Add Dev and Project labeling / refactoring labeling and annotations (#5551)
* Add Dev and Project labeling / refactoring labeling and annotations

<!--
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 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 feature
/kind cleanup

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

In this PR we:
  * Correctly name all the labels in a more concise manner (ex. Project Type
    is an annotation)
  * Add Dev and Deploy mode labels to both `odo dev` and `odo deploy`
    commands so that we can intuitively retrieve what components are in
    deploy or dev mode
  * Somewhat refactors how we do labeling

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

1/2 of PR's for https://github.com/redhat-developer/odo/issues/5405

**PR acceptance criteria:**

- [X] Unit test

- [X] Integration test

- [X] Documentation

**How to test changes / Special notes to the reviewer:**

N/A

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

* Review update / renaming

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

* Review changes. Adds tests for generateDeploymentObjectMeta. Changes labels

Signed-off-by: Charlie Drage <charlie@charliedrage.com>
2022-03-17 13:38:00 +01:00
Philippe Martin
daa9c61a41 odo delete component without a devfile (#5511)
* Namespace

* Get all resources with selector

* Delete resources

* Display errors

* Add start message

* Set correct labels for odo deploy

* Add unit tests

* Add integration tests

* Delete managed by odo only

* Fix rebase

* Review + small fixes

* AdD/fix logs
2022-03-10 05:44:18 -05:00
Dharmit Shah
f80207b029 Implements odo dev (#5441)
* Skeleton for odo dev and a unit test

* Update go mod for fsnotify

* Start method Pushes and then Watches

* More understandable code comments

* Client and interface for watch package

* Mocks for watch package

* Add CLI layer

* Fix infinite watch & push trigger

* Remove context flag from odo dev

* Add integration tests for odo dev

* Add klog to dev.go

* Replace errors.Wrap with fmt.Errorf

* Self review

* Removes `odo watch` command, but the business logic exists as it's
  used by odo dev
* Removes integration tests for `odo watch`
* Removes errors.go and types.go from pkg/dev/ since they are empty

* Check if error is not nil

* Use real client in watch unit tests

* Uncomment AfterEach from tests

* Modify the logs printed to stdout

* Changes based on Philippe's review

* Remove unused clients

* Parthvi's PR review and unit test fixes

* Fix gofmt message, remove message to not expect

* Fix lint complains, add mistakenly deleted URL creation logic

* Remove or modify tests that rely on odo push output

* Remove unused variables based on golangci-lint

* Fixes based on Philippe's review

* Initialize first index after first run of odo dev

* Modify odo dev test, and uncomment a mistake
2022-03-03 04:15:37 -05:00
Philippe Martin
83a3ee5a0b [v3] update to SBO library to 1.0 (#5314)
* update vendored sbo to 1.0

* go mod vendor

* update code to work with sbo 1.0

* Re-enable use of operator

* Fix remove link

* Continue when no access to CRDs

* Fix rebase

Co-authored-by: Tomas Kral <tkral@redhat.com>
2022-03-01 04:36:53 -05:00
Philippe Martin
21ea375695 Use functions from devfile library (#5457)
* Remove duplicated functions from pkg/util

* Use generator.GetVolumeMountPath from devfile library
2022-02-14 00:40:37 -05:00
Philippe Martin
e4a65e81ed Cleanup more functions not used after removing old v2 commands (#5447)
* Remove service.FindDevfileServiceBinding

* Remove IsOperatorServiceNameValid

* Remove MapFromParameters

* Remove OperatorSvcExists

* Remove AddKubernetesComponentToDevfile

* Remove AddKubernetesComponent

* Remove DeleteKubernetesComponentFromDevfile

* Remove from kclient/operators.go

* Remove unused functions from pkg/service

* Remove Storage methods from LocalConfigProvider

* Remove unused from pkg/envinfo

* Cleanup util packages

* Remove unused code with the help of staticcheck --unused.whole-program=true -- ./...
2022-02-10 12:10:00 -05:00
Philippe Martin
b75fa552ce Init command (#5348)
* Init command

* More tests + check empty dir

* Move function from catalog to service package

* Interactive asks lang + type

* Interactive

* Refactor catalog package with interface

* Add mocks for catalog and init/asker

* Add tests

* Create sub-packages for init + starter project

* Rename files in pkg/catalog

* More validations

* fix

* Logs

* Rollback

* Go back and No starter

* Review

* Use filesystem.Filesystem in pkg/catalog

* Change pull from registry strategy

* More unit tests

* More tests

* Integration tests

* Review

* Use full path to fix problem with Unzip

* Add integration test for devfile with parent URI

* Add prefClient dependence to catalog package

* Move function to pkg/init package

* Review

* Fix rebase

* Review
2022-02-01 04:48:54 -05:00
Parthvi Vala
4d7aab21e5 Delete outerloop resources with undeploy (#5276)
* Undeploy POC

* Implement undeploy

* Cosmetic changes

* Add more tests

* Add documentation

* Add interface methods for undeploy

* Update docs/website/docs/command-reference/flags.md

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

* Update docs/website/docs/command-reference/flags.md

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

* Update docs/website/docs/command-reference/flags.md

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

* Update docs/website/docs/command-reference/delete.md

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

* Add requested changes

Co-authored-by: Philippe Martin <contact@elol.fr>
2021-12-17 07:44:12 +01:00
Philippe Martin
e2f8b131cc Refactor occlient (#5271)
* Remove unused code / files

* Move RunLogout to kclient

* Move project to kclient

* Move Routes to kclient

* Cleanup occlient package

* Review
2021-12-09 18:21:19 +00:00
Tomas Kral
5f79c542a8 openshift/odo -> redhat-developer/odo (#5268)
* openshift/odo -> redhat-developer/odo

* update more links to redhat-developer
2021-12-01 16:38:34 +01:00
Philippe Martin
ac478e9cd1 odo deploy command (#5228)
* Update devfile library

* deploy cmd

* Init "odo deploy" command reference

* Integration test

* Fix odo deploy

* Filter components to apply during odo push

* Output

* Remove redondant level 1 title

* Doc review

* Use server-side apply to apply Kubernetes components

* Review

* Replace PROJECT_ROOT with PROJECTS_ROOT
2021-11-24 15:26:03 +01:00
Philippe Martin
2cb0e9c591 Remove metadata.namespace from ALM Examples (#5208)
* Remove metadata.bamespace from ALM Examples

* Add unit tests
2021-11-08 10:17:55 +01:00
Tomasz Janiszewski
0512d3a2cf Fix shadow (#5172)
* Configure golint

* auth/login.go

* catalog/catalog.go

* component/component.go

* component/component_full_description.go

* config/config.go

* component/adapter.go

* component/podwatcher_test.go

* envinfo/envinfo.go

* envinfo/storage.go

* envinfo/url.go

* kclient/deployments.go

* occlient/occlient.go

* describe/component.go

* component/create.go

* component/delete.go

* component/list.go

* component/push.go

* config/set.go

* config/unset.go

* service/operator_backend.go

* genericclioptions/context.go

* preference/preference_test.go

* project/project.go

* service/link.go

* service/service.go

* storage/storage.go

* sync/adapter.go

* sync/adapter_test.go

* sync/sync.go

* url/kubernetes.go

* util/file_indexer.go

* util/util.go

* util/util_test.go

* watch/watch.go

* watch/watch_test.go

* helper/helper_filesystem.go

* devfile/cmd_devfile_push_test.go

* devfile/cmd_devfile_url_test.go

* devfile/cmd_devfile_watch_test.go

* operatorhub/cmd_service_test.go

* gofmt

* Enable gofmt in golangci

* Return context not nil

* reanme context

* Remove unused value in watch

* Fix pkg/catalog/catalog.go
2021-10-27 18:02:17 +00:00
Dharmit Shah
8718d59fc2 Adds support for creating k8s built-in resources (#5107)
* Adds support creating k8s built-in resources

* Fix the failing unit tests

* Add starter project name

* Update docs; set ownerReferences correctly

* Address failing integration tests

* Doc changes based on Philippe's feedback

* Update website/docs/tutorials/create-k8s-resources.md

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

* Move back to client-go v0.21.3

Co-authored-by: Philippe Martin <contact@elol.fr>
2021-10-21 09:07:28 +00:00
Mohammed Ahmed
8a6084e126 Adding listing of CRDs when only operator name is provided (#5137)
* Adding listing of CRDs when operation name is provided

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Fixing cognitive load

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Renaming function

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Simplifying code

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Fixing code

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Moving common args to function args

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Adding tests and documentation

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Adding website docs

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Reverting docs/public

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Fixing as per feloys recommendation

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Adding tabbing to description

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Using tabwriter

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Fixing tabwriter

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Fixing wrong bracket

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Removing tabwrtier from normal output

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Fixing tabbing for describe service human output

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>
2021-10-18 18:51:46 +02:00
Philippe Martin
3674110c22 Validate parameters on odo service create from swagger/csv (#5074)
* Validate parameters

* Fix types

* detect errors on params

* Remove duplicated lines

* Get type from schema

* New describe

* Integration tests

* Fix kclient interface

* vendor
2021-09-29 05:16:57 -04:00
Philippe Martin
99484663b7 Use interface for kclient (#5065)
* Use interface for kclient

* Fix + add mocks

* Add mockgen script

* remove unused param + add unit test

* fix rebase
2021-09-27 03:51:12 -04:00
Mrinal Das
639084d3bc Modifies the usage of service create, link and unlink by using separate files for Kubernetes resources (#5031)
* Modifies the usage of service create, link and unlink by using separate files for Kubernetes resources

* Modifies the uri path to include the folder path

* Deletes the files when all flag is used with odo delete

* Fixes the unit test removeDevfileURIContents

* Fixes the problem of non existent uri folder when all flag is used in the delete command
2021-09-20 06:55:42 -04:00
Mohammed Ahmed
72186caaf5 Removing remaining service catalog references (#5033)
* Removing remaining refs of service catalog code

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Removing remaining unused service structs

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Fixing gofmt

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Fixing after rebase

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Removing unused labels

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Shortening `odo link -h output`

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Fixing test

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Removing unused serviceclass

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Removing service cat link refs

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Removing unused functions

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Removing left out kclient svc catalog and its refs

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Fixing gofmt error

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Fixing error message

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Fixing import

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Updating link usage

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Fixing usage commit

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>
2021-09-13 04:59:39 -04:00
Parthvi Vala
b35d5380d6 Fix clusterwide permission issues with odo link and run K8s tests with a developer user (#5032)
* Fix clusterwide permission issue related to CRD while linking without the SBO

* Initial test work

* Create developer user for minikube

* Add script to create developer user for minikube

* Attempt at fixing failures with minikube setup

* Add debugger statement

* Fix failures

* Fix CI failures

* Add apiGroup for ingress

* Temporary attempt at fixing CI failures

* Remove test

* Add comments, and other requested changes by feloy

* Fix misplaced else logic

* Update comment as suggested by feloy

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

* Add warning

Co-authored-by: Philippe Martin <contact@elol.fr>
2021-09-06 17:18:37 +02:00
Philippe Martin
fd6ebb27f6 Get parameters information of operator backed services from Kubernetes OpenAPI spec (#5020)
* vendor

* go mod

* remove old service structures

* Get parameters information of operator backed services from Kubernetes OpenAPI spec

* Add DisplayName

* Displays required + type

* Add some integration tests

* Unit tests

* Display a warning when no CRD or CSV info is found

* Add unit tests

* Update pkg/odo/cli/catalog/describe/operator_backend.go

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

Co-authored-by: Dharmit Shah <shahdharmit@gmail.com>
2021-09-03 20:00:57 +02:00
Philippe Martin
354a9d033e List all services in JSON output (#5025)
* List all services in JSON output

* review
2021-09-03 04:33:06 +02:00
Mohammed Ahmed
0b8b712a99 Dropping support for service catalog based services (#4906)
* Removing cli layer and integration tests related to service catalog

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Fixing missing error msg

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Fixing golint errors

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Fixing error for interactive mode

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Moving interactive mode error to top

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Fixing

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Fixing interactive mode error condition

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Removing some more service related code

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Fixing golint

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Removing service catalog backend part 1

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Updating changelogs

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Removing some more of the service catalog related code

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Updating as per comments in review

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Update pkg/odo/cli/service/create.go

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

* Fixing gofmt

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Adding kube to cli docs

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Updating changelog as per comments by @dharmit

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Removing some unnessasary stuff

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Updating docs based changes as per review

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Fixing test

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Update pkg/odo/cli/catalog/describe/service.go

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

* Update pkg/odo/cli/service/list.go

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

Co-authored-by: Parthvi Vala <pvala@redhat.com>
Co-authored-by: Philippe Martin <contact@elol.fr>
2021-08-18 11:41:43 +00:00
Mrinal Das
2e661bf71d Adds support for linking using service binding without the service binding operator (#4905)
* Adds support for linking using service binding without the service binding operator

* Uses isLinkResource() to detect the service binding resources

* Updates the success message for operator based links

* Updates the flow to creating the deployment first

* Adds annotations to the Redis CR in devfile-with-link.yaml file

* Updates the flow to create only the services before the deployment.

It also separates the push related code for link and service creation.

* Moves the for loop in setLinksServiceNames() inside the if condition

* Adds and returns a error message when the pipeline throws a forbidden type of error

* Moves the updation of services and pvcs with owner references before attempting creation of links
2021-08-02 15:42:41 +00:00
Philippe Martin
a9e19ae6bb Add linked service information in odo describe (#4866)
* odo describe

* Check if SBR are supported before to use them

* fix log

* Changelog
2021-07-05 09:58:12 -04:00
Philippe Martin
843e520f6b odo link and odo unlink write to devfile without deploying to cluster (#4819)
* Do not deploy sbr at `odo link` time, save it in devfile

* Changelog

* Fix remove duplicates

* Do not set owner references again

* Fix wait for pod terminating

* Simplify env vars deduplication

* Add comment

* Dont use oc

* link type

* fix

* Fix spinner

* Fix tests

* Fic error message for link/unlink

* Review

* No spinner
2021-07-01 06:43:24 -04:00
Girish Ramnani
9cfcbc3485 param based odo service create for operator backed services (#4704)
* initial work towards param based odo service create

* change

* add type data to cr

* add to devfile

* update olm

* remove logs

* towards tests

* init tests

* more test

* fix tests

* fix unit again

* set default service name

* mod fix

* addressed some comments

* add postgres operator in setup and in test

* fix

* fix some tests

* fix helpers

* helper flag

* merge conflicts

* add tests and install operator

* certain cases fix

* fix intg tests

* update scripts

* fix intg test

* changed function name

* changes

* fix comments

* docs update

* link fix

* small fix

* comment

* unit tests

* doc fix

* renamed as per comments

* comment
2021-06-24 03:42:47 -04:00
Girish Ramnani
9eca1e7563 odo catalog describe service <operator> --example (#4821)
* init

* Fix test

* resolve comments
2021-06-22 09:12:08 -04:00