* resolve inconsistent order of registries in preference view
Signed-off-by: anandrkskd <anandrkskd@gmail.com>
* reverse regList on business layer
Signed-off-by: anandrkskd <anandrkskd@gmail.com>
* update unit test, add functional test and small refactor
Signed-off-by: anandrkskd <anandrkskd@gmail.com>
* update functional tests to use proxy
Signed-off-by: anandrkskd <anandrkskd@gmail.com>
Signed-off-by: anandrkskd <anandrkskd@gmail.com>
* Add support for ODO_TRACKING_CONSENT env variable
Co-authored-by: Armel Soro <asoro@redhat.com>
* Replace deprecated 'ODO_DISABLE_TELEMETRY' env var with 'ODO_TRACKING_CONSENT' in integration tests
* Log environment of process launched with 'helper_run' in integration tests
`odo` behavior might be altered based on certain environment variables.
So this is to help debug future issues that might happen.
Because the process environment also contains the
current OS environment, we purposely limit the content
to variables prefixed with 'ODO_' or particular ones
(like 'TELEMETRY_CALLER').
* Test conflicting situations when using both 'ODO_DISABLE_TELEMETRY' and 'ODO_TRACKING_CONSENT'
* Disable golangci-lint 'staticcheck' check about using the deprecated 'segment.DisableTelemetryEnv'
However, due to [1], line-based directives do not seem to be working.
* Make ODO_TRACKING_CONSENT env var take precedence over the ConsentTelemetry preference
See [1] for more context.
[1] https://github.com/redhat-developer/odo/pull/6258\#issuecomment-1293736398
* Add new 'segment#isTrackingConsentEnabled' function, as suggested in review
This would make it easier to rename the values if needed or add aliases later.
* Add more unit test cases, especially when any of the telemetry var is not there in the env
* Document ODO_TRACKING_CONSENT
* fixup! Add new 'segment#isTrackingConsentEnabled' function, as suggested in review
* fixup! fixup! Add new 'segment#isTrackingConsentEnabled' function, as suggested in review
Co-authored-by: Tomas Kral <tkral@redhat.com>
* Add integration test cases highlighting the acceptance criteria
* Set the caller property for telemetry based on the 'TELEMETRY_CALLER' env var
Note that this property is set in telemetry even if it is not in the set
of allowed values, but does not prevent the odo command from running.
* Update documentation
* copy repo from ibmcloud instead of copying
Signed-off-by: anandrkskd <anandrkskd@gmail.com>
* suspend quarkus test
Signed-off-by: anandrkskd <anandrkskd@gmail.com>
* Speed up test execution on Windows with a shallow checkout instead of an 'scp'
'scp' happens to be a slow operation, because it is dependent on the network
and copies everything, including the full Git history checked out by the
IBM Cloud container.
The shallow clone/fetch allows to retrieve only the last commit in the
PR branch, rather than fetching the full Git history (which might take time
too).
Signed-off-by: anandrkskd <anandrkskd@gmail.com>
Co-authored-by: Armel Soro <asoro@redhat.com>
* 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>
* Show Kubernetes cluster version in odo version
Signed-off-by: Parthvi Vala <pvala@redhat.com>
* Fix for logged out clusters
Signed-off-by: Parthvi Vala <pvala@redhat.com>
* Not return error if oc fails
Signed-off-by: Parthvi Vala <pvala@redhat.com>
* rm3l's review
Signed-off-by: Parthvi Vala <pvala@redhat.com>
* Add runtime label based on metadata:language/projectType
* Add integration tests for odo dev
* odo deploy integration test
* Reverse priority between pojectType and language
Defining endpoints for Debug ports is required for Devfiles
to work properly with `odo dev --debug`.
This addresses the question of exposure for such endpoints.
Tools like DevSpaces currently set 'exposure: none' for debug endpoints.
This makes sense from the developer perspective,
as 'odo dev' aims at emulating a local developer machine.
As a consequence, `odo dev` should no longer ignore endpoints with
'exposure: none'. They should be port-forwarded just like other endpoints.
* Set character mode for input stream
* Move watchers in receiver + sync when p pressed
* Integration tests manual sync
* Add a console to DevSession
* Vendor
* Skip pressKey tests on Windows
* Add interactive test for p press
* Add info about pressing p key
* Doc
* Review
* Rephrase Manul sync
* Fix HotReloadCapable
* Document timers
* Document enableCharInput
* Document geyKey and getKeyWatcher functions
* Avoid to Kill in AfterEach after running Kill before
* No error/help display for JSON output
* Fix for subcommands
* Add integration tests
* Replace NoArgs with NoArgsAndSilenceJSON
* Add more tests, in a single It
* Use map for runningIn instead of array
* Set false entries in runningIn map
* Rename RunningModeList to RunningModes + fix doc
* Fix integration test
* Use ActiveState/termtest for interactive tests, which works with Windows
* Fix interactive tests to pass on Windows
* Fix windows tests script
* Set SKIP_WELCOMING_MESSAGES on Windowd tests
* No not resize terminal
* Kill previous odo processes
* Increase timeout for Expect()
* 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.
* Remove GetApplication from LocalConfigProvider interface and all related stuff
* Remove GetName from LocalConfigProvider interface and all related stuff
* Remove GetContainers from LocalConfigProvider interface
* Remove Exists method from LocalConfigProvider interface and stop odo dev writing env.yaml file
* Remove GetDebugort method from LocalConfigProvider interface + fix#6056
* Remove unnecessary fields from EnvInfo structure
* Remove all references to env.yaml file
* Review
* Test for #6056
* Do not read env.yaml file to get project
* Integration tests
* Remove GetNamespace() from interface to be sure to never call it
* Do not set project in env.yaml file for odo deploy
* Do not set project in dev.yaml file for odo deploy and dont expect it for delete component and build-images commands
* Remove project from env.yaml on dev cleanup
* - Message previously returned when no env.yaml file is now returned by NoDevfileError
- Return NoDevfileError when odo dev/deploy is started from empty directory
* Remove unnecessary params
* Add tests to test env.yaml with a non current project
* Fix noDevfileError when command does not specify componentContext
* Update messages and doc for `odo set namespace`
* Reverts part of c384f547cf
* Restart port forwarding on failure
* Save ports again when port forward is restarted
* Integration test
* Update pkg/portForward/portForward.go
Co-authored-by: Dharmit Shah <shahdharmit@gmail.com>
* Fix rebase
* Fix integration test with run composite command
* Copy errorhandlers
* Add timeout for first-time port forwarding
Co-authored-by: Dharmit Shah <shahdharmit@gmail.com>
* Enhance error message when user runs from a non-component directory
* Dharmit's review
* Use different messages
Signed-off-by: Parthvi Vala <pvala@redhat.com>