Fix diff behavior for buildOnPreview
This commit is contained in:
@@ -889,7 +889,7 @@ func (*Image) Diff(
|
|||||||
if !reflect.DeepEqual(olds.BuildArgs, news.BuildArgs) {
|
if !reflect.DeepEqual(olds.BuildArgs, news.BuildArgs) {
|
||||||
diff["buildArgs"] = update
|
diff["buildArgs"] = update
|
||||||
}
|
}
|
||||||
if olds.BuildOnPreview != news.BuildOnPreview {
|
if !reflect.DeepEqual(olds.BuildOnPreview, news.BuildOnPreview) {
|
||||||
diff["buildOnPreview"] = update
|
diff["buildOnPreview"] = update
|
||||||
}
|
}
|
||||||
if !reflect.DeepEqual(olds.Builder, news.Builder) {
|
if !reflect.DeepEqual(olds.Builder, news.Builder) {
|
||||||
|
|||||||
@@ -518,7 +518,7 @@ func TestImageDiff(t *testing.T) {
|
|||||||
wantChanges: true,
|
wantChanges: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "diff if buildOnPreview changes",
|
name: "diff if buildOnPreview doesn't change",
|
||||||
olds: func(*testing.T, ImageState) ImageState { return baseState },
|
olds: func(*testing.T, ImageState) ImageState { return baseState },
|
||||||
news: func(t *testing.T, ia ImageArgs) ImageArgs {
|
news: func(t *testing.T, ia ImageArgs) ImageArgs {
|
||||||
val := true
|
val := true
|
||||||
@@ -527,6 +527,16 @@ func TestImageDiff(t *testing.T) {
|
|||||||
},
|
},
|
||||||
wantChanges: true,
|
wantChanges: true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "diff if buildOnPreview changes",
|
||||||
|
olds: func(*testing.T, ImageState) ImageState { return baseState },
|
||||||
|
news: func(t *testing.T, ia ImageArgs) ImageArgs {
|
||||||
|
val := false
|
||||||
|
ia.BuildOnPreview = &val
|
||||||
|
return ia
|
||||||
|
},
|
||||||
|
wantChanges: true,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "diff if ssh changes",
|
name: "diff if ssh changes",
|
||||||
olds: func(*testing.T, ImageState) ImageState { return baseState },
|
olds: func(*testing.T, ImageState) ImageState { return baseState },
|
||||||
|
|||||||
Reference in New Issue
Block a user