Skip to content
This repository has been archived by the owner on Jun 8, 2022. It is now read-only.

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
Signed-off-by: Hongchao Deng <[email protected]>
  • Loading branch information
hongchaodeng committed Sep 28, 2020
1 parent 450760e commit b3b7bfd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1333,8 +1333,9 @@ func TestDependency(t *testing.T) {

ac := &v1alpha2.ApplicationConfiguration{
ObjectMeta: metav1.ObjectMeta{
Name: "test-app",
Namespace: "test-ns",
Name: "test-app",
Namespace: "test-ns",
Generation: 0,
},
Spec: v1alpha2.ApplicationConfigurationSpec{
Components: tc.args.components,
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/v1alpha2/applicationconfiguration/render.go
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ func (r *components) getDataInput(ctx context.Context, s *dagSource, ac *unstruc

pavedAC := fieldpath.Pave(ac.UnstructuredContent())
var acGeneration int
if err := pavedAC.GetValueInto("metadata.generation", &acGeneration); err != nil {
if err := pavedAC.GetValueInto("metadata.generation", &acGeneration); err != nil && !fieldpath.IsNotFound(err) {
return nil, false, err.Error(), err
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ func TestRenderComponents(t *testing.T) {
oam.LabelAppName: acName,
oam.LabelAppComponentRevision: "",
oam.LabelOAMResourceType: oam.ResourceTypeWorkload,
oam.LabelAppGeneration: "0",
})
return w
}(),
Expand All @@ -214,6 +215,7 @@ func TestRenderComponents(t *testing.T) {
oam.LabelAppName: acName,
oam.LabelAppComponentRevision: "",
oam.LabelOAMResourceType: oam.ResourceTypeTrait,
oam.LabelAppGeneration: "0",
})
return &Trait{Object: *t}
}(),
Expand Down Expand Up @@ -275,6 +277,7 @@ func TestRenderComponents(t *testing.T) {
oam.LabelAppName: acName,
oam.LabelAppComponentRevision: revisionName,
oam.LabelOAMResourceType: oam.ResourceTypeWorkload,
oam.LabelAppGeneration: "0",
})
return w
}(),
Expand All @@ -289,6 +292,7 @@ func TestRenderComponents(t *testing.T) {
oam.LabelAppName: acName,
oam.LabelAppComponentRevision: revisionName,
oam.LabelOAMResourceType: oam.ResourceTypeTrait,
oam.LabelAppGeneration: "0",
})
return &Trait{Object: *t}
}(),
Expand Down Expand Up @@ -341,6 +345,7 @@ func TestRenderComponents(t *testing.T) {
oam.LabelAppName: acName,
oam.LabelAppComponentRevision: revisionName2,
oam.LabelOAMResourceType: oam.ResourceTypeWorkload,
oam.LabelAppGeneration: "0",
})
return w
}(),
Expand All @@ -355,6 +360,7 @@ func TestRenderComponents(t *testing.T) {
oam.LabelAppName: acName,
oam.LabelAppComponentRevision: revisionName2,
oam.LabelOAMResourceType: oam.ResourceTypeTrait,
oam.LabelAppGeneration: "0",
})
return &Trait{Object: *t}
}(),
Expand Down

0 comments on commit b3b7bfd

Please sign in to comment.