Repository: appc/spec
Pull request #663 (2016-10-13 14:52:13)

CRI: Rename CRIAnnotations, CRILabels to UserAnnotations, UserLabels


Patch:
diff --git a/discovery/http.go b/discovery/http.go
index 7f30e66..66a144b 100644
--- a/discovery/http.go
+++ b/discovery/http.go
@@ -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,
 	}
diff --git a/schema/pod.go b/schema/pod.go
index a1e036e..9ed6c9e 100644
--- a/schema/pod.go
+++ b/schema/pod.go
@@ -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
diff --git a/schema/types/app.go b/schema/types/app.go
index df383a2..0ef68c8 100644
--- a/schema/types/app.go
+++ b/schema/types/app.go
@@ -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
diff --git a/schema/types/cri_annotations.go b/schema/types/user_annotations.go
similarity index 82%
rename from schema/types/cri_annotations.go
rename to schema/types/user_annotations.go
index 5198760..63ba434 100644
--- a/schema/types/cri_annotations.go
+++ b/schema/types/user_annotations.go
@@ -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
diff --git a/schema/types/cri_labels.go b/schema/types/user_labels.go
similarity index 83%
rename from schema/types/cri_labels.go
rename to schema/types/user_labels.go
index 8a87cd0..5ed927c 100644
--- a/schema/types/cri_labels.go
+++ b/schema/types/user_labels.go
@@ -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


Test patch:
diff --git a/schema/types/app_test.go b/schema/types/app_test.go
index 91f1cba..ad5ee6f 100644
--- a/schema/types/app_test.go
+++ b/schema/types/app_test.go
@@ -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","UserAnnotations":{"weird!":"normal?"},"UserLabels":{"one!":"two?"}}`,
 			&App{
 				Exec: Exec{
 					"/a",
@@ -220,10 +220,10 @@ func TestAppUnmarshal(t *testing.T) {
 				User:        "0",
 				Group:       "0",
 				Environment: make(Environment, 0),
-				CRIAnnotations: CRIAnnotations{
+				UserAnnotations: UserAnnotations{
 					"weird!": "normal?",
 				},
-				CRILabels: CRILabels{
+				UserLabels: UserLabels{
 					"one!": "two?",
 				},
 			},