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
Make okteto up wait until original resource is awaken before starting dev container #3368
Conversation
… 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>
return nil | ||
} | ||
|
||
timeout := 5 * time.Minute |
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.
@pchico83 I'm setting 5 minutes as the maximum time to wait for a resource to be awaken. Do you think we should increase it?
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.
I think we should be using dev.timeout.resources
. Default value is 120 seconds. I don't know if that works for you but if we use it it's already configurable in the dev section
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.
Not sure if 120 seconds would be enough. When things starts to be waken up in order it might take a bit more (taking also into account the time for the job to be scheduled)
@@ -457,3 +462,29 @@ func getPullingMessage(message, namespace string) string { | |||
toReplace := fmt.Sprintf("%s/%s", registry, namespace) | |||
return strings.Replace(message, toReplace, okteto.DevRegistry, 1) | |||
} | |||
|
|||
// waitUntilAppIsAwaken waits until the app is awaken checking if the annotation dev.okteto.com/state-before-sleeping is present in the app resource | |||
func (up *upContext) waitUntilAppIsAwaken(ctx context.Context, app apps.App) 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.
In this case I'm not checking if the context is an Okteto one or not because the resource shouldn't have that annotation in a non Okteto cluster
…stant 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>
cmd/up/activate.go
Outdated
if apps.IsDevModeOn(app) { | ||
var err error | ||
appToCheck, err = app.GetCloned(ctx, up.Client) | ||
if err != nil { | ||
return 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.
I had to include some logic to detect if the resource is already on dev mode. In that case, we need to check the cloned resource as it is the one with the annotation to check.
This scenario might happen when a namespace is slept but some of the resources were in dev mode but without being attached to the pod
@@ -295,6 +297,27 @@ func Up() *cobra.Command { | |||
up.Dev.Autocreate = true | |||
} | |||
|
|||
// only if the context is an okteto one, we should verify if the namespace has to be woken up | |||
if okteto.Context().IsOkteto { |
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.
Not sure if this is the best place to execute this or it could be before, can you check @jLopezbarb ?
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.
I'd leave it here since we need dev.Namespace
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.
@ifbyol as you mentioned in the other case where you didn't check if it was an okteto context because the label was not going to be there, could we do the same here? wakeNamespaceIfApplies
is checking for the label to be "Sleeping" and if I understand correctly, that could not happen without an okteto context
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.
but the code within this if
is calling to Okteto API (wakeSpace
mutation), so if the context is not an Okteto one, it will fail. We need this check
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.
@ifbyol what if
are you referring to? What I mean is that wakeNamespaceIfApplies
won't call wakeSpace
since it will return early in the label check
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.
Yeah, but it would slow down things in vanilla clusters as we would need to retrieve the ns to check that. The idea is to execute only that logic if it is needed (in an Okteto context) and execute it within a goroutine to avoid to impact on the okteto up
command.
I think it is clearer to throw a goroutine only if the context is an Okteto one (having available that information), that executing a goroutine with the logic to execute the wait within it or not
I recorded a video on how the experience looks like to the user, you can watch it here. @rlamana @pchico83 can you review it? Specially the 2 messages I added and the wording. Specifically:
|
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.
LGTM
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.
Changes look good! I left some minor details and some rename stuff.
I have a question regarding the architecture: Is it possible to handle the sleep+wake logic through the cli? I feel that in general this things that are in between are hard to mantain long-term since both the CLI and the backend communicate with the k8s objects
@@ -295,6 +297,27 @@ func Up() *cobra.Command { | |||
up.Dev.Autocreate = true | |||
} | |||
|
|||
// only if the context is an okteto one, we should verify if the namespace has to be woken up | |||
if okteto.Context().IsOkteto { |
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.
@ifbyol as you mentioned in the other case where you didn't check if it was an okteto context because the label was not going to be there, could we do the same here? wakeNamespaceIfApplies
is checking for the label to be "Sleeping" and if I understand correctly, that could not happen without an okteto context
… is up Signed-off-by: Ignacio Fuertes <nacho@okteto.com>
…d 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>
The problem with that is that the backend (not only the API, also the webhook) would be completely coupled to the CLI as they would need the CLI to execute all the logic for wake + sleep. At the end is like the |
select { | ||
case <-to.C: | ||
// In case of timeout, we just print a warning to avoid the command to fail | ||
oktetoLog.Warning("Dev environment '%s' didn't wake up after %s", appToCheck.ObjectMeta().Name, timeout.String()) |
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.
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.
The message looks good to me. @rlamana ?
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.
It looks good to me too 👌
…resource-to-be-up Signed-off-by: Ignacio Fuertes <nacho@okteto.com>
Tests e2e are passing and I tested the branch with the changed @teresaromero is doing to wake things up in order and I didn't spot any issues. Merging it |
… 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>
* 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>
Signed-off-by: Ignacio Fuertes nacho@okteto.com
Proposed changes
Fixes https://github.com/okteto/app/issues/5520
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. The main changes are:
wakeSpace
mutation as one of the first steps of the commandI tested some basic scenarios but I still need to run more tests. Opening the PR to get early feedback.