mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-01-13 00:19:32 -05:00
ci: e2e-upgrade, case-insensitive string compare
This commit is contained in:
parent
481eeeaf3e
commit
e72fb954f1
@ -28,7 +28,7 @@ import (
|
|||||||
type upgradeInfo struct {
|
type upgradeInfo struct {
|
||||||
measurements measurements.M
|
measurements measurements.M
|
||||||
shortPath string
|
shortPath string
|
||||||
wantImage string
|
imageRef string
|
||||||
}
|
}
|
||||||
|
|
||||||
func fetchUpgradeInfo(ctx context.Context, csp cloudprovider.Provider, toImage string) (upgradeInfo, error) {
|
func fetchUpgradeInfo(ctx context.Context, csp cloudprovider.Provider, toImage string) (upgradeInfo, error) {
|
||||||
@ -61,7 +61,7 @@ func fetchUpgradeInfo(ctx context.Context, csp cloudprovider.Provider, toImage s
|
|||||||
}
|
}
|
||||||
info.measurements = fetchedMeasurements
|
info.measurements = fetchedMeasurements
|
||||||
|
|
||||||
wantImage, err := fetchWantImage(ctx, versionsClient, csp, versionsapi.ImageInfo{
|
imageRef, err := fetchImageRef(ctx, versionsClient, csp, versionsapi.ImageInfo{
|
||||||
Ref: ver.Ref,
|
Ref: ver.Ref,
|
||||||
Stream: ver.Stream,
|
Stream: ver.Stream,
|
||||||
Version: ver.Version,
|
Version: ver.Version,
|
||||||
@ -69,7 +69,7 @@ func fetchUpgradeInfo(ctx context.Context, csp cloudprovider.Provider, toImage s
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return upgradeInfo{}, err
|
return upgradeInfo{}, err
|
||||||
}
|
}
|
||||||
info.wantImage = wantImage
|
info.imageRef = imageRef
|
||||||
|
|
||||||
return info, nil
|
return info, nil
|
||||||
}
|
}
|
||||||
@ -124,7 +124,7 @@ func getFromURL(ctx context.Context, client *http.Client, sourceURL *url.URL) ([
|
|||||||
return content, nil
|
return content, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func fetchWantImage(ctx context.Context, client *fetcher.Fetcher, csp cloudprovider.Provider, imageInfo versionsapi.ImageInfo) (string, error) {
|
func fetchImageRef(ctx context.Context, client *fetcher.Fetcher, csp cloudprovider.Provider, imageInfo versionsapi.ImageInfo) (string, error) {
|
||||||
imageInfo, err := client.FetchImageInfo(ctx, imageInfo)
|
imageInfo, err := client.FetchImageInfo(ctx, imageInfo)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
|
@ -192,7 +192,7 @@ func writeUpgradeConfig(require *require.Assertions, image string, kubernetes st
|
|||||||
err = fileHandler.WriteYAML(constants.ConfigFilename, cfg, file.OptOverwrite)
|
err = fileHandler.WriteYAML(constants.ConfigFilename, cfg, file.OptOverwrite)
|
||||||
require.NoError(err)
|
require.NoError(err)
|
||||||
|
|
||||||
return versionContainer{image: info.wantImage, kubernetes: kubernetesVersion, microservices: microserviceVersion}
|
return versionContainer{imageRef: info.imageRef, kubernetes: kubernetesVersion, microservices: microserviceVersion}
|
||||||
}
|
}
|
||||||
|
|
||||||
func testMicroservicesEventuallyHaveVersion(t *testing.T, wantMicroserviceVersion string, timeout time.Duration) {
|
func testMicroservicesEventuallyHaveVersion(t *testing.T, wantMicroserviceVersion string, timeout time.Duration) {
|
||||||
@ -226,8 +226,8 @@ func testNodesEventuallyHaveVersion(t *testing.T, k *kubernetes.Clientset, targe
|
|||||||
for _, node := range nodes.Items {
|
for _, node := range nodes.Items {
|
||||||
for key, value := range node.Annotations {
|
for key, value := range node.Annotations {
|
||||||
if key == "constellation.edgeless.systems/node-image" {
|
if key == "constellation.edgeless.systems/node-image" {
|
||||||
log.Printf("\t%s: Image %s\n", node.Name, value)
|
if !strings.EqualFold(value, targetVersions.imageRef) {
|
||||||
if value != targetVersions.image {
|
log.Printf("\t%s: Image %s, want %s\n", node.Name, value, targetVersions.imageRef)
|
||||||
allUpdated = false
|
allUpdated = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -329,7 +329,7 @@ func testNodesEventuallyAvailable(t *testing.T, k *kubernetes.Clientset, wantCon
|
|||||||
}
|
}
|
||||||
|
|
||||||
type versionContainer struct {
|
type versionContainer struct {
|
||||||
image string
|
imageRef string
|
||||||
kubernetes semver.Semver
|
kubernetes semver.Semver
|
||||||
microservices string
|
microservices string
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user