* Preference(Timeout) int > time.Duration
* Fix odo preference --help for unset examples
* Preference(PushTimeout) int > time.Duration
* Change set, and unset messages
* Preference(RegistryCacheTime) int > time.Duration
* use cobra.ExactArgs for set, and unset
* mockgen
* Unit tests and integration tests
* Fix unit test failure
* Update k8s.io/utils pkg
* Philippe's review
* Fix error message
* Philippe's review
Signed-off-by: Parthvi Vala <pvala@redhat.com>
* Add minimum acceptable value for preferences accepting time.Difference type
* Fix unit test failure
Signed-off-by: Parthvi Vala <pvala@redhat.com>
* Add migration plan with a warning, add better error message for incompatible formats
Signed-off-by: Parthvi Vala <pvala@redhat.com>
* Define var and and-file flags
* vars package
* Vars for deploy
* Add integration tests for dev
* Update dev mock
* New devfile library version
* Add doc
* Fix validate
* Review
* Apply suggestions from code review
Co-authored-by: Parthvi Vala <pvala@redhat.com>
* review
Co-authored-by: Parthvi Vala <pvala@redhat.com>
* update go version to 1.17
Signed-off-by: anandrkskd <anandrkskd@gmail.com>
* update go version to 1.17 and fix failure
Signed-off-by: anandrkskd <anandrkskd@gmail.com>
* Update vendoring for coloring to add NO_COLOR
* Updates odo init output / adds logo
<!--
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 cleanup
/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
**What does this PR do / why we need it:**
We have the logo appearing in `odo dev` and `odo deploy`
Those 3 commands are the most used with `odo`, and the ones that are
most used. All three should have similar and consistent output that
contains:
* What the component is doing (first line)
* What's detected (in odo init, it's the files, in odo deploy and dev
it's the component name)
* odo version that is being used / outputted.
```sh
$ odo init
__
/ \__ Initializing a new component
\__/ \ Files: No source code detected, a starter project will be created in the current directory
/ \__/ odo version: v2.5.0
\__/
Interactive mode enabled, please answer the following questions:
? Select language: javascript
? Select project type: Next.js
✓ Downloading devfile "nodejs-nextjs" from registry "DefaultDevfileRegistry" [450ms]
? Which starter project do you want to use? nodejs-nextjs-starter
? Enter component name: my-nodejs-nextjs-app
✓ Downloading starter project "nodejs-nextjs-starter" [516ms]
Your new component 'my-nodejs-nextjs-app' is ready in the current directory.
To start editing your component, use 'odo dev' and open this folder in your favorite IDE.
Changes will be directly reflected on the cluster.
```
**Which issue(s) this PR fixes:**
<!--
Specifying the issue will automatically close it when this PR is merged
-->
N/A
**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>
* Update based on reviews
Signed-off-by: Charlie Drage <charlie@charliedrage.com>
* Update based on review
Signed-off-by: Charlie Drage <charlie@charliedrage.com>
* First pass of port-forward for odo dev
* Supports forwarding multiple ports/endpoints
* Change message wording
* Port forwarding happens port 40001 onward
* Organize the code
* Integration tests
* Update the CLI help message
* Catch and check err
* Changes for failing unit tests
* Fix test and add newline to a message
* Remote label and use for loop
* Adds TODO to cleanup when port-forwarding fails
* Change messaging printed on the CLI
* Break Start method into multiple methods
* Set debug port while creating push parameters in dev
* Test after making a change to a file in pwd
* Refactoring to put things where they should be
* Notify user to run odo dev again if endpoints change
* Unit tests and rebase mistakes
* Add newline character for clear formatting
* Create business logic for reuse to find endpoints
* Fix unit and integration test failures
* Self review
* Changes based on Philippe's review
* Two more changes based on Philippe's review
* More changes based on PR review
* Changes based on PR feedback and more
- Renames all receivers in kclient package to `c`
- Adds mocks
* Removes unnecessary function
* Make function more generic for reuse
* Rename Options to DevOptions
* Address review comments by Tomas
* Fix failing unit test
* Modify message to restart odo dev
* Use helper.RunDevMode in odo dev tests
* Remove doubly imported log package
* Modifies clientset at CLI and business layer
- No need of KUBERNETES client for `odo dev` business layer.
- Added KUBERNETES client for `odo dev` CLI layer.
* Remove hardcoding of URL in tests
- It uses @feloy's work in PR #5570.
* Uses regexp to find strings.
* Makes FindAllMatchingStrings more generally usable
* Adds constant for localhost regex
* Replace matches with urls and remove unnecessary Sprintf
* Documents what urls is in RunDevMode function.
* Update tests/helper/helper_dev.go
Co-authored-by: Philippe Martin <contact@elol.fr>
* Update tests/helper/helper_dev.go
Co-authored-by: Philippe Martin <contact@elol.fr>
* Update tests/helper/helper_dev.go
Co-authored-by: Philippe Martin <contact@elol.fr>
* Update tests/helper/helper_dev.go
Co-authored-by: Philippe Martin <contact@elol.fr>
Co-authored-by: Philippe Martin <contact@elol.fr>
* 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
* 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
* POC for odo interactive testing
Signed-off-by: anandrkskd <anandrkskd@gmail.com>
* add interactive tests to make target test-integration
Signed-off-by: anandrkskd <anandrkskd@gmail.com>
* [WIP] use func to pass test instructions
Signed-off-by: anandrkskd <anandrkskd@gmail.com>
* cleanup comments/test
Signed-off-by: anandrkskd <anandrkskd@gmail.com>
* cleanup minor changes
Signed-off-by: anandrkskd <anandrkskd@gmail.com>
* fix unit test failure
Signed-off-by: anandrkskd <anandrkskd@gmail.com>
* skip for windows
Signed-off-by: anandrkskd <anandrkskd@gmail.com>
* skip for windows by not compiling, cleanup
Signed-off-by: anandrkskd <anandrkskd@gmail.com>
* cleanup, and add the make target to test files
Signed-off-by: anandrkskd <anandrkskd@gmail.com>
* incorporate review, adding comments, cleanup
Signed-off-by: anandrkskd <anandrkskd@gmail.com>
* fix failing make validate
Signed-off-by: anandrkskd <anandrkskd@gmail.com>
* update test dependency, and possible fix for windows
Signed-off-by: anandrkskd <anandrkskd@gmail.com>
* Revert "update test dependency, and possible fix for windows"
This reverts commit 55580b7dc5.
* Final cleanup
Signed-off-by: anandrkskd <anandrkskd@gmail.com>
* 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>
* Fix: Ask for devfile personalization
* Update devfile library
Signed-off-by: Parthvi Vala <pvala@redhat.com>
* Add todo
* Print live configuration, make it work
* Run mockgen script
Signed-off-by: Parthvi Vala <pvala@redhat.com>
* TODO
* Add missing mock methods
* Add review suggestions
* Add mock methods
* Add unit tests
* Add mock methods post rebase
* Fixes post rebase
Signed-off-by: Parthvi Vala <pvala@redhat.com>
* Review, only run devfile personalization if the dir is not empty and is interactive mode
* Mock methods
* Fix unit tests
Signed-off-by: Parthvi Vala <pvala@redhat.com>
* Review
Signed-off-by: Parthvi Vala <pvala@redhat.com>
* Add alizer library and test functionality
<!--
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/Developer-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/Writing-and-running-tests
4. Read how we approve and LGTM each PR: https://github.com/redhat-developer/odo/wiki/PR-Review
Documentation:
If you are pushing a change to documentation, please read: https://github.com/redhat-developer/odo/wiki/Contributing-to-Docs
-->
**What type of PR is this:**
<!--
Add one of the following kinds:
/kind bug
/kind cleanup
/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
**What does this PR do / why we need it:**
Adds the alizer library from
https://github.com/redhat-developer/alizer/tree/main/go as part of our
implementaion of `odo dev` and `odo init`.
This builds upon @feloy 's PR located here: https://github.com/redhat-developer/odo/pull/5434
**Which issue(s) this PR fixes:**
<!--
Specifying the issue will automatically close it when this PR is merged
-->
Fixes #
**PR acceptance criteria:**
- [X] Unit test
- [X] Integration test
- [X] Documentation
**How to test changes / Special notes to the reviewer:**
N/A. Only function implementation
* New alizer version
* Use alizer for odo init
* Add integration tests
* Add Alizer to odo deploy
* review
* Ask component name for odo deploy
* Fix unit test
Co-authored-by: Charlie Drage <charlie@charliedrage.com>
* 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
* update Devfile library and api
Signed-off-by: anandrkskd <anandrkskd@gmail.com>
* resolve problem occured by update
Signed-off-by: anandrkskd <anandrkskd@gmail.com>
* add test for cpuLimit,cpuRequest,memoryRequest
Signed-off-by: anandrkskd <anandrkskd@gmail.com>
* resolve branch conflicts
Signed-off-by: anandrkskd <anandrkskd@gmail.com>
* update schema version to 2.2.0 for test devfiles
Signed-off-by: anandrkskd <anandrkskd@gmail.com>
* revert - update schema version to 2.2.0 for test devfiles
Signed-off-by: anandrkskd <anandrkskd@gmail.com>
* downgrade devfile library
Signed-off-by: anandrkskd <anandrkskd@gmail.com>
* update test, remove duplication
Signed-off-by: anandrkskd <anandrkskd@gmail.com>
* replace oc with kubectl
Signed-off-by: anandrkskd <anandrkskd@gmail.com>
* restructure when
Signed-off-by: anandrkskd <anandrkskd@gmail.com>
* force push
Signed-off-by: anandrkskd <anandrkskd@gmail.com>
* rebase and update the test to use cliRunner
Signed-off-by: anandrkskd <anandrkskd@gmail.com>
* remove golint issues
Signed-off-by: anandrkskd <anandrkskd@gmail.com>
* 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>
* Fetch locale information for Telemetry
* Set locale info in traits
* Continue execution if locale detection fails
* Update pkg/segment/segment.go
Co-authored-by: Philippe Martin <contact@elol.fr>
* Update pkg/segment/segment.go
Co-authored-by: Philippe Martin <contact@elol.fr>
* Use %s instead of %w for logging error
Co-authored-by: Philippe Martin <contact@elol.fr>
* 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>
* 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
* 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
* export GOFLAGS=-mod=vendor in Makefile
* use go get instead of go install
for installing test dependencies
* use tools approach to manage testing dependencies
When using this apporoach we can make sure that all dependencies in a
proper version are vendored with the source code.
* go mod vendor
* add wwhrd expection for github.com/hinshun/vt10x
* update to openshift 4.7 and sbo 0.7.0
* use server side apply for updating deployments
* go mod vendor
* use ApplyDeployment instad Patch and Create
* fix login message
* update unit tests to work with ApplyDeployment function
* fall back to Create/Update for k8s older than 1.16
* abstract fieldManager into const
* fix operator-framework imports
* feat: OCI-based registry support
Signed-off-by: jingfu wang <jingfwan@redhat.com>
* refactor: download the whole stack by default
Signed-off-by: jingfu wang <jingfwan@redhat.com>
* fix: invalid folder issue
Signed-off-by: jingfu wang <jingfwan@redhat.com>
* fix: address comments
Signed-off-by: jingfu wang <jingfwan@redhat.com>
* fix: test case and auto migration
Signed-off-by: jingfu wang <jingfwan@redhat.com>
* fix: code issue detected by unit test
Signed-off-by: jingfu wang <jingfwan@redhat.com>
* test: fix unit test
Signed-off-by: jingfu wang <jingfwan@redhat.com>
* Merge branch 'master' of github.com:openshift/odo into odoMigration
Signed-off-by: jingfu wang <jingfwan@redhat.com>
* refactor: adopt the latest devfile library
Signed-off-by: jingfu wang <jingfwan@redhat.com>
* test: fix unit tests
Signed-off-by: jingfu wang <jingfwan@redhat.com>
* test: fix unit tests
Signed-off-by: jingfu wang <jingfwan@redhat.com>
* Merge branch 'master' of github.com:openshift/odo into odoMigration
Signed-off-by: jingfu wang <jingfwan@redhat.com>
* Add and remove service info from devfile
* Changes function name and moves to service package
Changed function name from `AddServiceToDevfile` to
`AddKubernetesComponentToDevfile`. Similar name change for delete
function. Also, moves it from `pkg/envinfo` to `pkg/service` package
* Address Maysun's PR review comments
* Modify storage create and delete to use changes in "devfile/library"
* Check for length of containers and mount paths
* Don't ignore the errors; use t.Error
* Fixes based on PR review
* Addressed Mrinal's review comments and fixed panic
"odo service create" without any arguments was panicking.
* Fix integration tests
Fixing issues to play well with ConsentTelemetry being set to false
before each test runs and with the change in this PR to execute service
create and delete commands from the component's directory.
* Removes wrongly commented code.
* Integration test for service create and delete
* Remove unnecessary newlines
* Check devfile existence before anything else
* Common function to decide service provider backend
* Remove a test spec and modify another
* Adds incorrectly removed test spec back
* Correct the error message to expect
* Send telemetry to segment
* Add tests and other properties
* Add comments
* Fix fmt
* Add telemetry dev key
* Add non-test related changes requested to the PR and add consenttelemetry prompt
* Handle prompt while running tests
* First attempt at fixing unit job failure
* Modify tests as requested
* Stop prompting when preference is called
* Fix comments
* Add more unit tests and integration test(WIP)
* Fix failing tests
* Stop prompting when help is called
* Make tests more verbose
* Add Usage data doc
* Add segment key
* Add a better usage doc
* Add comments, move tests and other requested changes
* Fix comments and remove focus
* Add set ConsentTelemetry unit tests
* Change want from string to bool
* Fix failing integration test
* Fix failing operator hub test
* Fix failing devfile integration test
* Fix tests failing due to cmdwrapper WithEnv
Co-authored-by: Dharmit Shah <shahdharmit@gmail.com>
* 3377 adding odo devfile support test
* #3377 replaced spaces with a Tab
* #3377 updated focus value
* #3823 new func to match JSON path values and updated test scripts to use it
* added . to import
* updated Makefile to aff gjson
* modified Makefile for gjson
* adding go.mo, go.sum and vendor for new gjson dependency
* removed unnecessary changes
* Removed unused import
* Removing if block
* Fixed expected strings for JSON matcher
* Fixed json paths and values to be compared
* Fixed JSON paths and expected values
* fixed required flags for expected failure
* Removed comment in failing code
* Fixed expected output line 164
* removed commented code
* Update go-git
* Add support for specifying branch and tag name
* Fix gosec error
Fix Integration test
* Added warning if commit id is used as revision
Added Integration tests
* fix devfile
* Fix failing test update tag version
* Address review comment 1
* Makes odo work with v0.3.0 of Service Binding Operator
* Self-review of documentation
* Change from SBR to SB in integration test
* Fix Group and Kind when checking for SB support