-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Ensure file sync works in multi-namespace environments #5464
Closed
omninonsense
wants to merge
1
commit into
GoogleContainerTools:master
from
omninonsense:nino--issue-4246
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 reason why we we are against "" in nsMap is because not everyone has permissions to fetch pods and objects in all namespaces.
With empty namespace, k8s api will try to fetch pods, monitors etc in all namespaces.
To avoid getting a permission issue, we only add "" when no namespace is present.
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.
Ah right, I see. My assumption was that skaffold is only used with local clusters (
minikube
and similar), but now your comment implies people use it with shared clusters too. So, in that case I see how this would cause problems.This is mostly an issue for kustomize and kubectl deployments, since they're simply "glide-through" skaffold without any processing. (Edit: assuming I remember the code correctly).
Could I instead peek at
.metadata.namespace
of the kustomize-compiled resources? I know could be made possible, but I'm not sure if that's desirable? In that case it would work in a similar fashion to the Helm namespace heuristic.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.
Looking more into this, we provide an
UpdateNamespace
method which updates the namespaces with deployed resources.skaffold/pkg/skaffold/runner/runcontext/context.go
Line 244 in 5bf0323
I submitted a PR recently where
PodWatcher.Start()
uses updated namespace.I am wondering if that fixed this issue.
#5487
Can you verify this on the latest version of skaffold?