-
Notifications
You must be signed in to change notification settings - Fork 315
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
Use .oktetoignore in deploy and destroy remote #4316
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4316 +/- ##
==========================================
- Coverage 43.10% 43.10% -0.01%
==========================================
Files 371 371
Lines 30021 30042 +21
==========================================
+ Hits 12940 12949 +9
- Misses 15954 15960 +6
- Partials 1127 1133 +6 |
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.
If both files are defined, we are merging both, which I think it is misleading. If the new file is defined, it should mean that users are migrated to new file, so I don't think we should keep taking into account .oktetodeployignore
.
WDYT @pchico83 @codyjlandstrom ?
pkg/remote/remote.go
Outdated
@@ -483,7 +473,7 @@ func createDockerignoreFileWithFilesystem(cwd, tmpDir string, rules []string, us | |||
if !errors.Is(err, os.ErrNotExist) { | |||
return err | |||
} | |||
|
|||
oktetoLog.Warning("Ignoring files through %s is deprecated and will be removed in future versions. Please use .oktetoignore. More info here: https://www.okteto.com/docs/core/remote-execution/#ignoring-files", oktetoDockerignoreName) |
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 this warning is not located in the right place. We are adding the warning if .oktetodeployignore
file doesn't exist in the working directory instead of showing it if it exists
![Screenshot 2024-05-24 at 20 47 56](https://private-user-images.githubusercontent.com/3510171/333701856-1ac84916-2eb2-4439-9bce-c40a89b55975.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE0MjY0MjgsIm5iZiI6MTcyMTQyNjEyOCwicGF0aCI6Ii8zNTEwMTcxLzMzMzcwMTg1Ni0xYWM4NDkxNi0yZWIyLTQ0MzktOWJjZS1jNDBhODliNTU5NzUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcxOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MTlUMjE1NTI4WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MmQyOTUwZTkwNjY3NGNhMmQ0MzExNDk5ZTlhZGVlNDJmMDRiMmIzNzRlMTAwZTJiOWQ4NWZiZjQ5ZWRjYWU0NCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.5-YXqBrylERG0tO4F1p2egUWckjav2EHBe6sI5oEYio)
As you can see if the screenshot, there is a .oktetodeployignore
file but the warning is not present. If I run the command without that file, the warning is displayed
if err != nil { | ||
return "", err | ||
} | ||
manifestPathDir := filepath.Dir(filepath.Clean(fmt.Sprintf("/%s", manifestPath))) |
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.
Does this work on windows? (referring to /%s
)
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 assume that's what Clean
is for. I simply moved this function to be a global in this package (it was previously a member of runner
).
From Clean
docs:
On Windows, Clean does not modify the volume name other than to replace occurrences of "/" with
\
.
For example, Clean("//host/share/../x") returns\\host\share\x
.
Both options sound good to me. But for simplicity, I would also go with one file or the other, without merging tham |
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.
Code changes LGTM. I've also tested the scenario described and it works both on Mac and Windows.
As already mentioned the warning for .oktetodeployignore
appears when I don't have it, and it should be fixed before merging.
About the "merge" vs "override" I think both options are good, I defer to Product the final call, however I would go for now with the current implementation as it's good, and we can just drop the support for the old format in the future.
I think what we have is ok (merging) until we fully deprecate the old file. User could be using |
@maroshii SGTM |
We now inject rules for destroy and deploy remote a we do for test. This is merged with the contents of
.oktetodeployignore
file.Updated docs as part of this: okteto/docs#743
Validation
Create the following folders:
Using the following
.oktetoignore
file:with an
ls
in the deploy and destroy sections:For deploy we should only get
report-deploy
and for destroy we should only getreport-destroy