Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
bd552c99
Commit
bd552c99
authored
Feb 29, 2016
by
Jordan Liggitt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove cache-based short-circuit of token cleanup
parent
577eb94c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
7 deletions
+4
-7
tokens_controller.go
pkg/controller/serviceaccount/tokens_controller.go
+0
-5
tokens_controller_test.go
pkg/controller/serviceaccount/tokens_controller_test.go
+4
-2
No files found.
pkg/controller/serviceaccount/tokens_controller.go
View file @
bd552c99
...
@@ -415,11 +415,6 @@ func (e *TokensController) deleteSecret(secret *api.Secret) error {
...
@@ -415,11 +415,6 @@ func (e *TokensController) deleteSecret(secret *api.Secret) error {
// removeSecretReferenceIfNeeded updates the given ServiceAccount to remove a reference to the given secretName if needed.
// removeSecretReferenceIfNeeded updates the given ServiceAccount to remove a reference to the given secretName if needed.
// Returns whether an update was performed, and any error that occurred
// Returns whether an update was performed, and any error that occurred
func
(
e
*
TokensController
)
removeSecretReferenceIfNeeded
(
serviceAccount
*
api
.
ServiceAccount
,
secretName
string
)
error
{
func
(
e
*
TokensController
)
removeSecretReferenceIfNeeded
(
serviceAccount
*
api
.
ServiceAccount
,
secretName
string
)
error
{
// See if the account even referenced the secret
if
!
getSecretReferences
(
serviceAccount
)
.
Has
(
secretName
)
{
return
nil
}
// We don't want to update the cache's copy of the service account
// We don't want to update the cache's copy of the service account
// so remove the secret from a freshly retrieved copy of the service account
// so remove the secret from a freshly retrieved copy of the service account
serviceAccounts
:=
e
.
client
.
Core
()
.
ServiceAccounts
(
serviceAccount
.
Namespace
)
serviceAccounts
:=
e
.
client
.
Core
()
.
ServiceAccounts
(
serviceAccount
.
Namespace
)
...
...
pkg/controller/serviceaccount/tokens_controller_test.go
View file @
bd552c99
...
@@ -492,8 +492,10 @@ func TestTokenCreation(t *testing.T) {
...
@@ -492,8 +492,10 @@ func TestTokenCreation(t *testing.T) {
"deleted secret with serviceaccount without reference"
:
{
"deleted secret with serviceaccount without reference"
:
{
ExistingServiceAccount
:
serviceAccount
(
emptySecretReferences
()),
ExistingServiceAccount
:
serviceAccount
(
emptySecretReferences
()),
DeletedSecret
:
serviceAccountTokenSecret
(),
DeletedSecret
:
serviceAccountTokenSecret
(),
ExpectedActions
:
[]
core
.
Action
{},
ExpectedActions
:
[]
core
.
Action
{
core
.
NewGetAction
(
"serviceaccounts"
,
api
.
NamespaceDefault
,
"default"
),
},
},
},
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment