exit 1 if status are not as expected(order)

Signed-off-by: Paco Xu <paco.xu@daocloud.io>
This commit is contained in:
Paco Xu 2023-06-18 13:54:33 +08:00
parent fa78f28f0a
commit f44029705f
2 changed files with 4 additions and 0 deletions

View File

@ -25,6 +25,8 @@ import (
"os/exec"
"sort"
"strings"
"github.com/google/go-cmp/cmp"
)
type Unwanted struct {
@ -269,6 +271,7 @@ func main() {
if !bytes.Equal(expected, actual) {
log.Printf("Expected status of\n%s", string(expected))
log.Printf("Got status of\n%s", string(actual))
log.Fatal("Status diff:\n", cmp.Diff(actual, expected))
}
for expectedRef, expectedFrom := range configFromFile.Status.UnwantedReferences {
actualFrom, ok := config.Status.UnwantedReferences[expectedRef]

View File

@ -43,6 +43,7 @@ rc=0
# List of dependencies we need to avoid dragging back into kubernetes/kubernetes
# Check if unwanted dependencies are removed
# The array and map in `unwanted-dependencies.json` are in alphabetical order.
go run k8s.io/kubernetes/cmd/dependencyverifier "${KUBE_ROOT}/hack/unwanted-dependencies.json"
outdated=$(go list -m -json all | jq -r "