Added Integration Tests, Resolved Bugs With Annotations (#255)

* First commit - made manifests for test deployments, made manifests for i tests for other deployment strategies

* broke down blue/green

* added latest tags to test manifests for new tags

* remade tester

* ready to test bgi

* using all but first index of argv

* careless error with dicts

* added test to namespace

* realized i was silencing error

* indexing containers

* keyerror

* logging bc python errors are weird

* expected still string

* parsed args behaving weirdly

* test seems to be working now, applying changes to other YAMLs now

* blue/green ready to test

* oops

* oops

* Added additional labels to check

* hyphen

* Added our annotations

* lol

* added our labels to services too

* nonetype issue'

* nonetype issue'

* narrowing down parameter

* fixed annotations issue with promote

* adding debhug statement to figure out why services aren't getting annotations

* this should fix annotations issue for service

* not sure why this wasn't caught by intellisense

* should be fixed with removing comma but adding logs in case

* added linkerd install

* verification

* upgraded kubernetes version

* removing crds

* proxy option

* Added smi extension

* logging service

* smi svcs also getting labeled now

* matching ts type

* not sure where stable service is going

* remaining svc and deployment should match

* keeping stable service and ts object

* updated tests to reflect keeping ts object

* no green svc after promote

* duh

* lol

* canary work

* canary test ready

* logging for ing, filename for canary

* changed ingress svc key and returning svc files from smi canary deployment

* ts name

* forgot about baseline in first deploy

* *

* *

* smi canary should annotate, fixed cleanup

* typescript issue plus percentage

* forgot to type extra method

* removed cleaned up objects from annotate list

* logging because services aren't getting removed

* moving to try/catch strategy of annotation since deletion can fail silently/with warnings

* moved label to individual

* removing canary service check after promote

* pod ready for testing

* set weights to 1000

* selectors

* *

* percentage

* *

* typing

* mixed up pod and smi

* fixed tests

* prettier

* forgot to remove canary

* cleanup

* Added oliver's feedback + more cleanup

* ncc as dev dependency

* npx

* going back to global ncc install bc npm is being weird

* prettier

* removed unnecessary post step
This commit is contained in:
Jaiveer Katariya
2022-11-01 16:02:57 -04:00
committed by GitHub
parent a6cfc31f7a
commit e9693a7cdd
24 changed files with 1665 additions and 310 deletions
+13 -3
View File
@@ -29,12 +29,17 @@ export async function deleteCanaryDeployment(
kubectl: Kubectl,
manifestFilePaths: string[],
includeServices: boolean
) {
): Promise<string[]> {
if (manifestFilePaths == null || manifestFilePaths.length == 0) {
throw new Error('Manifest files for deleting canary deployment not found')
}
await cleanUpCanary(kubectl, manifestFilePaths, includeServices)
const deletedFiles = await cleanUpCanary(
kubectl,
manifestFilePaths,
includeServices
)
return deletedFiles
}
export function markResourceAsStable(inputObject: any): object {
@@ -189,7 +194,7 @@ async function cleanUpCanary(
kubectl: Kubectl,
files: string[],
includeServices: boolean
) {
): Promise<string[]> {
const deleteObject = async function (kind, name) {
try {
const result = await kubectl.delete([kind, name])
@@ -199,6 +204,8 @@ async function cleanUpCanary(
}
}
const deletedFiles: string[] = []
for (const filePath of files) {
const fileContents = fs.readFileSync(filePath).toString()
@@ -211,6 +218,7 @@ async function cleanUpCanary(
isDeploymentEntity(kind) ||
(includeServices && isServiceEntity(kind))
) {
deletedFiles.push(filePath)
const canaryObjectName = getCanaryResourceName(name)
const baselineObjectName = getBaselineResourceName(name)
@@ -219,4 +227,6 @@ async function cleanUpCanary(
}
}
}
return deletedFiles
}