Fixed Blue/Green Strategy Ingress Route-Method Glitch (#217)

* Added some tests, not sure what else to try but gonna think of more examples

* forgot some files

* reverted package-lock.json

* Added empty dir test

* Cleaned up some extra spaces

* Add node modules and compiled JavaScript from main

* forgot to actually include functionality

* removed unnecessary files

* Update .gitignore

* Update .gitignore

* Update .gitignore

* thx david

* renamed searchFilesRec

* integrations test fix

* added examples to README

* added note about depth

* added additional note

* removed ticks

* changed version string

* removed conflict on readme

* Added tests for bluegreen helper and resolved issue with ingress not being read correctly, still have to figure out why new services aren't showing up

* resolved services name issue

* looks functional, beginning refactor now

* refactored deploy methods for type error

* Removed refactor comments

* prettier

* implemented Oliver's feedback

* prettier

* added optional chaining operator

* removed refactor comment

Co-authored-by: Jaiveer Katariya <jaiveerkatariya@Jaiveers-MacBook-Pro.local>
Co-authored-by: Oliver King <oking3@uncc.edu>
Co-authored-by: Jaiveer Katariya <jaiveerkatariya@Jaiveers-MBP.lan>
This commit is contained in:
Jaiveer Katariya
2022-07-29 10:58:58 -04:00
committed by GitHub
parent 0b5795551a
commit 531cfdcc3d
10 changed files with 715 additions and 385 deletions
@@ -112,6 +112,7 @@ export async function deleteWorkloadsWithLabel(
})
await deleteObjects(kubectl, resourcesToDelete)
return resourcesToDelete
}
export async function deleteWorkloadsAndServicesWithLabel(
@@ -143,6 +144,7 @@ export async function deleteWorkloadsAndServicesWithLabel(
})
await deleteObjects(kubectl, resourcesToDelete)
return resourcesToDelete
}
export async function deleteObjects(kubectl: Kubectl, deleteList: any[]) {
@@ -237,9 +239,6 @@ export async function createWorkloadsWithLabel(
deploymentObjectList.forEach((inputObject) => {
// creating deployment with label
const newBlueGreenObject = getNewBlueGreenObject(inputObject, nextLabel)
core.debug(
'New blue-green object is: ' + JSON.stringify(newBlueGreenObject)
)
newObjectsList.push(newBlueGreenObject)
})
@@ -280,7 +279,7 @@ export function addBlueGreenLabelsAndAnnotations(
updateObjectLabels(inputObject, newLabels, false)
updateSelectorLabels(inputObject, newLabels, false)
// updating spec labels if it is a service
// updating spec labels if it is not a service
if (!isServiceEntity(inputObject.kind)) {
updateSpecLabels(inputObject, newLabels, false)
}