Skip to content
This repository has been archived by the owner on Aug 14, 2020. It is now read-only.

CRI: Change CRILabels type to map[string]string. #657

Merged
merged 1 commit into from
Sep 21, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions schema/types/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,5 @@ func (a *App) assertValid() error {
if err := a.Isolators.assertValid(); err != nil {
return err
}
if err := a.CRILabels.assertValid(); err != nil {
return err
}
return nil
}
9 changes: 2 additions & 7 deletions schema/types/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ func TestAppUnmarshal(t *testing.T) {
false,
},
{
`{"Exec":["/a"],"User":"0","Group":"0","CRIAnnotations":{"weird!":"normal?"},"CRILabels":{"one":"two"}}`,
`{"Exec":["/a"],"User":"0","Group":"0","CRIAnnotations":{"weird!":"normal?"},"CRILabels":{"one!":"two?"}}`,
&App{
Exec: Exec{
"/a",
Expand All @@ -224,16 +224,11 @@ func TestAppUnmarshal(t *testing.T) {
"weird!": "normal?",
},
CRILabels: CRILabels{
"one": "two",
"one!": "two?",
},
},
false,
},
{
`{"Exec":["/a"],"User":"0","Group":"0","CRIAnnotations":{"weird!":"normal?"},"CRILabels":{"!one":"two"}}`,
&App{},
true,
},
}
for i, tt := range tests {
a := &App{}
Expand Down
17 changes: 2 additions & 15 deletions schema/types/cri_labels.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,5 @@

package types

import "fmt"

type CRILabels map[ACIdentifier]string

func (l CRILabels) assertValid() error {
for k, _ := range l {
if err := k.assertValid(); err != nil {
return err
}
if len(k) > 63 {
return fmt.Errorf(`label %q too long`, k)
}
}
return nil
}
// CRILabels are arbitrary key-value pairs
type CRILabels map[string]string
52 changes: 0 additions & 52 deletions schema/types/cri_labels_test.go

This file was deleted.