diff --git a/cmd/validate_compose.go b/cmd/validate_compose.go index 79dd6bdc..ad7d55e3 100644 --- a/cmd/validate_compose.go +++ b/cmd/validate_compose.go @@ -39,6 +39,25 @@ var validateDockerCompose = &cobra.Command{ }, } +var validateDockerComposeWithErrors = &cobra.Command{ + Use: "docker-compose-with-errors", + Aliases: []string{"dcwe"}, + Short: "Verify docker-compose file for compatability with this tool with next versions of compose-go library", + Run: func(cmd *cobra.Command, args []string) { + dockerComposeFile, err := cmd.Flags().GetString("docker-compose") + if err != nil { + fmt.Println(fmt.Errorf("error reading docker-compose flag: %v", err)) + os.Exit(1) + } + + err = validateDockerComposeWithError(dockerComposeFile) + if err != nil { + fmt.Println(err.Error()) + os.Exit(1) + } + }, +} + // ValidateDockerCompose validate a docker-compose file func ValidateDockerCompose(file string, ignoreErrors, ignoreMisEnvFiles bool) error { _, _, err := lagoon.UnmarshaDockerComposeYAML(file, ignoreErrors, ignoreMisEnvFiles, map[string]string{}) @@ -48,8 +67,20 @@ func ValidateDockerCompose(file string, ignoreErrors, ignoreMisEnvFiles bool) er return nil } +// validateDockerComposeWithErrors validate a docker-compose file yaml structure properly +func validateDockerComposeWithError(file string) error { + err := lagoon.ValidateUnmarshalDockerComposeYAML(file) + if err != nil { + return err + } + return nil +} + func init() { validateCmd.AddCommand(validateDockerCompose) + validateCmd.AddCommand(validateDockerComposeWithErrors) validateDockerCompose.Flags().StringP("docker-compose", "", "docker-compose.yml", "The docker-compose.yml file to read.") + validateDockerComposeWithErrors.Flags().StringP("docker-compose", "", "docker-compose.yml", + "The docker-compose.yml file to read.") } diff --git a/go.mod b/go.mod index 9c8a7e66..3f5b6647 100644 --- a/go.mod +++ b/go.mod @@ -15,6 +15,7 @@ require ( github.com/uselagoon/machinery v0.0.7 github.com/vshn/k8up v1.99.99 gopkg.in/yaml.v2 v2.4.0 + gopkg.in/yaml.v3 v3.0.1 k8s.io/api v0.25.3 k8s.io/apimachinery v0.25.3 k8s.io/client-go v0.25.3 @@ -66,7 +67,6 @@ require ( google.golang.org/protobuf v1.28.1 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/inf.v0 v0.9.1 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/klog/v2 v2.80.1 // indirect k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect k8s.io/utils v0.0.0-20221012122500-cfd413dd9e85 // indirect diff --git a/internal/lagoon/compose.go b/internal/lagoon/compose.go index 75cc3001..072f5252 100644 --- a/internal/lagoon/compose.go +++ b/internal/lagoon/compose.go @@ -9,6 +9,7 @@ import ( "github.com/compose-spec/compose-go/loader" composetypes "github.com/compose-spec/compose-go/types" goyaml "gopkg.in/yaml.v2" + goyamlv3 "gopkg.in/yaml.v3" utilvalidation "k8s.io/apimachinery/pkg/util/validation" ) @@ -69,6 +70,20 @@ func UnmarshalLagoonDockerComposeYAML(file string) ([]OriginalServiceOrder, erro return l, nil } +// use goyamlv3 that newer versions of compose-go uses to validate +func ValidateUnmarshalDockerComposeYAML(file string) error { + rawYAML, err := os.ReadFile(file) + if err != nil { + return fmt.Errorf("couldn't read %v: %v", file, err) + } + var m interface{} + err = goyamlv3.Unmarshal(rawYAML, &m) + if err != nil { + return err + } + return nil +} + // Checks the validity of the service name against the RFC1035 DNS label standard func CheckServiceNameValidity(v goyaml.MapItem) error { // go over the service map looking for the labels slice diff --git a/internal/lagoon/compose_test.go b/internal/lagoon/compose_test.go index a6af27c8..636134f9 100644 --- a/internal/lagoon/compose_test.go +++ b/internal/lagoon/compose_test.go @@ -217,3 +217,103 @@ func TestCheckLagoonLabel(t *testing.T) { }) } } + +func TestUnmarshalLagoonDockerComposeYAML(t *testing.T) { + type args struct { + file string + } + tests := []struct { + name string + args args + wantErrMsg string + wantErr bool + }{ + { + name: "test1 docker-compose drupal example", + args: args{ + file: "../../test-resources/docker-compose/test1/docker-compose.yml", + }, + wantErr: true, + wantErrMsg: `line 59: mapping key "<<" already defined at line 58`, + }, + { + name: "test2 docker-compose node example", + args: args{ + file: "../../test-resources/docker-compose/test2/docker-compose.yml", + }, + }, + { + name: "test3 docker-compose complex", + args: args{ + file: "../../test-resources/docker-compose/test3/docker-compose.yml", + }, + }, + { + name: "test4 docker-compose complex", + args: args{ + file: "../../test-resources/docker-compose/test4/docker-compose.yml", + }, + }, + { + name: "test5 docker-compose complex", + args: args{ + file: "../../test-resources/docker-compose/test5/docker-compose.yml", + }, + wantErr: true, + wantErrMsg: `line 57: mapping key "<<" already defined at line 56`, + }, + { + name: "test6 docker-compose complex", + args: args{ + file: "../../test-resources/docker-compose/test6/docker-compose.yml", + }, + }, + // these tests are specific to docker-compose validations, but will pass yaml validations + { + name: "test7 check an invalid docker-compose with ignoring non-string key errors (valid yaml)", + args: args{ + file: "../../test-resources/docker-compose/test7/docker-compose.yml", + }, + }, + { + name: "test8 check an invalid docker-compose (same as test7 but not ignoring the errors)", + args: args{ + file: "../../test-resources/docker-compose/test8/docker-compose.yml", + }, + }, + { + name: "test9 check an valid docker-compose with missing env_files", + args: args{ + file: "../../test-resources/docker-compose/test9/docker-compose.yml", + }, + }, + { + name: "test10 check an valid docker-compose with missing env_files (same as test9 but not ignoring the errors)", + args: args{ + file: "../../test-resources/docker-compose/test10/docker-compose.yml", + }, + }, + { + name: "test11 docker-compose service name with '.'", + args: args{ + file: "../../test-resources/docker-compose/test11/docker-compose.yml", + }, + }, + // ^^ these tests are specific to docker-compose validations, but will pass yaml validations + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := ValidateUnmarshalDockerComposeYAML(tt.args.file) + if (err != nil) != tt.wantErr { + t.Errorf("ValidateUnmarshalDockerComposeYAML() error = %v, wantErr %v", err, tt.wantErr) + return + } + if err != nil { + if !strings.Contains(err.Error(), tt.wantErrMsg) { + t.Errorf("ValidateUnmarshalDockerComposeYAML() error = %v, wantErr %v", err.Error(), tt.wantErrMsg) + } + return + } + }) + } +} diff --git a/legacy/build-deploy-docker-compose.sh b/legacy/build-deploy-docker-compose.sh index 8ec81e3f..40133084 100755 --- a/legacy/build-deploy-docker-compose.sh +++ b/legacy/build-deploy-docker-compose.sh @@ -121,6 +121,7 @@ function patchBuildStep() { [ "$4" ] || return #namespace [ "$5" ] || return #buildstep [ "$6" ] || return #buildstep + [ "$7" ] || return #has warnings totalStartTime=$(date -d "${1}" +%s) startTime=$(date -d "${2}" +%s) endTime=$(date -d "${3}" +%s) @@ -132,7 +133,12 @@ function patchBuildStep() { diffTotalSeconds="$(($endTime-$totalStartTime))" diffTotalTime=$(date -d @${diffTotalSeconds} +"%H:%M:%S" -u) - echo -e "##############################################\nSTEP ${6}: Completed at ${3} (${timeZone}) Duration ${diffTime} Elapsed ${diffTotalTime}\n##############################################" + hasWarnings="" + if [ "${7}" == "true" ]; then + hasWarnings=" WithWarnings" + fi + + echo -e "##############################################\nSTEP ${6}: Completed at ${3} (${timeZone}) Duration ${diffTime} Elapsed ${diffTotalTime}${hasWarnings}\n##############################################" } ############################################## @@ -201,9 +207,10 @@ fi set +ex currentStepEnd="$(date +"%Y-%m-%d %H:%M:%S")" -patchBuildStep "${buildStartTime}" "${buildStartTime}" "${currentStepEnd}" "${NAMESPACE}" "initialSetup" "Initial Environment Setup" +patchBuildStep "${buildStartTime}" "${buildStartTime}" "${currentStepEnd}" "${NAMESPACE}" "initialSetup" "Initial Environment Setup" "false" previousStepEnd=${currentStepEnd} beginBuildStep "Docker Compose Validation" "dockerComposeValidation" +DOCKER_COMPOSE_WARNING_COUNT=0 ############################################## ### RUN docker compose config check against the provided docker-compose file ### use the `build-validate` built in validater to run over the provided docker-compose file @@ -212,7 +219,7 @@ dccOutput=$(bash -c 'build-deploy-tool validate docker-compose --docker-compose dccExit=$? if [ "${dccExit}" != "0" ]; then currentStepEnd="$(date +"%Y-%m-%d %H:%M:%S")" - patchBuildStep "${buildStartTime}" "${previousStepEnd}" "${currentStepEnd}" "${NAMESPACE}" "dockerComposeValidationError" "Docker Compose Validation" + patchBuildStep "${buildStartTime}" "${previousStepEnd}" "${currentStepEnd}" "${NAMESPACE}" "dockerComposeValidationError" "Docker Compose Validation" "false" previousStepEnd=${currentStepEnd} echo " ############################################## @@ -232,22 +239,51 @@ dccOutput=$(bash -c 'build-deploy-tool validate docker-compose --ignore-non-stri dccExit=$? if [ "${dccExit}" != "0" ]; then ((++BUILD_WARNING_COUNT)) - currentStepEnd="$(date +"%Y-%m-%d %H:%M:%S")" - patchBuildStep "${buildStartTime}" "${previousStepEnd}" "${currentStepEnd}" "${NAMESPACE}" "dockerComposeValidationWarning" "Docker Compose Validation" - previousStepEnd=${currentStepEnd} + ((++DOCKER_COMPOSE_WARNING_COUNT)) echo " ############################################## Warning! There are issues with your docker compose file that lagoon uses that should be fixed. You can run docker compose config locally to check that your docker-compose file is valid. +" + if [[ "${dccOutput}" =~ "no such file or directory" ]]; then + echo "> an env_file is defined in your docker-compose file, but no matching file found." + fi + if [[ "${dccOutput}" =~ "Non-string key" ]]; then + echo "> an invalid string key was detected in your docker-compose file." + fi + echo ERR: ${dccOutput} + echo "" +fi + +dccOutput=$(bash -c 'build-deploy-tool validate docker-compose-with-errors --docker-compose '${DOCKER_COMPOSE_YAML}'; exit $?' 2>&1) +dccExit2=$? +if [ "${dccExit2}" != "0" ]; then + ((++DOCKER_COMPOSE_WARNING_COUNT)) + if [ "${dccExit}" == "0" ]; then + ((++BUILD_WARNING_COUNT)) + echo " ############################################## +Warning! +There are issues with your docker compose file that lagoon uses that should be fixed. +You can run docker compose config locally to check that your docker-compose file is valid. " - echo ${dccOutput} - echo " -##############################################" + fi + echo "> There are yaml validation errors in your docker-compose file that should be corrected." + echo ERR: ${dccOutput} + echo "" +fi + +if [[ "$DOCKER_COMPOSE_WARNING_COUNT" -gt 0 ]]; then + echo "Read the docs for more on errors displayed here :LINK_TO_DOCS: +" + echo "##############################################" + currentStepEnd="$(date +"%Y-%m-%d %H:%M:%S")" + patchBuildStep "${buildStartTime}" "${previousStepEnd}" "${currentStepEnd}" "${NAMESPACE}" "dockerComposeValidationWarning" "Docker Compose Validation" "true" + previousStepEnd=${currentStepEnd} else currentStepEnd="$(date +"%Y-%m-%d %H:%M:%S")" - patchBuildStep "${buildStartTime}" "${previousStepEnd}" "${currentStepEnd}" "${NAMESPACE}" "dockerComposeValidation" "Docker Compose Validation" + patchBuildStep "${buildStartTime}" "${previousStepEnd}" "${currentStepEnd}" "${NAMESPACE}" "dockerComposeValidation" "Docker Compose Validation" "false" previousStepEnd=${currentStepEnd} fi @@ -261,7 +297,7 @@ lyvExit=$? if [ "${lyvExit}" != "0" ]; then currentStepEnd="$(date +"%Y-%m-%d %H:%M:%S")" - patchBuildStep "${buildStartTime}" "${previousStepEnd}" "${currentStepEnd}" "${NAMESPACE}" "lagoonYmlValidationError" ".lagoon.yml Validation" + patchBuildStep "${buildStartTime}" "${previousStepEnd}" "${currentStepEnd}" "${NAMESPACE}" "lagoonYmlValidationError" ".lagoon.yml Validation" "false" previousStepEnd=${currentStepEnd} echo " ############################################## @@ -290,7 +326,7 @@ else fi currentStepEnd="$(date +"%Y-%m-%d %H:%M:%S")" -patchBuildStep "${buildStartTime}" "${previousStepEnd}" "${currentStepEnd}" "${NAMESPACE}" "lagoonYmlValidation" ".lagoon.yml Validation" +patchBuildStep "${buildStartTime}" "${previousStepEnd}" "${currentStepEnd}" "${NAMESPACE}" "lagoonYmlValidation" ".lagoon.yml Validation" "false" previousStepEnd=${currentStepEnd} beginBuildStep "Configure Variables" "configuringVariables" set -x @@ -605,7 +641,7 @@ done set +x currentStepEnd="$(date +"%Y-%m-%d %H:%M:%S")" -patchBuildStep "${buildStartTime}" "${buildStartTime}" "${currentStepEnd}" "${NAMESPACE}" "configureVars" "Configure Variables" +patchBuildStep "${buildStartTime}" "${buildStartTime}" "${currentStepEnd}" "${NAMESPACE}" "configureVars" "Configure Variables" "false" previousStepEnd=${currentStepEnd} beginBuildStep "Image Builds" "buildingImages" set -x @@ -830,7 +866,7 @@ set -x set +x currentStepEnd="$(date +"%Y-%m-%d %H:%M:%S")" -patchBuildStep "${buildStartTime}" "${previousStepEnd}" "${currentStepEnd}" "${NAMESPACE}" "imageBuildComplete" "Image Builds" +patchBuildStep "${buildStartTime}" "${previousStepEnd}" "${currentStepEnd}" "${NAMESPACE}" "imageBuildComplete" "Image Builds" "false" previousStepEnd=${currentStepEnd} beginBuildStep "Pre-Rollout Tasks" "runningPreRolloutTasks" set -x @@ -845,7 +881,7 @@ else echo "pre-rollout tasks are currently disabled LAGOON_PREROLLOUT_DISABLED is set to true" set +x currentStepEnd="$(date +"%Y-%m-%d %H:%M:%S")" - patchBuildStep "${buildStartTime}" "${previousStepEnd}" "${currentStepEnd}" "${NAMESPACE}" "preRolloutsCompleted" "Pre-Rollout Tasks" + patchBuildStep "${buildStartTime}" "${previousStepEnd}" "${currentStepEnd}" "${NAMESPACE}" "preRolloutsCompleted" "Pre-Rollout Tasks" "false" set -x fi @@ -959,7 +995,7 @@ fi set +x currentStepEnd="$(date +"%Y-%m-%d %H:%M:%S")" -patchBuildStep "${buildStartTime}" "${previousStepEnd}" "${currentStepEnd}" "${NAMESPACE}" "serviceConfigurationComplete" "Service Configuration Phase 1" +patchBuildStep "${buildStartTime}" "${previousStepEnd}" "${currentStepEnd}" "${NAMESPACE}" "serviceConfigurationComplete" "Service Configuration Phase 1" "false" previousStepEnd=${currentStepEnd} beginBuildStep "Service Configuration Phase 2" "serviceConfigurationPhase2" set -x @@ -1174,7 +1210,7 @@ done set +x currentStepEnd="$(date +"%Y-%m-%d %H:%M:%S")" -patchBuildStep "${buildStartTime}" "${previousStepEnd}" "${currentStepEnd}" "${NAMESPACE}" "serviceConfiguration2Complete" "Service Configuration Phase 2" +patchBuildStep "${buildStartTime}" "${previousStepEnd}" "${currentStepEnd}" "${NAMESPACE}" "serviceConfiguration2Complete" "Service Configuration Phase 2" "false" previousStepEnd=${currentStepEnd} beginBuildStep "Route/Ingress Configuration" "configuringRoutes" set -x @@ -1320,7 +1356,7 @@ done set +x currentStepEnd="$(date +"%Y-%m-%d %H:%M:%S")" -patchBuildStep "${buildStartTime}" "${previousStepEnd}" "${currentStepEnd}" "${NAMESPACE}" "routeConfigurationComplete" "Route/Ingress Configuration" +patchBuildStep "${buildStartTime}" "${previousStepEnd}" "${currentStepEnd}" "${NAMESPACE}" "routeConfigurationComplete" "Route/Ingress Configuration" "false" previousStepEnd=${currentStepEnd} beginBuildStep "Image Push to Registry" "pushingImages" set -x @@ -1418,7 +1454,7 @@ fi set +x currentStepEnd="$(date +"%Y-%m-%d %H:%M:%S")" -patchBuildStep "${buildStartTime}" "${previousStepEnd}" "${currentStepEnd}" "${NAMESPACE}" "imagePushComplete" "Image Push to Registry" +patchBuildStep "${buildStartTime}" "${previousStepEnd}" "${currentStepEnd}" "${NAMESPACE}" "imagePushComplete" "Image Push to Registry" "false" previousStepEnd=${currentStepEnd} beginBuildStep "Backup Configuration" "configuringBackups" set -x @@ -1489,7 +1525,7 @@ fi set +x currentStepEnd="$(date +"%Y-%m-%d %H:%M:%S")" -patchBuildStep "${buildStartTime}" "${previousStepEnd}" "${currentStepEnd}" "${NAMESPACE}" "backupConfigurationComplete" "Backup Configuration" +patchBuildStep "${buildStartTime}" "${previousStepEnd}" "${currentStepEnd}" "${NAMESPACE}" "backupConfigurationComplete" "Backup Configuration" "false" previousStepEnd=${currentStepEnd} beginBuildStep "Deployment Templating" "templatingDeployments" set -x @@ -1641,7 +1677,7 @@ done set +x currentStepEnd="$(date +"%Y-%m-%d %H:%M:%S")" -patchBuildStep "${buildStartTime}" "${previousStepEnd}" "${currentStepEnd}" "${NAMESPACE}" "deploymentTemplatingComplete" "Deployment Templating" +patchBuildStep "${buildStartTime}" "${previousStepEnd}" "${currentStepEnd}" "${NAMESPACE}" "deploymentTemplatingComplete" "Deployment Templating" "false" previousStepEnd=${currentStepEnd} beginBuildStep "Applying Deployments" "applyingDeployments" set -x @@ -1707,7 +1743,7 @@ done set +x currentStepEnd="$(date +"%Y-%m-%d %H:%M:%S")" -patchBuildStep "${buildStartTime}" "${previousStepEnd}" "${currentStepEnd}" "${NAMESPACE}" "deploymentApplyComplete" "Applying Deployments" +patchBuildStep "${buildStartTime}" "${previousStepEnd}" "${currentStepEnd}" "${NAMESPACE}" "deploymentApplyComplete" "Applying Deployments" "false" previousStepEnd=${currentStepEnd} beginBuildStep "Cronjob Cleanup" "cleaningUpCronjobs" set -x @@ -1742,7 +1778,7 @@ done set +x currentStepEnd="$(date +"%Y-%m-%d %H:%M:%S")" -patchBuildStep "${buildStartTime}" "${previousStepEnd}" "${currentStepEnd}" "${NAMESPACE}" "cronjobCleanupComplete" "Cronjob Cleanup" +patchBuildStep "${buildStartTime}" "${previousStepEnd}" "${currentStepEnd}" "${NAMESPACE}" "cronjobCleanupComplete" "Cronjob Cleanup" "false" previousStepEnd=${currentStepEnd} beginBuildStep "Post-Rollout Tasks" "runningPostRolloutTasks" set -x @@ -1758,7 +1794,7 @@ else echo "post-rollout tasks are currently disabled LAGOON_POSTROLLOUT_DISABLED is set to true" set +x currentStepEnd="$(date +"%Y-%m-%d %H:%M:%S")" - patchBuildStep "${buildStartTime}" "${previousStepEnd}" "${currentStepEnd}" "${NAMESPACE}" "postRolloutsCompleted" "Post-Rollout Tasks" + patchBuildStep "${buildStartTime}" "${previousStepEnd}" "${currentStepEnd}" "${NAMESPACE}" "postRolloutsCompleted" "Post-Rollout Tasks" "false" set -x fi @@ -1805,23 +1841,9 @@ set -x set +x currentStepEnd="$(date +"%Y-%m-%d %H:%M:%S")" -patchBuildStep "${buildStartTime}" "${previousStepEnd}" "${currentStepEnd}" "${NAMESPACE}" "deployCompleted" "Build and Deploy" +patchBuildStep "${buildStartTime}" "${previousStepEnd}" "${currentStepEnd}" "${NAMESPACE}" "deployCompleted" "Build and Deploy" "false" previousStepEnd=${currentStepEnd} -if [[ "$BUILD_WARNING_COUNT" -gt 0 ]]; then - beginBuildStep "Completed With Warnings" "deployCompletedWithWarnings" - echo "This build completed with ${BUILD_WARNING_COUNT} warnings, you should scan the build for warnings and correct them as neccessary" - patchBuildStep "${buildStartTime}" "${previousStepEnd}" "${currentStepEnd}" "${NAMESPACE}" "deployCompletedWithWarnings" "Completed With Warnings" - previousStepEnd=${currentStepEnd} - # patch the buildpod with the buildstep - if [ "${SCC_CHECK}" == false ]; then - kubectl patch -n ${NAMESPACE} pod ${LAGOON_BUILD_NAME} \ - -p "{\"metadata\":{\"labels\":{\"lagoon.sh/buildStep\":\"deployCompletedWithWarnings\"}}}" &> /dev/null - # tiny sleep to allow patch to complete before logs roll again - sleep 5 - fi -fi - if [ "$(featureFlag INSIGHTS)" = enabled ]; then beginBuildStep "Insights Gathering" "gatheringInsights" ############################################## @@ -1837,13 +1859,13 @@ if [ "$(featureFlag INSIGHTS)" = enabled ]; then done currentStepEnd="$(date +"%Y-%m-%d %H:%M:%S")" - patchBuildStep "${buildStartTime}" "${previousStepEnd}" "${currentStepEnd}" "${NAMESPACE}" "insightsCompleted" "Insights Gathering" + patchBuildStep "${buildStartTime}" "${previousStepEnd}" "${currentStepEnd}" "${NAMESPACE}" "insightsCompleted" "Insights Gathering" "false" previousStepEnd=${currentStepEnd} if [[ "$BUILD_WARNING_COUNT" -gt 0 ]]; then beginBuildStep "Completed With Warnings" "deployCompletedWithWarnings" echo "This build completed with ${BUILD_WARNING_COUNT} warnings, you should scan the build for warnings and correct them as neccessary" - patchBuildStep "${buildStartTime}" "${previousStepEnd}" "${currentStepEnd}" "${NAMESPACE}" "deployCompletedWithWarnings" "Completed With Warnings" + patchBuildStep "${buildStartTime}" "${previousStepEnd}" "${currentStepEnd}" "${NAMESPACE}" "deployCompletedWithWarnings" "Completed With Warnings" "true" previousStepEnd=${currentStepEnd} # patch the buildpod with the buildstep if [ "${SCC_CHECK}" == false ]; then @@ -1857,7 +1879,7 @@ else if [[ "$BUILD_WARNING_COUNT" -gt 0 ]]; then beginBuildStep "Completed With Warnings" "deployCompletedWithWarnings" echo "This build completed with ${BUILD_WARNING_COUNT} warnings, you should scan the build for warnings and correct them as neccessary" - patchBuildStep "${buildStartTime}" "${previousStepEnd}" "${currentStepEnd}" "${NAMESPACE}" "deployCompletedWithWarnings" "Completed With Warnings" + patchBuildStep "${buildStartTime}" "${previousStepEnd}" "${currentStepEnd}" "${NAMESPACE}" "deployCompletedWithWarnings" "Completed With Warnings" "true" previousStepEnd=${currentStepEnd} # patch the buildpod with the buildstep if [ "${SCC_CHECK}" == false ]; then