Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
mathis-marcotte committed Oct 10, 2024
1 parent c19c22d commit ab17ce0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions components/centraldashboard/app/k8s_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,9 @@ export class KubernetesService {
const getPromise = await this.coreAPI.readNamespacedConfigMap(EXISTING_SHARES_CM_NAME, namespace);
const existingCM = getPromise.body;

const svmSharesData: string[] = JSON.parse(existingCM.data[data.svm])
const svmSharesData: string[] = JSON.parse(existingCM.data[data.svm]);

const deleteIndex = svmSharesData.indexOf(data.share)
const deleteIndex = svmSharesData.indexOf(data.share);
svmSharesData.splice(deleteIndex, 1);

//if CM would be empty, just delete it
Expand All @@ -237,7 +237,7 @@ export class KubernetesService {
try {
const getPromise = await this.coreAPI.readNamespacedConfigMap(SHARES_ERRORS_CM_NAME, namespace);

const errorsData:Array<{ErrorMessage: string, Svm: string, Share: string, Timestamp: string}> = JSON.parse(getPromise.body.data.errors)
const errorsData:Array<{ErrorMessage: string, Svm: string, Share: string, Timestamp: string}> = JSON.parse(getPromise.body.data.errors);

//find the index of the element to delete
const deleteIndex = errorsData.findIndex(d =>
Expand All @@ -248,7 +248,7 @@ export class KubernetesService {
);

//delete element
errorsData.splice(deleteIndex, 1)
errorsData.splice(deleteIndex, 1);

//delete the CM if the value would be empty
if(errorsData.length===0){
Expand Down

0 comments on commit ab17ce0

Please sign in to comment.