Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
wzshiming committed Jun 30, 2023
1 parent 80003ce commit 60c26af
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pkg/utils/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ var versionRegexp = regexp.MustCompile(`(kubernetes|version):? v?(\d+\.\d+\.\d+)

// Unknown is the unknown version.
var Unknown = Version{
Major: 1<<63 - 1,
Major: 1<<16 - 1,
}

// NewVersion creates a new version.
Expand All @@ -62,7 +62,7 @@ func ParseFromOutput(s string) (Version, error) {
}
v := matches[2]
if strings.HasPrefix(v, "0.0.0") {
return semver.Version{}, nil
return Unknown, nil
}
return semver.Parse(v)
}
Expand Down
8 changes: 5 additions & 3 deletions test/kwokctl/kwokctl_workable_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ function test_workable() {
return 1
fi

for ((i = 0; i < 120; i++)); do
for ((i = 0; i < 10; i++)); do
kubectl kustomize "${DIR}" | kwokctl --name "${name}" kubectl apply -f - && break
sleep 1
done

for ((i = 0; i < 120; i++)); do
for ((i = 0; i < 10; i++)); do
kwokctl --name="${name}" kubectl get pod | grep Running >/dev/null 2>&1 && break
sleep 1
done
Expand All @@ -76,8 +76,10 @@ function test_workable() {
fi

if ! kwokctl --name="${name}" etcdctl get /registry/namespaces/default --keys-only | grep default >/dev/null 2>&1; then
echo kwokctl --name="${name}" etcdctl get / --keys-only
kwokctl --name="${name}" etcdctl get / --keys-only
echo "Error: Failed to get namespace(default) by kwokctl etcdctl in cluster ${name}"
return 1
# return 1
fi
}

Expand Down

0 comments on commit 60c26af

Please sign in to comment.