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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport][2.25] Manifest path fixes for remote deploy #4201

Merged
merged 8 commits into from
Mar 18, 2024

Conversation

andreafalzetti
Copy link
Contributor

@andreafalzetti andreafalzetti commented Mar 14, 2024

Proposed changes

This PR is a manual backport to release 2.25 of the following:

  1. Fix the scenario okteto deploy -f <parent>/okteto.yml
  2. Add build context for remote destroy
  3. Fix the scenario okteto deploy -f <dir>

How to validate

  1. Clone the example repo git clone -b fix-dev-199 git@github.com:andreafalzetti/k8s-status-api.git
  2. Try these scenarios:

DEPLOY

# Working Directory Command
1 ./apps/service okd deploy
2 ./apps/service okd deploy --remote
3 ./apps/service okd deploy -f okteto.yml
4 ./apps/service okd deploy -f okteto.yml --remote
5 ./apps/service/pkg okd deploy -f ../okteto.yml
6 ./apps/service/pkg okd deploy -f ../okteto.yml --remote
7 ./ okd deploy -f apps/service/
8 ./ okd deploy -f apps/service/ --remote
9 ./ okd deploy -f apps/service/okteto.yml
10 ./ okd deploy -f apps/service/okteto.yml --remote
11 ./apps/service mv okteto.yml .okteto && okd deploy -f .okteto/
12 ./apps/service mv okteto.yml .okteto && okd deploy -f .okteto/ --remote
13 ./apps/service mv okteto.yml .okteto && okd deploy -f .okteto/okteto.yml
14 ./apps/service mv okteto.yml .okteto && okd deploy -f .okteto/okteto.yml --remote
15 ./apps/service mv okteto.yml .okteto && okd deploy
16 ./apps/service mv okteto.yml .okteto && okd deploy --remote
17 ./apps/service/pkg mv okteto.yml .okteto && okd deploy -f ../.okteto/okteto.yml --remote

DESTROY

# Working Directory Command
1 ./apps/service okd destroy
2 ./apps/service okd destroy --remote
3 ./apps/service okd destroy -f okteto.yml
4 ./apps/service okd destroy -f okteto.yml --remote
5 ./apps/service/pkg okd destroy -f ../okteto.yml
6 ./apps/service/pkg okd destroy -f ../okteto.yml --remote
7 ./ okd destroy -f apps/service/
8 ./ okd destroy -f apps/service/ --remote
9 ./ okd destroy -f apps/service/okteto.yml
10 ./ okd destroy -f apps/service/okteto.yml --remote
11 ./apps/service mv okteto.yml .okteto && okd destroy -f .okteto/
12 ./apps/service mv okteto.yml .okteto && okd destroy -f .okteto/ --remote
13 ./apps/service mv okteto.yml .okteto && okd destroy -f .okteto/okteto.yml
14 ./apps/service mv okteto.yml .okteto && okd destroy -f .okteto/okteto.yml --remote
15 ./apps/service mv okteto.yml .okteto && okd destroy
16 ./apps/service mv okteto.yml .okteto && okd destroy --remote
17 ./apps/service/pkg mv okteto.yml .okteto && okd destroy -f ../.okteto/okteto.yml --remote

A quick way of testing all scenarios is run these 4 batches:

# Working Dir: /
okd deploy -f apps/service/ && okd destroy -f apps/service/
okd deploy -f apps/service/ --remote && okd destroy -f apps/service/ --remote
okd deploy -f apps/service/okteto.yml && okd destroy -f apps/service/okteto.yml
okd deploy -f apps/service/okteto.yml --remote && okd destroy -f apps/service/okteto.yml --remote

# Working Dir: apps/service
okd deploy && okd destroy
okd deploy --remote && okd destroy --remote
okd deploy -f okteto.yml && okd destroy -f okteto.yml
okd deploy -f okteto.yml --remote && okd destroy -f okteto.yml --remote

