Skip to content
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

Check deployed dev environments when inferring the name #3300

Merged
merged 12 commits into from Jan 11, 2023

Conversation

ifbyol
Copy link
Member

@ifbyol ifbyol commented Dec 16, 2022

Fixes #3276

Proposed changes

Modified the logic of the function InferName to use the following preference for inferring the name:

  1. Name specified with the --name flag
  2. Name specified in the manifest
  3. Name specified in a deployed dev environment matching the repository URL + manifest path (the new scenario we are adding)
  4. Name extracted from the repo URL of the working directory
  5. Name extracted from the folder name of the working directory

The first 2 cases are handled directly by any commands and if no name is found, a call to the function InferName is being done for the rest of scenarios.

In this PR I'm adding the scenario number 3 within the InferName function.

Apart from that, I've moved the InferName function to a new package.

Finally, I added also a flag --name to the logs command

Some concerns I have (cc @pchico83):

  1. It might happen that the same repository with the same manifest path is deployed with different name. What should we do in this case? For now, I'm just taking the first one
  2. In the way we handle the namespace involved in each command is different and it is hard to know the one we should use. All my testing and checking the code points that using okteto.Context().Namespace should be ok but there are cases which is very confusing. For example, here it might happen that options.Namespace has the manfest.Namespace value, but has okteto.Context().Namespace the same value?

In any case, I'm always defaulting to previous behavior, so in the worts case scenario there would be still cases in which this keeps behaving in the way the ticket reports.

I think that we should unify how the namespace and those things are initialized in the commands.

Just a note to bear in mind, the first commit contains the refactor to move the InferName. You can check it here.

…ame to a new package

Signed-off-by: Ignacio Fuertes <nacho@okteto.com>
…onment name

Signed-off-by: Ignacio Fuertes <nacho@okteto.com>
@pchico83
Copy link
Contributor

@ifbyol about this one:

It might happen that the same repository with the same manifest path is deployed with different name. What should we do in this case? For now, I'm just taking the first one

Let's pick the first one and show an info message

…. 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>
… for it

Signed-off-by: Ignacio Fuertes <nacho@okteto.com>
…added a debug log when the name is inferred from a deployed dev environment

Signed-off-by: Ignacio Fuertes <nacho@okteto.com>
@derek derek bot added the no-dco label Dec 21, 2022
@derek
Copy link

derek bot commented Dec 21, 2022

Thank you for your contribution. unfortunately, one or more of your commits are missing the required "Signed-off-by:" statement. Signing off is part of the Developer Certificate of Origin (DCO) which is used by this project.

Read the DCO and project contributing guide carefully, and amend your commits using the git CLI. Note that this does not require any cryptography, keys or special steps to be taken.

💡 Shall we fix this?

This will only take a few moments.

First, clone your fork and checkout this branch using the git CLI.

Next, set up your real name and email address:

git config --global user.name "Your Full Name"
git config --global user.email "you@domain.com"

Finally, run one of these commands to add the "Signed-off-by" line to your commits.

If you only have one commit so far then run: git commit --amend --signoff and then git push --force.
If you have multiple commits, watch this video.

Check that the message has been added properly by running "git log".

@ifbyol ifbyol marked this pull request as ready for review December 21, 2022 11:19
@ifbyol ifbyol requested a review from a team December 21, 2022 11:19
@ifbyol
Copy link
Member Author

ifbyol commented Dec 21, 2022

After talking offline with @pchico83 , I'm leaving our of the scope of this PR the modification of getStackName function. It requires a bigger refactor. It affects when the repository has only a docker-compose.yaml or okteto-stack.yaml. In those cases, we won't infer the name from the dev environments deployed in the namespace. Most of the commands have the --name flag to cover the case.

)

// InferName infers the application name from the folder received as parameter
func InferName(cwd string) string {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to a new package in this commit d95d8c1

…ath for endpoints command. It seems the current one is right

Signed-off-by: Ignacio Fuertes <nacho@okteto.com>
Copy link
Member

@teresaromero teresaromero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Nice comments and refactor of infer name, this will add more clarity :)

@jLopezbarb
Copy link
Contributor

After talking offline with @pchico83 , I'm leaving our of the scope of this PR the modification of getStackName function. It requires a bigger refactor. It affects when the repository has only a docker-compose.yaml or okteto-stack.yaml. In those cases, we won't infer the name from the dev environments deployed in the namespace. Most of the commands have the --name flag to cover the case.

Code looks good👏👏 !! Can we create an issue to tackle this in the future, or at least taking it in consideration whenever we refactor/tweak those files

…ing directly InferName. I created another function with some common behavior to be called from those commands

Signed-off-by: Ignacio Fuertes <nacho@okteto.com>
Signed-off-by: Ignacio Fuertes <nacho@okteto.com>
@ifbyol
Copy link
Member Author

ifbyol commented Dec 21, 2022

@teresaromero @jLopezbarb can you double check the lat commit? I had to add some of the logic in the pipeline deploy and destroy commands as they are not using the InferName function

@ifbyol
Copy link
Member Author

ifbyol commented Dec 22, 2022

After talking offline with @pchico83 , I'm leaving our of the scope of this PR the modification of getStackName function. It requires a bigger refactor. It affects when the repository has only a docker-compose.yaml or okteto-stack.yaml. In those cases, we won't infer the name from the dev environments deployed in the namespace. Most of the commands have the --name flag to cover the case.

Code looks good👏👏 !! Can we create an issue to tackle this in the future, or at least taking it in consideration whenever we refactor/tweak those files

@jLopezbarb Ticket created! #3311

@github-actions
Copy link
Contributor

github-actions bot commented Jan 7, 2023

This pull request is stale because it has been open for 15 days with no activity. Comment on this pull request or it will be closed in 7 days

@github-actions github-actions bot added the stale label Jan 7, 2023
…-infer-name-logic

Signed-off-by: Ignacio Fuertes <nacho@okteto.com>
@ifbyol ifbyol removed the stale label Jan 7, 2023
Signed-off-by: Ignacio Fuertes <nacho@okteto.com>
…-infer-name-logic

Signed-off-by: Ignacio Fuertes <nacho@okteto.com>
@ifbyol
Copy link
Member Author

ifbyol commented Jan 11, 2023

e2e tests are passing so I'll merge it!

@ifbyol ifbyol merged commit 46891f5 into master Jan 11, 2023
@ifbyol ifbyol deleted the ifbyol/3276-improve-infer-name-logic branch January 11, 2023 11:01
jLopezbarb pushed a commit that referenced this pull request Feb 22, 2023
* 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>
AdrianPedriza added a commit that referenced this pull request Feb 23, 2023
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

okteto up and okteto logs don't get the right dev environment name to be used
4 participants