mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-12-25 15:39:37 -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 {
|
||||
measurements measurements.M
|
||||
shortPath string
|
||||
wantImage string
|
||||
imageRef string
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
wantImage, err := fetchWantImage(ctx, versionsClient, csp, versionsapi.ImageInfo{
|
||||
imageRef, err := fetchImageRef(ctx, versionsClient, csp, versionsapi.ImageInfo{
|
||||
Ref: ver.Ref,
|
||||
Stream: ver.Stream,
|
||||
Version: ver.Version,
|
||||
@ -69,7 +69,7 @@ func fetchUpgradeInfo(ctx context.Context, csp cloudprovider.Provider, toImage s
|
||||
if err != nil {
|
||||
return upgradeInfo{}, err
|
||||
}
|
||||
info.wantImage = wantImage
|
||||
info.imageRef = imageRef
|
||||
|
||||
return info, nil
|
||||
}
|
||||
@ -124,7 +124,7 @@ func getFromURL(ctx context.Context, client *http.Client, sourceURL *url.URL) ([
|
||||
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)
|
||||
if err != nil {
|
||||
return "", err
|
||||
|
@ -192,7 +192,7 @@ func writeUpgradeConfig(require *require.Assertions, image string, kubernetes st
|
||||
err = fileHandler.WriteYAML(constants.ConfigFilename, cfg, file.OptOverwrite)
|
||||
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) {
|
||||
@ -226,8 +226,8 @@ func testNodesEventuallyHaveVersion(t *testing.T, k *kubernetes.Clientset, targe
|
||||
for _, node := range nodes.Items {
|
||||
for key, value := range node.Annotations {
|
||||
if key == "constellation.edgeless.systems/node-image" {
|
||||
log.Printf("\t%s: Image %s\n", node.Name, value)
|
||||
if value != targetVersions.image {
|
||||
if !strings.EqualFold(value, targetVersions.imageRef) {
|
||||
log.Printf("\t%s: Image %s, want %s\n", node.Name, value, targetVersions.imageRef)
|
||||
allUpdated = false
|
||||
}
|
||||
}
|
||||
@ -329,7 +329,7 @@ func testNodesEventuallyAvailable(t *testing.T, k *kubernetes.Clientset, wantCon
|
||||
}
|
||||
|
||||
type versionContainer struct {
|
||||
image string
|
||||
imageRef string
|
||||
kubernetes semver.Semver
|
||||
microservices string
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user