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

Calculate namespace prefix before tainting route entries #21470

Merged
merged 6 commits into from
Jun 27, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove check, log just about tainting
  • Loading branch information
VioletHynes committed Jun 27, 2023

Verified

This commit was signed with the committer’s verified signature.
mikz Michal Cichra
commit 3255c0040456f72307871e24d5142fae50e11a01
9 changes: 1 addition & 8 deletions vault/auth.go
Original file line number Diff line number Diff line change
@@ -879,14 +879,7 @@ func (c *Core) setupCredentials(ctx context.Context) error {
// Calculate any namespace prefixes here, because when Taint() is called, there won't be
// a namespace to pull from the context. This is similar to what we do above in c.router.Mount().
path = entry.Namespace().Path + path
if entry.Path != path {
nsfc, err := namespace.FromContext(ctx)
if err != nil {
c.logger.Error("error when trying to get the namespace from the context", "error", err)
} else {
c.logger.Debug("tainting a mount but path and namespaced path disagree", "entry_path", entry.Path, "entry_namespace_path", entry.Namespace().Path, "namespace_from_context", nsfc)
}
}
c.logger.Debug("tainting a mount", "_path", entry.Path, "namespace_path", entry.Namespace().Path)
c.router.Taint(ctx, path)
}

9 changes: 1 addition & 8 deletions vault/mount.go
Original file line number Diff line number Diff line change
@@ -1596,14 +1596,7 @@ func (c *Core) setupMounts(ctx context.Context) error {
// Calculate any namespace prefixes here, because when Taint() is called, there won't be
// a namespace to pull from the context. This is similar to what we do above in c.router.Mount().
path := entry.Namespace().Path + entry.Path
if entry.Path != path {
nsfc, err := namespace.FromContext(ctx)
if err != nil {
c.logger.Error("error when trying to get the namespace from the context", "error", err)
} else {
c.logger.Debug("tainting a mount but path and namespaced path disagree", "entry_path", entry.Path, "entry_namespace_path", entry.Namespace().Path, "namespace_from_context", nsfc)
}
}
c.logger.Debug("tainting a mount", "path", entry.Path, "namespace_path", entry.Namespace().Path)
c.router.Taint(ctx, path)
}