* Make UI not experimental
* Display API and UI URLs
* Remove link to old sources
* Fix integration tests
* Add UI to Usage Data
* Add a "Using the GUI to edit the Devfile" page to doc
* Add link to odo.dev specific page
* Apply suggestions from code review
Co-authored-by: Armel Soro <armel@rm3l.org>
* Change favicon with odo logo
* Display web console URL as part of the Dev status
* Update UI static files
* Document that Comments not supported
* Add UI screenshots
---------
Co-authored-by: Armel Soro <armel@rm3l.org>
* Pass odo context to api server
* Get /instance
* DELETE /instance implementation
* Move describe logic to pkg/component/describe
* Get /component implementation
* POST /component/command implementation
* Fix example by replacing action with name
* Fix integration test
* Integration tests
* Add comment for PushWatcher
* Test DELETE /instance without --no-watch
* Apply suggestions from code review
Co-authored-by: Armel Soro <armel@rm3l.org>
* Return an error if not ready for push
* Fix windows tests
* Fix tests for Windows
---------
Co-authored-by: Armel Soro <armel@rm3l.org>
* Add test highlighting the expectations
* Propagate errors and call os.Exit only in 'main' functions
See ExitInMain[1] and ExitInMain_ExitOnce[2] coding convention guidelines.
[1] https://github.com/redhat-developer/odo/wiki/Dev:-Coding-Conventions#exit-in-main
[2] https://github.com/redhat-developer/odo/wiki/Dev:-Coding-Conventions#exit-once
* Handle errors returned by Cleanuper#Cleanup
This makes sure the exit code of the command
is mapped onto any error returned by Cleanup
* Do not return an error when the watch loop in 'odo dev' is interrupted
* Test that the exit code of 'odo dev' matches the error returned by the cleanup logic
* Add unit test highliging the issue
* Fix 'delete' unit tests
* Pass the filesystem object where it is relevant
* Add a way for CLI commands to indicate whether of not they require a valid Devfile
For the 'analyze' command, this is not required,
so Devfile parsing will be ignored completely.
* Make the fake filesystem return an absolute current dir
Otherwise, some code will assume it is relative,
and try to prepend the current physical directory
* Add integration tests highlighting our expectations
* Bump Devfile library to latest commit
f041d79870
* Expose preference that allows users to globally configure an image registry
* Return the effective Devfile view by default from the initial context
This is supposed to be read-only, so that tools can rely on it
and to the operations they need to perform right away.
Raw Devfile objects can still be obtained upon request
if there is need to update them (for example via 'odo add/remove
binding' commands.
* Pass the image registry preference to the Devfile parser to build the effective view
* Fix 'odo init' integration tests
- The test spec was actually not doing what it was supposed to do
- Now 'odo init' returns a complete Devfile, where the parent is flattened,
because the goal of 'odo init' is to bootstrap a Devfile.
Previously, 'odo init' would not download the parent referenced,
making it hard to understand the resulting Devfile.
* Document how odo now handles relative image names as selectors
* fixup! Document how odo now handles relative image names as selectors
Co-authored-by: Philippe Martin <phmartin@redhat.com>
* Revert "Fix 'odo init' integration tests"
This reverts commit 78868b03fd.
Co-authored-by: Philippe Martin <phmartin@redhat.com>
* Do not make `odo init` return an effective Devfile as a result
This would change the behavior of `odo init`.
Furthermore, due to an issue [1] in the Devfile library,
it is not possible to parse some Devfiles with parents linked as GitHub URLs (like GitHub release artifacts).
[1] https://github.com/devfile/api/issues/1119
Co-authored-by: Philippe Martin <phmartin@redhat.com>
* fixup! Document how odo now handles relative image names as selectors
---------
Co-authored-by: Philippe Martin <phmartin@redhat.com>
* Same signature for reconcile in kubedev/podmandev
* Do not call initial reconcile
* Do not retry + filter deployment events
* Integration tests
* Move logs back to level 4
* Remove unnecessary files
* Log state + Set state to ready when build fails
* Get values from context
* Move Devfile param to WatchParams and biuld adapter only once
* Move pkg/devfile/adapters/kubernetes/* into pkg/dev/kubedev
* Rename Push to reconcile and split in 2 parts: components and innreloop
* Pass out ans errout as startOptions
* Embed StartOptions into PushParameters
* Embed StartOptions into WatchParameters
* Fix passing startoptions
* Deduplicate options (out, ...)
* Revert adding unwanted files
* Fix wait app ready
* Allow users to define custom port-mappings for port forwarding: add methods to parse and validate the flag
* Add methods to kube port-forwarding to obtain custom port pairs
Co-authored-by: Armel Soro <asoro@redhat.com>
Co-authored-by: Philippe Martin <phmartin@redhat.com>
* Pass custom port-mappings from CLI to Business layer
Co-authored-by: Armel Soro <asoro@redhat.com>
Co-authored-by: Philippe Martin <phmartin@redhat.com>
* Add integration test
Signed-off-by: Parthvi Vala <pvala@redhat.com>
* Add integration test for debug
Signed-off-by: Parthvi Vala <pvala@redhat.com>
* Add check for using --random-ports and --port-forward together
Signed-off-by: Parthvi Vala <pvala@redhat.com>
* Return all validation errors for --port-forward flag at once
Signed-off-by: Parthvi Vala <pvala@redhat.com>
* Use random local ports for integration testing
Signed-off-by: Parthvi Vala <pvala@redhat.com>
* Fix ci failures
Signed-off-by: Parthvi Vala <pvala@redhat.com>
* Print invalids of --port-forward to stderr so that they are printed when debugging
Signed-off-by: Parthvi Vala <pvala@redhat.com>
* Attempt at fixing the test failure on windows
Signed-off-by: Parthvi Vala <pvala@redhat.com>
Remove the use of seed for randomzing
Signed-off-by: Parthvi Vala <pvala@redhat.com>
* Use global counters for generate port number
Signed-off-by: Parthvi Vala <pvala@redhat.com>
* Apply changes from code review
Co-authored-by: Armel Soro <asoro@redhat.com>
---------
Signed-off-by: Parthvi Vala <pvala@redhat.com>
Co-authored-by: Armel Soro <asoro@redhat.com>
Co-authored-by: Philippe Martin <phmartin@redhat.com>
* Add sample Devfile with multiple autoBuild/deployByDefault combinations
It will be used for integration tests.
* Add helper function to update a given Devfile Command Group
This will allow supporting cases where we need to run a custom command,
but this is not implemented yet on odo (cases with 'odo dev --debug'
and 'odo deploy').
In this case, this helper will allow updating the Devfile for example to
unmark the current default command as non-default, and mark the custom
one as default.
* Add test cases for 'odo dev'
* Add test cases for 'odo deploy'
* Add test cases for 'odo build-images'
'odo build-images' should build all images regardless of the 'autoBuild' property.
* Display the spinner when creating or updating Kubernetes resources
This helps understand what resources are being patched.
* Handle deployByDefault on K8s and OpenShift components
* Add 'devfile.GetImageComponentsToPush' functions that returns the list of image components to auto-create
See https://github.com/devfile/api/issues/852#issuecomment-1211928487 for more context.
* Handle automatic image component creation for 'odo dev' on Kubernetes
* Handle automatic image component creation for 'odo dev' on Podman
* Handle automatic image and K8s/OpenShift component creation for 'odo deploy'
* Bump Devfile library to the latest commit at this time (c1b23d2)
This includes the fix for [1], which provides a way not to set default values automatically
[1] https://github.com/devfile/api/issues/1067
* Do not set default values when parsing a Devfile
See [1] for the rationale
[1] https://github.com/redhat-developer/odo/issues/5694\#issuecomment-1465778398
* Add documentation in the Devfile reference page
* Revert "Display the spinner when creating or updating Kubernetes resources"
This reverts commit 6ad073e63cb0e685f165eed767619a90997393a3.
* Avoid re-applying Image components multiple times
'adapter#Push' might get called several times when there are
state transitions (either on the Deployment in the cluster,
or from 'odo').
It might be confusing to apply Image components over and over again
(and also it can be slower if we need to push images to remote registries).
* Move GetK8sAndOcComponentsToPush and GetImageComponentsToPush to libdevfile package
As suggested in review, this should be the responsibility of the devfile library
Co-authored-by: Philippe Martin <phmartin@redhat.com>
* fixup! Handle automatic image and K8s/OpenShift component creation for 'odo deploy'
* fixup! Handle automatic image component creation for 'odo dev' on Podman
* fixup! Avoid re-applying Image components multiple times
* Apply suggestions from code review
Co-authored-by: Parthvi Vala <pvala@redhat.com>
* fixup! Do not set default values when parsing a Devfile
* Fix devfile-deploy-functional-pods.yaml (used in 'odo logs' tests)
Set deployByDefault to false on innerloop-pod component.
Otherwise, since it is not referenced by any apply command,
it will be automatically created by *both* 'odo dev' and 'odo deploy'.
---------
Co-authored-by: Philippe Martin <phmartin@redhat.com>
Co-authored-by: Parthvi Vala <pvala@redhat.com>
* Embed platform.Client interface in platform-specific interfaces
This avoids repeating the same methods in both interfaces,
and makes the intent clearer.
* Verify interface compliance of PodmanCli at compile time
This is recommended in the Coding Conventions guidelines [1].
Specifically, what's important here is checking that it meets the 'platform.Client' contract.
[1] https://github.com/redhat-developer/odo/wiki/Dev:-Coding-Conventions#verify-interface-compliance
* Move K8s-specific implementation of port-forwarding to a dedicated package
This paves the way to providing a different implementation for Podman
* Remove GetPortsToForward method from the portForward.Client interface
Current implementation relies on the Devfile object,
so it makes more sense to be in the libdevfile package.
* Monitor and send appropriate status events after starting a remote command process
This allows callers to get more meaningful events about the process.
* Implement port-forwarding logic on Podman
As explained in [1], this makes use of a helper sidecar container
(aptly named "odo-helper-port-forwarding") to be added to the Pod Spec created by odo.
In this scope, port-forwarding will be equivalent of executing a socat command in this
helper container, like so:
socat -d tcp-listen:20002,reuseaddr,fork tcp:localhost:5858
In the command above, this will open up port 20001 on the helper container,
and forwarding requests to localhost:5858
(which would be in the application container, part of the same Pod)
[1] https://github.com/redhat-developer/odo/issues/6510
* Update portForward.Client interface methods
Specifically, the 'StartPortForwarding' method
can now accept an explicit list of ports that needs to
be forwarded, if the caller can compute provide such information.
This is currently useful on Podman where the ports
(even the random ones) are known in advance.
* Add helper sidecar container to the Pod Spec generated on Podman
As explained in [1], this helper sidecar container (aptly named "odo-helper-port-forwarding")
will hold the actual container/host ports mapping in the spec
(to overcome the limitation of using hostPort against a container app listening on the loopback interface);
this running container will be used to execute the actual port-forwarding commands (based on socat), e.g:
```
apiVersion: v1
kind: Pod
metadata:
name: my-component-app
labels:
app: my-component-app
spec:
containers:
- name: runtime
command: [ 'tail', '-f', '/dev/null']
# Omitted for brevity, but imagine an application being executed by odo
# and listening on both 0.0.0.0:3000 and 127.0.0.1:5858
- name: odo-helper-port-forwarding
image: quay.io/devfile/base-developer-image:ubi8-latest
command: [ 'tail', '-f', '/dev/null']
ports:
- containerPort: 20001
# A command will be executed by odo, e.g.: 'socat -d -d tcp-listen:20001,reuseaddr,fork tcp:localhost:3000'
hostPort: 20001
- containerPort: 20002
# A command will be executed by odo, e.g.: 'socat -d -d tcp-listen:20002,reuseaddr,fork tcp:localhost:5858'
hostPort: 20002
# ... Omitted for brevity
```
In this scope, port-forwarding from 20002 to 5858 for example will be equivalent of executing
a socat command in this helper container, like so:
socat -d tcp-listen:20002,reuseaddr,fork tcp:localhost:5858
In the command above, this will open up port 20001 on the helper container,
and forwarding requests to localhost:5858
(which would be in the 'runtime' container, part of the same Pod)
[1] https://github.com/redhat-developer/odo/issues/6510
* Inject the right portForward client depending on the platform
* Delegate port-forwarding on Podman to the appropriate client
* Implement --forward-localhost on Podman
* Add unit and integration test cases
* Cover more debug-related test cases on Podman
* Expose the endpoint protocol so as to instruct socat to listen and forward the right protocol
* Fix sub-deps of EXEC and PORT_FORWARD, as suggested in review
* Add functions allowing to detect ports opened in a given container
Specifically, this will be useful in Podman to detect
applications that are bound to the loopback interface
* Make `odo dev` fail on Podman if we detect that the application is bound to the loopback interface (on any ports supposed to be forwarded)
Next step will be to provide an option for end-users
to override this behavior, by either:
- ignoring this error (--ignore-localhost);
- or explicitly adding a redirect via a side container (--forward-localhost)
More context in https://github.com/redhat-developer/odo/issues/6510#issuecomment-1439986558
* Add '--ignore-localhost' flag to 'odo dev' on Podman
Currently, `odo dev` on Podman will error out
if it detects that the application is listening on the container loopback interface.
Instead of erroring out, this flag allows users to ignore such failure; a warning will be displayed anyway if
the application is listening on the container loopback interface, but odo will not error out.
Ports will be marked as forwarded, but Podman might fail to redirect traffic to the application
if it is bound to this loopback interface.
* Add test cases
* Fix existing integration tests by passing --ignore-localhost on Podman
- odo describe component
- odo dev --debug
Some projects used there are listening to the loopback interface,
so they won't work on Podman unless --ignore-localhost is passed.
Next, we'll pass --forward-localhost when it is implemented,
so we can have a fully working project with port-forwarding.
* Extract logic for handling loopback ports in a separate method
Requested in review
* Refactor 'libdevfile#GetContainerEndpointMapping' so it returns the whole Endpoint struct
It will help extract useful information like the port name and exposure.
* Fix typo in parameter name (in portForward#Client interface)
* Display the port names in the output of 'odo describe component'
* Display the port exposures in the output of 'odo describe component'
* Tell whether the port is a debug one or not in the output of 'odo describe component'
* Add integration tests meeting the expectations
* Update documentation
* 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>
* Call WatchAndPush
* NoOpWatcher for Kube-related watchers + Move cleanup to dedicated method
* Set component state
* Call reconcile again when files changed
* Fix prompt message
* Integration test for podman/sync file
* More integration tests
* Move display of forwarded ports after application started
* Add runOn flag
* Instantiate Kube/Podman DevClient instance according to runOn flag
* Start and stop Podman Pod
* Unit tests for createPodFromComponent
* podman mode runs without Kube config
* Fix tests + rebase
* Add sync and exec clients to podman dev
* tbc: call sync
* Remove unnecessary kclient dependency from exec client
* Inject podman client
* Implement ExecCMDInContainer for podman client
* Move [gG]etFirstContainerWithSourceVolume to dev/common package and use it for Podman
* TBC: execute build/run commands
* Fix rebase
* Fix unit test
* Comments for refacto
* Prepare implementation of Platform
* Use ExecuteRunCommand for run handler
* Do not pass parameters present in context
* Move back instanciation of devclient to clientset package
* Move CleanupDevResources method from Watch to Dev package
* CleanupResources: Do not pass parameters present in context
* Fix deleting volumes at exit time
* Check volumes do not exist
* Add support for postStart event
* Make odo dev work when no cluster is configured
* Review
* Add more TODOs
* User interface
* More info on ExitError errors
* Display forwarded ports in output and devstate file
* Add tests for forwarded ports
* Create .odo when necessary
* Add keyboard commands message
* Add doc on podman platform
* Define central config
* Use envConfig in GenericRun for segment parameters
* Pass the env config into the context passed to CLI methods
* Use PodmanCmd and DockerCmd from context
* Remove tests now that ODO_DISABLE_TELEMETRY is checked for a bool value
* deploy.Deploy: Use values from ctx instead of parameters + use FS from DI
* dev.Start: Use values from ctx instead of parameters
* image.Build*: Use values from ctx instead of parameters
* Use telemetry file from context
* Pass ctx to segment.getTelemetryForDevfileRegistry
* Use ctx in getTelemetryForDevfileRegistry
* Call IsTelemetryEnabled once and use scontext.GetTelemetryStatus after
* Fix unit tests
* Use envConfig in segment.IsTelemetryEnabled
* Define TelemetryCaller constant in test helper
* IsTrackingConsentEnabled: get value from envconfig instead of env
* Use ctx instead of GLOBALODOCONFIG
* Place ODO_EXPERIMENTAL_MODE in configuration
* Use maintained envconfig package
* Define default values when exist
* Document accepted boolean values
* 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
* 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
* 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
* 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
* Do not use receiver to pass DevfileCommands parameters
* Do not use receiver to pass DebugPort parameter
* Do not use receiver to pass deployment parameter
* Do not use receiver to pass pod parameter
* Move randomPorts and errOut as PushParameters
* Remove dependency on common.AdapterContext for sync.Adapter
* Simplify adapters.NewComponentAdapter
* NewComponentAdapter accepts kubernetes.KubernetesContext instead of interface{}
* Replace KubernetesContext with its only field Namespace
* Move the Push Interface and builders to the kubernetes.component package
* Move AdapterContext to kubernetes.component package
* Embeds component.New into NewKubernetesAdapter
* Move GetCommandsMap where it is used
* Move GetSyncFilesFromAttributes where it is used
* Move constants where they are used
* Move types to adapters package
* Update pkg/devfile/adapters/kubernetes/component/adapter.go
Co-authored-by: Armel Soro <armel@rm3l.org>
Co-authored-by: Armel Soro <armel@rm3l.org>
* 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>
* Save state (forwarded ports + PID + timestamp) to local file and cleanup
* Integration tests
* Documentation
* Update docs/website/versioned_docs/version-3.0.0/command-reference/dev.md
Co-authored-by: Armel Soro <armel@rm3l.org>
* Fail when an error happens writing state file
In case of error during initialization, odo dev cleanup the resources
* Fix typo
* Test localPort matches a number
* Remove PID and timestamp from state + rename to devstate.json
* Run IBM cloud tests as non root
* Fix doc
* Review
* Remove reference to PID/timestamp from doc
Co-authored-by: Armel Soro <armel@rm3l.org>
* odo dev --debug
* Integration tests
* validate commands
* Fix rebase
* Review: Add integration test
* Modify error message when run/debug commands are not found in devfile
* Adds `odo dev --no-watch`
* Remove select for a single case
More details on - https://github.com/dominikh/go-tools/issues/503#issuecomment-497020529
* Update mocks
* Update tests/integration/devfile/cmd_dev_test.go
Co-authored-by: Armel Soro <armel@rm3l.org>
* Rename CleanupFunc to Cleanup
* Add usage doc for --no-watch
* Remove infinite for loop
Co-authored-by: Armel Soro <armel@rm3l.org>
* Cleans up innerloop resources upon Ctrl+c
* Remove cleanup method from dev interface
* Self review
* Remove ImagePullPolicy change
* Print message about resource deletion
* Fixes issue of multiple push for single event
Fixes#5532
Takes idea from https://github.com/fsnotify/fsnotify/issues/122#issuecomment-1065925569
* Self review and trim WatchParameters
* Rollback parameters useful for unit tests, and changes to unit tests
* Define context early in dev
* Use delete client to delete resources from cluster
* Update pkg/odo/cli/dev/dev.go
Co-authored-by: Philippe Martin <contact@elol.fr>
* Update pkg/odo/cli/dev/dev.go
Co-authored-by: Philippe Martin <contact@elol.fr>
* Update pkg/watch/watch.go
Co-authored-by: Philippe Martin <contact@elol.fr>
* Update pkg/watch/watch.go
Co-authored-by: Philippe Martin <contact@elol.fr>
* Removed unnecessary return statement
* Don't error in Telemetry for every Ctrl+c
* Refactors watch and push logic
* Run mockgen.sh script
* Fixes message on stdout
* Removes function re-added due to rebase mistake
* PR review and unit tests failure
* Unit tests & integration tests
* Use constants defined in the file
* More refactoring of watch package, and unit tests
* PR review and change tests to suit changed behaviour
* Prints appropriate message upon user interrupt
* Add comment for evaluateChangesFunc, remove irrelevant comments from
watch_test.go
Co-authored-by: Philippe Martin <contact@elol.fr>
* 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