diff --git a/discovery/http.go b/discovery/http.go index 7f30e668..66a144b9 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 a1e036e3..9ed6c9e0 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 df383a26..0ef68c89 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/app_test.go b/schema/types/app_test.go index 91f1cbad..ad5ee6fe 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?", }, }, 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 51987604..63ba434e 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 8a87cd07..5ed927c9 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