Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Remove sensitive fields when the job is completed and deleted #5289

Merged
merged 1 commit into from
Feb 7, 2021
Merged
Changes from all commits
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
4 changes: 4 additions & 0 deletions src/database-controller/src/write-merger/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ async function postWatchEvents(req, res, next) {
if (snapshot.getState() === 'Completed') {
// if event is DELETED and the state is Completed, mark apiServerDeleted = true
internalUpdate.apiServerDeleted = true;
// If the job is completed and deleted, we could reset its sensitive fields.
internalUpdate.configSecretDef = '';
internalUpdate.dockerSecretDef = '';
internalUpdate.tokenSecretDef = '';
} else {
// Event is DELETED and the state is not Completed.
// This case could occur when someone deletes the framework in API server directly.
Expand Down