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

Commit

Permalink
Remove owner reference for priority class
Browse files Browse the repository at this point in the history
Remove framework owner reference for priority class, ref #4117.
  • Loading branch information
abuccts committed Jan 8, 2020
1 parent cd6faef commit ef79417
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions src/rest-server/src/models/v2/job/k8s.js
Original file line number Diff line number Diff line change
Expand Up @@ -606,33 +606,6 @@ const createPriorityClass = async (frameworkName, priority) => {
}
};

const patchPriorityClassOwner = async (frameworkName, frameworkUid) => {
try {
const headers = {...launcherConfig.requestHeaders};
headers['Content-Type'] = 'application/merge-patch+json';
await axios({
method: 'patch',
url: launcherConfig.priorityClassPath(`${encodeName(frameworkName)}-priority`),
headers,
httpsAgent: apiserver.ca && new Agent({ca: apiserver.ca}),
data: {
metadata: {
ownerReferences: [{
apiVersion: launcherConfig.apiVersion,
kind: 'Framework',
name: encodeName(frameworkName),
uid: frameworkUid,
controller: false,
blockOwnerDeletion: false,
}],
},
},
});
} catch (error) {
logger.warn('Failed to patch owner reference for priority class', error);
}
};

const deletePriorityClass = async (frameworkName) => {
try {
await axios({
Expand Down Expand Up @@ -850,7 +823,6 @@ const put = async (frameworkName, config, rawConfig) => {
}
// do not await for patch
auths.length && patchSecretOwner(frameworkName, response.data.metadata.uid);
patchPriorityClassOwner(frameworkName, response.data.metadata.uid);
};

const execute = async (frameworkName, executionType) => {
Expand Down

0 comments on commit ef79417

Please sign in to comment.