# Working Dir: apps/service/pkg
okd deploy -f ../okteto.yml && okd destroy -f ../okteto.yml
okd deploy -f ../okteto.yml --remote && okd destroy -f ../okteto.yml --remote

# Working Dir: apps/service (move okteto -> .okteto/okteto)
okd deploy -f .okteto/ && okd destroy -f .okteto/
okd deploy -f .okteto/ --remote && okd destroy -f .okteto/ --remote
okd deploy -f .okteto/okteto.yml && okd destroy -f .okteto/okteto.yml
okd deploy -f .okteto/okteto.yml --remote && okd destroy -f .okteto/okteto.yml --remote
okd deploy && okd destroy
okd deploy --remote && okd destroy --remote

# Working Dir: apps/service/pkg (move okteto -> .okteto/okteto)
okd deploy -f ../.okteto/okteto.yml --remote && okd destroy -f ../.okteto/okteto.yml --remote

CLI Quality Reminders 馃敡

For both authors and reviewers:

  • Scrutinize for potential regressions
  • Ensure key automated tests are in place
  • Build the CLI and test using the validation steps
  • Assess Developer Experience impact (log messages, performances, etc)
  • If too broad, consider breaking into smaller PRs
  • Adhere to our code style and code review guidelines

andreafalzetti and others added 2 commits March 14, 2024 11:11
Signed-off-by: Andrea Falzetti <andrea@okteto.com>
---------

Signed-off-by: Andrea Falzetti <andrea@okteto.com>
Signed-off-by: Andrea Falzetti <andrea@okteto.com>
Copy link

codecov bot commented Mar 14, 2024

Codecov Report

Merging #4201 (146608b) into release-2.25 (a6d74b0) will increase coverage by 0.05%.
The diff coverage is 91.66%.

Additional details and impacted files
@@               Coverage Diff                @@
##           release-2.25    #4201      +/-   ##
================================================
+ Coverage         45.56%   45.62%   +0.05%     
================================================
  Files               287      288       +1     
  Lines             27057    27094      +37     
================================================
+ Hits              12329    12362      +33     
- Misses            13642    13644       +2     
- Partials           1086     1088       +2     

@andreafalzetti andreafalzetti added the run-e2e When used on a PR run windows & unix e2e label Mar 14, 2024
@andreafalzetti andreafalzetti marked this pull request as ready for review March 14, 2024 16:32
@andreafalzetti andreafalzetti requested a review from a team as a code owner March 14, 2024 16:32
Signed-off-by: Andrea Falzetti <andrea@okteto.com>
Signed-off-by: Andrea Falzetti <andrea@okteto.com>
Signed-off-by: Andrea Falzetti <andrea@okteto.com>
Signed-off-by: Andrea Falzetti <andrea@okteto.com>
@andreafalzetti andreafalzetti changed the title Backpor to 2.25 manifest path fix [Backport][2.25] Manifest path fixes for remote deploy Mar 15, 2024
Copy link
Member

@ifbyol ifbyol left a comment

Choose a reason for hiding this comment

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

馃憦

Copy link
Contributor

@jLopezbarb jLopezbarb left a comment

Choose a reason for hiding this comment

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

Tested all the scenarios.

I created a new scenario that is not covered but it was also not working in 2.25.0.

From apps/service/pkg
okteto deploy -f ../.okteto/okteto.yml --remote

Signed-off-by: Andrea Falzetti <andrea@okteto.com>
@andreafalzetti
Copy link
Contributor Author

@jLopezbarb good catch! I've fixed the additional case and re-tested all 34 scenarios using the "script". It works for all listed cases now. I will wait for the CI tests to pass, and merge. Thanks both @ifbyol and @jLopezbarb for your help in testing and reviewing this PR 馃檹

@andreafalzetti andreafalzetti merged commit 724e856 into release-2.25 Mar 18, 2024
13 of 14 checks passed
@andreafalzetti andreafalzetti deleted the backport-to-2.25 branch March 18, 2024 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release/bug-fix run-e2e When used on a PR run windows & unix e2e
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants