* Implement HTTP Server based on OpenAPI spec
Signed-off-by: Parthvi Vala <pvala@redhat.com>
Co-authored-by: Armel Soro <asoro@redhat.com>
Co-authored-by: Philippe Martin <phmartin@redhat.com>
* Starter server when odo dev starts
Signed-off-by: Parthvi Vala <pvala@redhat.com>
* Add --api-server and --api-server-port flags to start API Server; write the port to stat file; TODO: make this feature experimental
Signed-off-by: Parthvi Vala <pvala@redhat.com>
Co-authored-by: Armel Soro <asoro@redhat.com>
Co-authored-by: Philippe Martin <phmartin@redhat.com>
Signed-off-by: Parthvi Vala <pvala@redhat.com>
Make the flag experimental
Signed-off-by: Parthvi Vala <pvala@redhat.com>
Make apiserver and apiserverport flag local
Signed-off-by: Parthvi Vala <pvala@redhat.com>
* Use container image to run openapi-generator-tool instead of a local CLI
Co-authored-by: Armel Soro <asoro@redhat.com>
Signed-off-by: Parthvi Vala <pvala@redhat.com>
* Add integration test
Signed-off-by: Parthvi Vala <pvala@redhat.com>
* Use label podman
Signed-off-by: Parthvi Vala <pvala@redhat.com>
* Regenerate the api files with openapitool v6.6.0 and changes from review
Signed-off-by: Parthvi Vala <pvala@redhat.com>
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>
* Use GetPodTemplateSpec instead of deprecated GetContainers
* Specify pod admission policy when building Exec Job
* Integration test
* Update tests/helper/component_podman.go
Co-authored-by: Armel Soro <armel@rm3l.org>
* add test
---------
Co-authored-by: Armel Soro <armel@rm3l.org>
* Rename pkg/odo/commonflags/run_on.go to pkg/odo/commonflags/platform.go and change runOn to platform
* Rename feature
* Rename into pkg/odo/commonflags/context/
* Update comments
* Update doc
* fix comment
* Update integration tests
* Duplicate runningOn field with platform + deprecated runningOn
* Mark RunningOn as Deprecated
* Do not modify blog post
* Fix typo
* Add exception for SA1019
* odo describe component
* Fix integration tests for odo describe component
* 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>
* 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