mirror of https://github.com/kubernetes/kops.git
Update tests/integration/channel/integration_test.go
Co-authored-by: Ciprian Hacman <ciprianhacman@gmail.com>
This commit is contained in:
parent
b0fd89a193
commit
5f59b86c78
|
|
@ -392,42 +392,26 @@ func semverString(sv *semver.Version) string {
|
|||
return sv.String()
|
||||
}
|
||||
|
||||
// All Image in stable hannel should have a specified upstream image prefix
|
||||
func TestStableChannel(t *testing.T) {
|
||||
sourcePath := "../../../channels/stable"
|
||||
sourceBytes, err := ioutil.ReadFile(sourcePath)
|
||||
if err != nil {
|
||||
t.Fatalf("unexpected error reading sourcePath %q: %v", sourcePath, err)
|
||||
}
|
||||
// All Images in channel should have a specified upstream image prefix
|
||||
func TestChannelImages(t *testing.T) {
|
||||
for _, channel := range []string{"stable", "alpha"} {
|
||||
t.Run(channel+"-channel", func(t *testing.T) {
|
||||
sourcePath := "../../../channels/" + channel
|
||||
sourceBytes, err := ioutil.ReadFile(sourcePath)
|
||||
if err != nil {
|
||||
t.Fatalf("unexpected error reading sourcePath %q: %v", sourcePath, err)
|
||||
}
|
||||
|
||||
channel, err := kops.ParseChannel(sourceBytes)
|
||||
if err != nil {
|
||||
t.Fatalf("failed to parse channel: %v", err)
|
||||
}
|
||||
channel, err := kops.ParseChannel(sourceBytes)
|
||||
if err != nil {
|
||||
t.Fatalf("failed to parse channel: %v", err)
|
||||
}
|
||||
|
||||
for _, image := range channel.Spec.Images {
|
||||
if !channel.HasUpstreamImagePrefix(image.Name) {
|
||||
t.Errorf("Stable image '%s' has not a recognized prefix. Add the correct prefix to HasUpstreamImagePrefix function", image.Name)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// All Image in stable hannel should have a specified upstream image prefix
|
||||
func TestAlphaChannel(t *testing.T) {
|
||||
sourcePath := "../../../channels/alpha"
|
||||
sourceBytes, err := ioutil.ReadFile(sourcePath)
|
||||
if err != nil {
|
||||
t.Fatalf("unexpected error reading sourcePath %q: %v", sourcePath, err)
|
||||
}
|
||||
|
||||
channel, err := kops.ParseChannel(sourceBytes)
|
||||
if err != nil {
|
||||
t.Fatalf("failed to parse channel: %v", err)
|
||||
}
|
||||
|
||||
for _, image := range channel.Spec.Images {
|
||||
if !channel.HasUpstreamImagePrefix(image.Name) {
|
||||
t.Errorf("Alpha image channel '%s' has not a recognized prefix. Add the correct prefix to HasUpstreamImagePrefix function", image.Name)
|
||||
}
|
||||
for _, image := range channel.Spec.Images {
|
||||
if !channel.HasUpstreamImagePrefix(image.Name) {
|
||||
t.Errorf("unknown image prefix: %q", image.Name)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue