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

Commit

Permalink
Merge pull request #663 from squeed/cri-annotations
Browse files Browse the repository at this point in the history
CRI: Rename CRIAnnotations, CRILabels to UserAnnotations, UserLabels
  • Loading branch information
jonboulle authored Oct 13, 2016
2 parents c204336 + f8bc8a9 commit 3fddc8f
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 30 deletions.
9 changes: 7 additions & 2 deletions discovery/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,13 @@ func init() {
httpDo = Client

// copy for InsecureTLS
tInsecureTLS := *t
tInsecureTLS.TLSClientConfig = &tls.Config{InsecureSkipVerify: true}
tInsecureTLS := http.Transport{
Proxy: http.ProxyFromEnvironment,
Dial: func(n, a string) (net.Conn, error) {
return net.DialTimeout(n, a, defaultDialTimeout)
},
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
}
ClientInsecureTLS = &http.Client{
Transport: &tInsecureTLS,
}
Expand Down
18 changes: 9 additions & 9 deletions schema/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ import (
const PodManifestKind = types.ACKind("PodManifest")

type PodManifest struct {
ACVersion types.SemVer `json:"acVersion"`
ACKind types.ACKind `json:"acKind"`
Apps AppList `json:"apps"`
Volumes []types.Volume `json:"volumes"`
Isolators []types.Isolator `json:"isolators"`
Annotations types.Annotations `json:"annotations"`
Ports []types.ExposedPort `json:"ports"`
CRIAnnotations types.CRIAnnotations `json:"criAnnotations,omitempty"`
CRILabels types.CRILabels `json:"criLabels,omitempty"`
ACVersion types.SemVer `json:"acVersion"`
ACKind types.ACKind `json:"acKind"`
Apps AppList `json:"apps"`
Volumes []types.Volume `json:"volumes"`
Isolators []types.Isolator `json:"isolators"`
Annotations types.Annotations `json:"annotations"`
Ports []types.ExposedPort `json:"ports"`
UserAnnotations types.UserAnnotations `json:"userAnnotations,omitempty"`
UserLabels types.UserLabels `json:"userLabels,omitempty"`
}

// podManifest is a model to facilitate extra validation during the
Expand Down
24 changes: 12 additions & 12 deletions schema/types/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ import (
)

type App struct {
Exec Exec `json:"exec"`
EventHandlers []EventHandler `json:"eventHandlers,omitempty"`
User string `json:"user"`
Group string `json:"group"`
SupplementaryGIDs []int `json:"supplementaryGIDs,omitempty"`
WorkingDirectory string `json:"workingDirectory,omitempty"`
Environment Environment `json:"environment,omitempty"`
MountPoints []MountPoint `json:"mountPoints,omitempty"`
Ports []Port `json:"ports,omitempty"`
Isolators Isolators `json:"isolators,omitempty"`
CRIAnnotations CRIAnnotations `json:"criAnnotations,omitempty"`
CRILabels CRILabels `json:"criLabels,omitempty"`
Exec Exec `json:"exec"`
EventHandlers []EventHandler `json:"eventHandlers,omitempty"`
User string `json:"user"`
Group string `json:"group"`
SupplementaryGIDs []int `json:"supplementaryGIDs,omitempty"`
WorkingDirectory string `json:"workingDirectory,omitempty"`
Environment Environment `json:"environment,omitempty"`
MountPoints []MountPoint `json:"mountPoints,omitempty"`
Ports []Port `json:"ports,omitempty"`
Isolators Isolators `json:"isolators,omitempty"`
UserAnnotations UserAnnotations `json:"userAnnotations,omitempty"`
UserLabels UserLabels `json:"userLabels,omitempty"`
}

// app is a model to facilitate extra validation during the
Expand Down
6 changes: 3 additions & 3 deletions schema/types/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,18 +212,18 @@ func TestAppUnmarshal(t *testing.T) {
false,
},
{
`{"Exec":["/a"],"User":"0","Group":"0","CRIAnnotations":{"weird!":"normal?"},"CRILabels":{"one!":"two?"}}`,
`{"Exec":["/a"],"User":"0","Group":"0","UserAnnotations":{"weird!":"normal?"},"UserLabels":{"one!":"two?"}}`,
&App{
Exec: Exec{
"/a",
},
User: "0",
Group: "0",
Environment: make(Environment, 0),
CRIAnnotations: CRIAnnotations{
UserAnnotations: UserAnnotations{
"weird!": "normal?",
},
CRILabels: CRILabels{
UserLabels: UserLabels{
"one!": "two?",
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@

package types

// CRIAnnotations are arbitrary key-value pairs
type CRIAnnotations map[string]string
// UserAnnotations are arbitrary key-value pairs, to be supplied and interpreted by the user
type UserAnnotations map[string]string
4 changes: 2 additions & 2 deletions schema/types/cri_labels.go → schema/types/user_labels.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@

package types

// CRILabels are arbitrary key-value pairs
type CRILabels map[string]string
// UserLabels are arbitrary key-value pairs, to be supplied and interpreted by the user
type UserLabels map[string]string

0 comments on commit 3fddc8f

Please sign in to comment.