Skip to content

Commit

Permalink
PartialObjectMetadataList should nest values, not pointers for Items
Browse files Browse the repository at this point in the history
Typo during setting up PartialObjectMetadataList, it should be a slice
of `PartialObjectMetadata`, not a slice of `*PartialObjectMetadata`.
  • Loading branch information
smarterclayton committed May 13, 2019
1 parent 3d12466 commit f25efd1
Show file tree
Hide file tree
Showing 9 changed files with 207 additions and 215 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func Test_convertor_ConvertToTable(t *testing.T) {
},
args: args{
obj: &metav1beta1.PartialObjectMetadataList{
Items: []*metav1beta1.PartialObjectMetadata{
Items: []metav1beta1.PartialObjectMetadata{
{ObjectMeta: metav1.ObjectMeta{Name: "blah", CreationTimestamp: metav1.NewTime(time.Unix(1, 0))}},
{ObjectMeta: metav1.ObjectMeta{Name: "blah-2", CreationTimestamp: metav1.NewTime(time.Unix(2, 0))}},
},
Expand Down
350 changes: 175 additions & 175 deletions staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/generated.pb.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -1309,5 +1309,5 @@ type PartialObjectMetadataList struct {
ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`

// items contains each of the included items.
Items []*PartialObjectMetadata `json:"items" protobuf:"bytes,2,rep,name=items"`
Items []PartialObjectMetadata `json:"items" protobuf:"bytes,2,rep,name=items"`
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ type PartialObjectMetadataList struct {
v1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,2,opt,name=metadata"`

// items contains each of the included items.
Items []*v1.PartialObjectMetadata `json:"items" protobuf:"bytes,1,rep,name=items"`
Items []v1.PartialObjectMetadata `json:"items" protobuf:"bytes,1,rep,name=items"`
}

const (
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -2378,7 +2378,7 @@ func TestGetPartialObjectMetadata(t *testing.T) {
ResourceVersion: "10",
SelfLink: "/test/link",
},
Items: []*metav1beta1.PartialObjectMetadata{
Items: []metav1beta1.PartialObjectMetadata{
{
TypeMeta: metav1.TypeMeta{APIVersion: "meta.k8s.io/v1beta1", Kind: "PartialObjectMetadata"},
ObjectMeta: metav1.ObjectMeta{Name: "foo1", Namespace: "ns1", CreationTimestamp: now, UID: types.UID("newer")},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ func asPartialObjectMetadataList(result runtime.Object, groupVersion schema.Grou
}
partial := meta.AsPartialObjectMetadata(m)
partial.GetObjectKind().SetGroupVersionKind(gvk)
list.Items = append(list.Items, partial)
list.Items = append(list.Items, *partial)
return nil
})
if err != nil {
Expand All @@ -240,7 +240,7 @@ func asPartialObjectMetadataList(result runtime.Object, groupVersion schema.Grou
}
partial := meta.AsPartialObjectMetadata(m)
partial.GetObjectKind().SetGroupVersionKind(gvk)
list.Items = append(list.Items, partial)
list.Items = append(list.Items, *partial)
return nil
})
if err != nil {
Expand Down

0 comments on commit f25efd1

Please sign in to comment.