New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding error handling #3278
Adding error handling #3278
Conversation
@@ -150,7 +150,9 @@ func Deploy(ctx context.Context) *cobra.Command { | |||
if err != nil { | |||
return err | |||
} | |||
nsCmd.Create(ctx, &namespace.CreateOptions{Namespace: okteto.Context().Namespace}) | |||
if err := nsCmd.Create(ctx, &namespace.CreateOptions{Namespace: okteto.Context().Namespace}); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be returning an error here, we will fail later on because the ns doesn't exist
@@ -155,7 +155,9 @@ func getNamespacesSelection(ctx context.Context) ([]utils.SelectorItem, error) { | |||
|
|||
func askForOktetoNamespace() string { | |||
var namespace string | |||
oktetoLog.Question("Enter the namespace you want to use: ") | |||
if err := oktetoLog.Question("Enter the namespace you want to use: "); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same with this one. If we can't throw a question we should return the proper error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I go for oktetoLog.Errorf()
here since the func doesn't return an error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's modify the function signature to func askForOktetoNamespace() (string, error)
@@ -99,7 +99,9 @@ func (c *DeployCommand) RunDeploy(ctx context.Context, s *model.Stack, options * | |||
if err != nil { | |||
return err | |||
} | |||
nsCmd.Create(ctx, &namespace.CreateOptions{Namespace: s.Namespace}) | |||
if err := nsCmd.Create(ctx, &namespace.CreateOptions{Namespace: s.Namespace}); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be returning an error here, we will fail later on because the ns doesn't exist
oktetoLog.Question(fmt.Sprintf("%s %s: ", q, d)) | ||
_, err := fmt.Scanln(&answer) | ||
if err != nil && err.Error() != "unexpected newline" { | ||
if err := oktetoLog.Question(fmt.Sprintf("%s %s: ", q, d)); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same with this one. If we can't throw a question we should return the proper error
Should I go ahead and add err handling here too? |
Yes, please |
Using OktetoLog here causes an Should I instead return |
Not tackling this one atm since we're changing the |
Yes, we should return |
@abs007 could you update the PR resolving conflicts? |
@jLopezbarb Sure. Is it alright if I get to it day after tomorrow? My exams are ending on the 10th. |
No worries @abs007. I wish you the best of luck in your exam 💪 |
Thank you :) |
Unit test are failing. Could you review it @abs007 @AgustinRamiroDiaz, since you reviewed and asked for changes, could you verify that everything is ready |
It seems like |
@abs007 That looks like a problem in the test 👀 . We should try to fix the test in those cases. For future reference, okteto log is what we use to display logs to the user when running the commands. We shouldn't be using it in the tests Edit: @abs007 to fix the issue in build_test.go line 120 try using |
@abs007 After some headscratches I've found how to fix the issue in build_test.go line 375: The first part is very similar to what you've done, except that you need to add if tt.dockerfilesCreated != nil {
for _, df := range tt.dockerfilesCreated {
df := df
dfFile, err := os.Create(df)
require.NoError(t, err)
log.Printf("created docker file: %s", df)
require.NoError(t, dfFile.Close())
defer func() {
require.NoError(t, removeFile(df))
}()
}
} And then at the end of the test you should remove if tt.dockerfilesCreated != nil {
for _, df := range tt.dockerfilesCreated {
removeFile(df)
}
} If you think that this is too much, you can fix the rest and leave this to us :D |
So, in the example that they mention: While using And, having
It's all right really. This is an interesting problem. |
@abs007 exactly. The |
Got it. Also, we're removing the code at the end because it's duplicated? I'm also removing all the |
@abs007 Exactly!
@abs007 Totally! That's the way we want to go with unit testing 🧪 Once you are done with your changes, remember to fix the merge conflicts ( |
Signed-off-by: Abhisman Sarkar <abhisman.sarkar@gmail.com>
Fyi, I'm working on the merge conflicts. |
Signed-off-by: Abhisman Sarkar <abhisman.sarkar@gmail.com>
Signed-off-by: Abhisman Sarkar <abhisman.sarkar@gmail.com>
Signed-off-by: Abhisman Sarkar <abhisman.sarkar@gmail.com>
Signed-off-by: Abhisman Sarkar <abhisman.sarkar@gmail.com>
@@ -545,7 +545,9 @@ func isAnyPortAvailable(ctx context.Context, svc *model.Service, stack *model.St | |||
continue | |||
} | |||
} | |||
forwarder.Start(podName, stack.Namespace) | |||
if err := forwarder.Start(podName, stack.Namespace); err != nil { | |||
oktetoLog.Infof("could not start port-forward: %s", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jLopezbarb should we continue
here as we do with the other errors?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is just a healthcheck while deploying an stack. We can't fail for a healtcheck and wait until the backofflimit is reached
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oktetoLog.Infof("could not start port-forward: %s", err) | |
oktetoLog.Infof("could not start port-forward: %s", err) | |
continue |
@abs007 👀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@abs007 Awesome improvements to the codebase 💪
Signed-off-by: Abhisman Sarkar <abhisman.sarkar@gmail.com>
Thanks @AgustinRamiroDiaz 😊. Was fun solving those merge conflicts too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work 💯
@@ -545,7 +545,9 @@ func isAnyPortAvailable(ctx context.Context, svc *model.Service, stack *model.St | |||
continue | |||
} | |||
} | |||
forwarder.Start(podName, stack.Namespace) | |||
if err := forwarder.Start(podName, stack.Namespace); err != nil { | |||
oktetoLog.Infof("could not start port-forward: %s", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oktetoLog.Infof("could not start port-forward: %s", err) | |
oktetoLog.Infof("could not start port-forward: %s", err) | |
continue |
@abs007 👀
@AgustinRamiroDiaz But isn't that line out of the for loop? |
Oh you are right 🤔 Maybe we should return Thanks a lot for your contribution 🥇 |
* Added error handling (1) Signed-off-by: Abhisman Sarkar <abhisman.sarkar@gmail.com> * Added error handling (2) Signed-off-by: Abhisman Sarkar <abhisman.sarkar@gmail.com> * Added error handling (3) Signed-off-by: Abhisman Sarkar <abhisman.sarkar@gmail.com> * Used the require package on all test files Signed-off-by: Abhisman Sarkar <abhisman.sarkar@gmail.com> * Updated use of require package and golangci.yml Signed-off-by: Abhisman Sarkar <abhisman.sarkar@gmail.com> * Added suggestions Signed-off-by: Abhisman Sarkar <abhisman.sarkar@gmail.com> --------- Signed-off-by: Abhisman Sarkar <abhisman.sarkar@gmail.com>
* feat: add image to manifest Signed-off-by: Javier López Barba <javier@okteto.com> * refactor: split deploy between remote and local Signed-off-by: Javier López Barba <javier@okteto.com> * fix: deploy refactor conflicts Signed-off-by: Javier López Barba <javier@okteto.com> * fix: tests Signed-off-by: Javier López Barba <javier@okteto.com> * add remote deploy Signed-off-by: adripedriza <adripedriza@gmail.com> * add remote deploy Signed-off-by: adripedriza <adripedriza@gmail.com> * remove debug logs Signed-off-by: adripedriza <adripedriza@gmail.com> * refactor remote deploy Signed-off-by: adripedriza <adripedriza@gmail.com> * Jlopezbarb/remote-deploy-logs (#3335) * feat: add build env vars Signed-off-by: Javier López Barba <javier@okteto.com> * feat: add buildkit progress Signed-off-by: Javier López Barba <javier@okteto.com> * fix: executor shell Signed-off-by: Javier López Barba <javier@okteto.com> * feat: remote fixes Signed-off-by: Javier López Barba <javier@okteto.com> * fix: add path Signed-off-by: Javier López Barba <javier@okteto.com> Signed-off-by: Javier López Barba <javier@okteto.com> * refactor remote deploy (#3337) * use remote builder instead builder v1 Signed-off-by: adripedriza <adripedriza@gmail.com> * add integration test for remote deploy Signed-off-by: adripedriza <adripedriza@gmail.com> * forward deploy flags to remote Signed-off-by: adripedriza <adripedriza@gmail.com> * remove unnecessary forwarded flags Signed-off-by: adripedriza <adripedriza@gmail.com> * deploy remote using default okteto cli image Signed-off-by: adripedriza <adripedriza@gmail.com> * refactor logs for remote deploy Signed-off-by: adripedriza <adripedriza@gmail.com> * refactor logs for remote deployment Signed-off-by: adripedriza <adripedriza@gmail.com> * refactor remote checker Signed-off-by: adripedriza <adripedriza@gmail.com> Signed-off-by: adripedriza <adripedriza@gmail.com> * refactor: move common code to deploy (#3338) Signed-off-by: Javier López Barba <javier@okteto.com> Signed-off-by: Javier López Barba <javier@okteto.com> * add dockerignore as part of remote deploy (#3339) * add dockerignore as part of remote deploy Signed-off-by: adripedriza <adripedriza@gmail.com> * fix test Signed-off-by: adripedriza <adripedriza@gmail.com> * fix: unit tests Signed-off-by: Javier López Barba <javier@okteto.com> * refactor test Signed-off-by: adripedriza <adripedriza@gmail.com> Signed-off-by: adripedriza <adripedriza@gmail.com> Signed-off-by: Javier López Barba <javier@okteto.com> Co-authored-by: Javier López Barba <javier@okteto.com> * fix: remove logger while deploying commnad Signed-off-by: Javier López Barba <javier@okteto.com> * Add fixes for remote deploy (#3344) * refactor: use constants instead of magic strings Signed-off-by: Javier López Barba <javier@okteto.com> * feat: add helm and kubectl always to remote container Signed-off-by: Javier López Barba <javier@okteto.com> * feat: update kubectl and helm dependencies Signed-off-by: Javier López Barba <javier@okteto.com> * fix: windows path bug Signed-off-by: Javier López Barba <javier@okteto.com> * refactor: rename oktetoCLI image for remote Signed-off-by: Javier López Barba <javier@okteto.com> * feat: deploy on remote creates configmaps stages Signed-off-by: Javier López Barba <javier@okteto.com> * fix: unit tests Signed-off-by: Javier López Barba <javier@okteto.com> * refactor: add comments Signed-off-by: Javier López Barba <javier@okteto.com> * docs: add comment Signed-off-by: Javier López Barba <javier@okteto.com> Signed-off-by: Javier López Barba <javier@okteto.com> * fix: update images Signed-off-by: Javier López Barba <javier@okteto.com> * Fix remote deploy image empty (#3349) * fix: set err status in cfmap Signed-off-by: Javier López Barba <javier@okteto.com> * fix: image not set in serializer Signed-off-by: Javier López Barba <javier@okteto.com> * fix: remote deployment Signed-off-by: Javier López Barba <javier@okteto.com> * fix: unit tests Signed-off-by: Javier López Barba <javier@okteto.com> Signed-off-by: Javier López Barba <javier@okteto.com> * Update "synchronizing" spinner Signed-off-by: Pablo Chico de Guzman <pchico83@gmail.com> * improve spinner for remote deploy (#3373) * get current transferring context from buildkit Signed-off-by: adripedriza <adripedriza@gmail.com> * spinner improvements Signed-off-by: adripedriza <adripedriza@gmail.com> * show info if context > 50MB Signed-off-by: adripedriza <adripedriza@gmail.com> --------- Signed-off-by: adripedriza <adripedriza@gmail.com> * add destroy in remote (#3379) * exec in remote if deploy.image defined or --remote flag Signed-off-by: adripedriza <adripedriza@gmail.com> * do not set default value for deploy.image Signed-off-by: adripedriza <adripedriza@gmail.com> * add destroy as remote Signed-off-by: adripedriza <adripedriza@gmail.com> * print logs from detroy remote Signed-off-by: adripedriza <adripedriza@gmail.com> * add --remote flag Signed-off-by: adripedriza <adripedriza@gmail.com> * fix remote destroy when no destroy section declared * fix: add certs to remote destroy template Same as with cmd/deploy/remote.go https://github.com/okteto/okteto/blob/0bd4162c3d8e5e17064b797cc241ddd7db65d79a/cmd/deploy/remote.go#L48 * fix tests Signed-off-by: adripedriza <adripedriza@gmail.com> * add deploy commands to remote Signed-off-by: adripedriza <adripedriza@gmail.com> * update test to not assume deploy.image need to be set Signed-off-by: adripedriza <adripedriza@gmail.com> * remove worthless comment Signed-off-by: adripedriza <adripedriza@gmail.com> * refactor destroy command Signed-off-by: adripedriza <adripedriza@gmail.com> * remote deploy/destroy improvements (#3393) * expand envs for image used in remote deploy Signed-off-by: adripedriza <adripedriza@gmail.com> * remove unnecessary consts Signed-off-by: adripedriza <adripedriza@gmail.com> * update dockerignore name for destroy Signed-off-by: adripedriza <adripedriza@gmail.com> --------- Signed-off-by: adripedriza <adripedriza@gmail.com> * add e2e test for destroy remote Signed-off-by: adripedriza <adripedriza@gmail.com> * addressing feedback Signed-off-by: adripedriza <adripedriza@gmail.com> * remove injected getDestroyer func Signed-off-by: adripedriza <adripedriza@gmail.com> * addressing feedback Signed-off-by: adripedriza <adripedriza@gmail.com> --------- Signed-off-by: adripedriza <adripedriza@gmail.com> Co-authored-by: jpf-okteto <92427625+jpf-okteto@users.noreply.github.com> * feat: add support for custom commands in `okteto up` (#3215) * Allow acceptance of custom commands in 'okteto up' Signed-off-by: Abhisman Sarkar <abhisman.sarkar@gmail.com> * Pass commands to dev.Commands.Values Signed-off-by: Abhisman Sarkar <abhisman.sarkar@gmail.com> * Added option to check for services Signed-off-by: Abhisman Sarkar <abhisman.sarkar@gmail.com> * Added tests and a log for debugging Signed-off-by: Abhisman Sarkar <abhisman.sarkar@gmail.com> * Removed unused Devs field from UpOptions Signed-off-by: Abhisman Sarkar <abhisman.sarkar@gmail.com> * Extended testing functionality Signed-off-by: Abhisman Sarkar <abhisman.sarkar@gmail.com> * Handling empty slices Signed-off-by: Abhisman Sarkar <abhisman.sarkar@gmail.com> * Reverted AddArgs() changes and added 'command' as a flag Signed-off-by: Abhisman Sarkar <abhisman.sarkar@gmail.com> * Added unit test for the 'command' flag Signed-off-by: Abhisman Sarkar <abhisman.sarkar@gmail.com> Signed-off-by: Abhisman Sarkar <abhisman.sarkar@gmail.com> * Check deployed dev environments when inferring the name (#3300) * Fixes #3276. Added flag --name to logs command and moved utils.InferName to a new package Signed-off-by: Ignacio Fuertes <nacho@okteto.com> * Added logic to loop over the dev environments when infering dev environment name Signed-off-by: Ignacio Fuertes <nacho@okteto.com> * Restore original version of InferName and name it DeprecatedInferName. Also, rename LoadManifest and LoadManifestOrDefault to DeprecatedLoadManifest and DeprecatedLoadManifestOrDefault as they are being used by deprecated code that will be deleted on next major version and shouldn't be used anymore Signed-off-by: Ignacio Fuertes <nacho@okteto.com> * Refactored to make InferName function testable and include unit tests for it Signed-off-by: Ignacio Fuertes <nacho@okteto.com> * Added a comment in getStackName function to clarify the behavior and added a debug log when the name is inferred from a deployed dev environment Signed-off-by: Ignacio Fuertes <nacho@okteto.com> * Address deep source errors and removed a comment about the manifest path for endpoints command. It seems the current one is right Signed-off-by: Ignacio Fuertes <nacho@okteto.com> * Added logic to okteto pipeline deploy and destroy as they were not using directly InferName. I created another function with some common behavior to be called from those commands Signed-off-by: Ignacio Fuertes <nacho@okteto.com> * Changed level of a log message when interring the name Signed-off-by: Ignacio Fuertes <nacho@okteto.com> * Added copyright to name.go file Signed-off-by: Ignacio Fuertes <nacho@okteto.com> Signed-off-by: Ignacio Fuertes <nacho@okteto.com> * fix: add markdown reading (#3332) Signed-off-by: adripedriza <adripedriza@gmail.com> Signed-off-by: adripedriza <adripedriza@gmail.com> * Add parameter for pass thru of allowPrivilegeEscalation (#3291) (#3292) * Add parameter for pass thru of allowPrivilegeEscalation (#3291) Signed-off-by: Dave Chesnut <7511912+skikd636@users.noreply.github.com> * Added unit tests for #3291 Signed-off-by: Dave Chesnut <7511912+skikd636@users.noreply.github.com> Co-authored-by: Chesnut, Dave (IMS) <chesnutd@imsweb.com> * build(deps): Bump actions/stale from 6 to 7 (#3306) Bumps [actions/stale](https://github.com/actions/stale) from 6 to 7. - [Release notes](https://github.com/actions/stale/releases) - [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md) - [Commits](actions/stale@v6...v7) --- updated-dependencies: - dependency-name: actions/stale dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps): Bump mheap/github-action-required-labels from 2 to 3 (#3319) Bumps [mheap/github-action-required-labels](https://github.com/mheap/github-action-required-labels) from 2 to 3. - [Release notes](https://github.com/mheap/github-action-required-labels/releases) - [Commits](mheap/github-action-required-labels@v2...v3) --- updated-dependencies: - dependency-name: mheap/github-action-required-labels dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Added labelSelector to configmap lists at waitForNamespaceD… (#3329) * refactor: added labelSelector to configmap lists at waitForNamespaceDestroyAllToComplete Signed-off-by: Teresa Romero <teresa@okteto.com> * refactor: check if multiple labels at cfmaps Signed-off-by: Teresa Romero <teresa@okteto.com> Signed-off-by: Teresa Romero <teresa@okteto.com> * fix deploy when field notes not given to external (#3347) * fix deploy when field notes not given to external Signed-off-by: adripedriza <adripedriza@gmail.com> * refactor test Signed-off-by: adripedriza <adripedriza@gmail.com> Signed-off-by: adripedriza <adripedriza@gmail.com> * build(deps): Bump github.com/containerd/containerd from 1.5.8 to 1.5.16 (#3346) Bumps [github.com/containerd/containerd](https://github.com/containerd/containerd) from 1.5.8 to 1.5.16. - [Release notes](https://github.com/containerd/containerd/releases) - [Changelog](https://github.com/containerd/containerd/blob/main/RELEASES.md) - [Commits](containerd/containerd@v1.5.8...v1.5.16) --- updated-dependencies: - dependency-name: github.com/containerd/containerd dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Wait for cronjobs to finish the execution of their jobs (#3351) Signed-off-by: Pablo Chico de Guzman <pchico83@gmail.com> Signed-off-by: Pablo Chico de Guzman <pchico83@gmail.com> * add possible values for icon for external resource (#3350) * add possible values for icon for external resource Signed-off-by: adripedriza <adripedriza@gmail.com> * validate k8s external resource against backend Signed-off-by: adripedriza <adripedriza@gmail.com> * addressing deepsource Signed-off-by: adripedriza <adripedriza@gmail.com> Signed-off-by: adripedriza <adripedriza@gmail.com> * fix zero value for external icon field (#3356) * fix test Signed-off-by: adripedriza <adripedriza@gmail.com> * fix: add omitempty to not set zero value as final value Signed-off-by: adripedriza <adripedriza@gmail.com> Signed-off-by: adripedriza <adripedriza@gmail.com> * build(deps): Bump github.com/opencontainers/runc from 1.0.2 to 1.1.2 (#3345) Bumps [github.com/opencontainers/runc](https://github.com/opencontainers/runc) from 1.0.2 to 1.1.2. - [Release notes](https://github.com/opencontainers/runc/releases) - [Changelog](https://github.com/opencontainers/runc/blob/main/CHANGELOG.md) - [Commits](opencontainers/runc@v1.0.2...v1.1.2) --- updated-dependencies: - dependency-name: github.com/opencontainers/runc dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Removed dependency from github.com/rancher/wrangler library. It was being only used to create a noop rate limiter in a specific case and the library was reporting a vulnerability, so I created a local noop rate limiter satisfying the needed interface to be able to remove that dep (#3361) Signed-off-by: Ignacio Fuertes <nacho@okteto.com> Signed-off-by: Ignacio Fuertes <nacho@okteto.com> * add external url to okteto env file (#3354) * add okteto env file to set for external urls dynamically Signed-off-by: adripedriza <adripedriza@gmail.com> * overwritte external url if required Signed-off-by: adripedriza <adripedriza@gmail.com> * addressing deepsource Signed-off-by: adripedriza <adripedriza@gmail.com> * fix: add fake filesystem Signed-off-by: adripedriza <adripedriza@gmail.com> * fix test: add fake filesystem Signed-off-by: adripedriza <adripedriza@gmail.com> * addressing deepsource Signed-off-by: adripedriza <adripedriza@gmail.com> * refactor use OKTETO_ENV file Signed-off-by: adripedriza <adripedriza@gmail.com> * addressing deepsource Signed-off-by: adripedriza <adripedriza@gmail.com> * refactor okteto env file use Signed-off-by: adripedriza <adripedriza@gmail.com> --------- Signed-off-by: adripedriza <adripedriza@gmail.com> * Added HasRevese property on the metadata we send to metrics on okteto up command (#3369) Signed-off-by: Ignacio Fuertes <nacho@okteto.com> * Adding error handling (#3278) * Added error handling (1) Signed-off-by: Abhisman Sarkar <abhisman.sarkar@gmail.com> * Added error handling (2) Signed-off-by: Abhisman Sarkar <abhisman.sarkar@gmail.com> * Added error handling (3) Signed-off-by: Abhisman Sarkar <abhisman.sarkar@gmail.com> * Used the require package on all test files Signed-off-by: Abhisman Sarkar <abhisman.sarkar@gmail.com> * Updated use of require package and golangci.yml Signed-off-by: Abhisman Sarkar <abhisman.sarkar@gmail.com> * Added suggestions Signed-off-by: Abhisman Sarkar <abhisman.sarkar@gmail.com> --------- Signed-off-by: Abhisman Sarkar <abhisman.sarkar@gmail.com> * chore: rename NamespaceInterface SleepNamespace (#3371) This PR removes resource type from `SleepNamespace` function name in `NamespaceInterface`, becoming just `Sleep`. Signed-off-by: Javier Provecho Fernández (Okteto) jpf@okteto.com Signed-off-by: Javier Provecho Fernández (Okteto) jpf@okteto.com * switch to personal namespace if previous namespace is missing (#3365) * switch to personal namespace if previous namespace is missing Signed-off-by: Ronnie Smith <miniscruff@hey.com> * adjustments based on reviews for switching context * use a new variable name: CheckNamespaceAccess * also handle the -n/--namespace option in ctx use * clean up conditional logic * use warning instead of success Signed-off-by: Ronnie Smith <miniscruff@hey.com> --------- Signed-off-by: Ronnie Smith <miniscruff@hey.com> * Make okteto up wait until original resource is awaken before starting dev container (#3368) * Changes in the up command to wake the namespace up (if it is sleeping and it is an okteto context) and wait until the annotation dev.okteto.com/state-before-sleeping is not present in the original deployment before deploying the dev container Signed-off-by: Ignacio Fuertes <nacho@okteto.com> * Execute wake call within a goroutine, extracted status label to a constant and include some logic to wait the the deployment is already in dev mode but the namespace is sleeping Signed-off-by: Ignacio Fuertes <nacho@okteto.com> * If the dev container is an autocreate, we don't need to wait until it is up Signed-off-by: Ignacio Fuertes <nacho@okteto.com> * Addressed code review comments. Some renames, stop timers properly and print a warning instead of returning an error if the resource is not awaken after the timeout Signed-off-by: Ignacio Fuertes <nacho@okteto.com> --------- Signed-off-by: Ignacio Fuertes <nacho@okteto.com> * fix: omit auth error on build (#3374) * fix: omit auth error on build Signed-off-by: Javier López Barba <javier@okteto.com> * do not return err if err prefix string include error getting credentials Signed-off-by: adripedriza <adripedriza@gmail.com> * add cases catch an error related to credentials helper not accessible Signed-off-by: adripedriza <adripedriza@gmail.com> * add integration test for GetAuthConfig from the credentials store Signed-off-by: adripedriza <adripedriza@gmail.com> * addressing feedback Signed-off-by: adripedriza <adripedriza@gmail.com> * fix less restrictive check Signed-off-by: adripedriza <adripedriza@gmail.com> --------- Signed-off-by: Javier López Barba <javier@okteto.com> Signed-off-by: adripedriza <adripedriza@gmail.com> Co-authored-by: adripedriza <adripedriza@gmail.com> * Jlopezbarb/upgrade syncthing to 1.23.1 (#3386) * feat: upgrade bin image to use syncthing 1.23.1 Signed-off-by: Javier López Barba <javier@okteto.com> * feat: use syncthing 1.23.1 Signed-off-by: Javier López Barba <javier@okteto.com> --------- Signed-off-by: Javier López Barba <javier@okteto.com> * Fixed bug of memory requests/reservations (#3385) * Fixed bug of memory requests/reservations Signed-off-by: mnevadom <nevado.mario@gmail.com> * added resource translate testing Signed-off-by: mnevadom <nevado.mario@gmail.com> --------- Signed-off-by: mnevadom <nevado.mario@gmail.com> * Don't delete volume snapshot on DestroyWithLabel if -v flag is not set (#3375) * Don't delete volume snapshot on DestroyWithLabel if -v flag is not set Signed-off-by: Ignacio Fuertes <nacho@okteto.com> * Addressed code review comments. Fixed issue with Deepsource, changed logs to specify also the resource type we skip to delete and combine 2 branches of a switch statement Signed-off-by: Ignacio Fuertes <nacho@okteto.com> --------- Signed-off-by: Ignacio Fuertes <nacho@okteto.com> * trigger a new context store write (#3390) * trigger a new context store write Signed-off-by: adripedriza <adripedriza@gmail.com> * update comment Signed-off-by: adripedriza <adripedriza@gmail.com> --------- Signed-off-by: adripedriza <adripedriza@gmail.com> * log a warning instead of prompting to ignore .git (#3370) Signed-off-by: Ronnie Smith <miniscruff@hey.com> * feat: update to golang to 1.19.5 (#3397) * feat: update to golang Signed-off-by: Javier López Barba <javier@okteto.com> * use golang 1.19 Signed-off-by: Javier López Barba <javier@okteto.com> --------- Signed-off-by: Javier López Barba <javier@okteto.com> * Fix vulnerabilities (#3396) * fix: helm vulnerabilities We couldn't use the image that we were using since it has not been updated to the latest helm version (the one without any vulnerability). We changed the base image to use alpine, install just the necessary things to install helm and install the latest version which can be configured Signed-off-by: Javier López Barba <javier@okteto.com> * fix: update archiver to version 3.5.1 Signed-off-by: Javier López Barba <javier@okteto.com> * feat: update golang.org/x/net dependency Signed-off-by: Javier López Barba <javier@okteto.com> --------- Signed-off-by: Javier López Barba <javier@okteto.com> * Revert "feat: update to golang to 1.19.5 (#3397)" (#3399) This reverts commit 37dcce6. Signed-off-by: Javier López Barba <javier@okteto.com> * Support for divert with Istio (#3384) * Support for divert with Istio * Specify the virtual service of the diverted service * fix: e2e test Signed-off-by: Javier López Barba <javier@okteto.com> * fix: e2e test Signed-off-by: Javier López Barba <javier@okteto.com> * fix: e2e test Signed-off-by: Javier López Barba <javier@okteto.com> * fix: e2e fix Signed-off-by: Javier López Barba <javier@okteto.com> * fix: e2e test Signed-off-by: Javier López Barba <javier@okteto.com> * fix: e2e test Signed-off-by: Javier López Barba <javier@okteto.com> * fix: e2e test Signed-off-by: Javier López Barba <javier@okteto.com> * fix: deploy inside commands Signed-off-by: Javier López Barba <javier@okteto.com> * fix nil pointers Signed-off-by: adripedriza <adripedriza@gmail.com> * Revert "fix nil pointers" This reverts commit 41f73bd. Signed-off-by: adripedriza <adripedriza@gmail.com> * fix e2e Signed-off-by: adripedriza <adripedriza@gmail.com> * fix external validation Signed-off-by: adripedriza <adripedriza@gmail.com> * fix test Signed-off-by: adripedriza <adripedriza@gmail.com> --------- Signed-off-by: Javier López Barba <javier@okteto.com> Signed-off-by: adripedriza <adripedriza@gmail.com> Signed-off-by: Pablo Chico de Guzman <pchico83@gmail.com> Signed-off-by: Abhisman Sarkar <abhisman.sarkar@gmail.com> Signed-off-by: Ignacio Fuertes <nacho@okteto.com> Signed-off-by: Dave Chesnut <7511912+skikd636@users.noreply.github.com> Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Teresa Romero <teresa@okteto.com> Signed-off-by: Javier Provecho Fernández (Okteto) jpf@okteto.com Signed-off-by: Ronnie Smith <miniscruff@hey.com> Signed-off-by: mnevadom <nevado.mario@gmail.com> Co-authored-by: adripedriza <adripedriza@gmail.com> Co-authored-by: Pablo Chico de Guzman <pchico83@gmail.com> Co-authored-by: jpf-okteto <92427625+jpf-okteto@users.noreply.github.com> Co-authored-by: Abhisman <abhisman.sarkar@gmail.com> Co-authored-by: Ignacio Fuertes <nacho@okteto.com> Co-authored-by: Dave Chesnut <7511912+skikd636@users.noreply.github.com> Co-authored-by: Chesnut, Dave (IMS) <chesnutd@imsweb.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Tere <teresa@okteto.com> Co-authored-by: Ronnie <miniscruff@hey.com> Co-authored-by: Mario Nevado <nevado.mario@gmail.com>
Proposed changes
Fixes #3220
This pr adds the
errcheck
tool for linting purposes and also takes care of all the error handling needed.