Add glide.yaml and vendor deps
This commit is contained in:
parent
db918f12ad
commit
5b3d5e81bd
18880 changed files with 5166045 additions and 1 deletions
2
vendor/k8s.io/kubernetes/test/images/porter/.gitignore
generated
vendored
Normal file
2
vendor/k8s.io/kubernetes/test/images/porter/.gitignore
generated
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
porter
|
||||
.tag
|
||||
17
vendor/k8s.io/kubernetes/test/images/porter/BUILD
generated
vendored
Normal file
17
vendor/k8s.io/kubernetes/test/images/porter/BUILD
generated
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
licenses(["notice"])
|
||||
|
||||
load(
|
||||
"@io_bazel_rules_go//go:def.bzl",
|
||||
"go_binary",
|
||||
"go_library",
|
||||
"go_test",
|
||||
"cgo_library",
|
||||
)
|
||||
|
||||
go_binary(
|
||||
name = "porter",
|
||||
srcs = ["porter.go"],
|
||||
tags = ["automanaged"],
|
||||
)
|
||||
20
vendor/k8s.io/kubernetes/test/images/porter/Dockerfile
generated
vendored
Normal file
20
vendor/k8s.io/kubernetes/test/images/porter/Dockerfile
generated
vendored
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
# Copyright 2016 The Kubernetes Authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
FROM scratch
|
||||
MAINTAINER Daniel Smith <dbsmith@google.com>
|
||||
ADD localhost.crt localhost.crt
|
||||
ADD localhost.key localhost.key
|
||||
ADD porter porter
|
||||
ENTRYPOINT ["/porter"]
|
||||
47
vendor/k8s.io/kubernetes/test/images/porter/Makefile
generated
vendored
Normal file
47
vendor/k8s.io/kubernetes/test/images/porter/Makefile
generated
vendored
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
# Copyright 2016 The Kubernetes Authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Use:
|
||||
#
|
||||
# `make porter` will build porter.
|
||||
# `make tag` will suggest a tag.
|
||||
# `make image` will build an image-- you must supply a tag.
|
||||
# `make push` will push the image-- you must supply a tag.
|
||||
|
||||
# This image does not tag in the normal way
|
||||
# TAG =
|
||||
PREFIX = gcr.io/google_containers
|
||||
SUGGESTED_TAG = $(shell git rev-parse --verify HEAD)
|
||||
|
||||
porter: porter.go
|
||||
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-w' ./porter.go
|
||||
|
||||
tag:
|
||||
@echo "If all relevant changes are committed, suggest using TAG=$(SUGGESTED_TAG)"
|
||||
@echo "$$ make container TAG=$(SUGGESTED_TAG)"
|
||||
@echo "or"
|
||||
@echo "$$ make push TAG=$(SUGGESTED_TAG)"
|
||||
|
||||
container: image
|
||||
|
||||
image:
|
||||
$(if $(TAG),,$(error TAG is not defined. Use 'make tag' after committing changes to see a suggestion))
|
||||
docker build -t $(PREFIX)/porter:$(TAG) .
|
||||
|
||||
push:
|
||||
$(if $(TAG),,$(error TAG is not defined. Use 'make tag' after committing changes to see a suggestion))
|
||||
gcloud docker -- push $(PREFIX)/porter:$(TAG)
|
||||
|
||||
clean:
|
||||
rm -f porter
|
||||
12
vendor/k8s.io/kubernetes/test/images/porter/README.md
generated
vendored
Normal file
12
vendor/k8s.io/kubernetes/test/images/porter/README.md
generated
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
This directory contains go source, Dockerfile and Makefile for making a test
|
||||
container which serves requested data on ports specified in ENV variables.
|
||||
|
||||
The included localhost.crt is a PEM-encoded TLS cert with SAN IPs
|
||||
"127.0.0.1" and "[::1]", expiring at the last second of 2049 (the end
|
||||
of ASN.1 time), generated from src/crypto/tls:
|
||||
go run generate_cert.go --rsa-bits 512 --host 127.0.0.1,::1,example.com --ca --start-date "Jan 1 00:00:00 1970" --duration=1000000h
|
||||
|
||||
To use a different cert/key, mount them into the pod and set the
|
||||
CERT_FILE and KEY_FILE environment variables to the desired paths.
|
||||
|
||||
[]()
|
||||
10
vendor/k8s.io/kubernetes/test/images/porter/localhost.crt
generated
vendored
Normal file
10
vendor/k8s.io/kubernetes/test/images/porter/localhost.crt
generated
vendored
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
-----BEGIN CERTIFICATE-----
|
||||
MIIBdzCCASOgAwIBAgIBADALBgkqhkiG9w0BAQUwEjEQMA4GA1UEChMHQWNtZSBD
|
||||
bzAeFw03MDAxMDEwMDAwMDBaFw00OTEyMzEyMzU5NTlaMBIxEDAOBgNVBAoTB0Fj
|
||||
bWUgQ28wWjALBgkqhkiG9w0BAQEDSwAwSAJBAN55NcYKZeInyTuhcCwFMhDHCmwa
|
||||
IUSdtXdcbItRB/yfXGBhiex00IaLXQnSU+QZPRZWYqeTEbFSgihqi1PUDy8CAwEA
|
||||
AaNoMGYwDgYDVR0PAQH/BAQDAgCkMBMGA1UdJQQMMAoGCCsGAQUFBwMBMA8GA1Ud
|
||||
EwEB/wQFMAMBAf8wLgYDVR0RBCcwJYILZXhhbXBsZS5jb22HBH8AAAGHEAAAAAAA
|
||||
AAAAAAAAAAAAAAEwCwYJKoZIhvcNAQEFA0EAAoQn/ytgqpiLcZu9XKbCJsJcvkgk
|
||||
Se6AbGXgSlq+ZCEVo0qIwSgeBqmsJxUu7NCSOwVJLYNEBO2DtIxoYVk+MA==
|
||||
-----END CERTIFICATE-----
|
||||
9
vendor/k8s.io/kubernetes/test/images/porter/localhost.key
generated
vendored
Normal file
9
vendor/k8s.io/kubernetes/test/images/porter/localhost.key
generated
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIBPAIBAAJBAN55NcYKZeInyTuhcCwFMhDHCmwaIUSdtXdcbItRB/yfXGBhiex0
|
||||
0IaLXQnSU+QZPRZWYqeTEbFSgihqi1PUDy8CAwEAAQJBAQdUx66rfh8sYsgfdcvV
|
||||
NoafYpnEcB5s4m/vSVe6SU7dCK6eYec9f9wpT353ljhDUHq3EbmE4foNzJngh35d
|
||||
AekCIQDhRQG5Li0Wj8TM4obOnnXUXf1jRv0UkzE9AHWLG5q3AwIhAPzSjpYUDjVW
|
||||
MCUXgckTpKCuGwbJk7424Nb8bLzf3kllAiA5mUBgjfr/WtFSJdWcPQ4Zt9KTMNKD
|
||||
EUO0ukpTwEIl6wIhAMbGqZK3zAAFdq8DD2jPx+UJXnh0rnOkZBzDtJ6/iN69AiEA
|
||||
1Aq8MJgTaYsDQWyU/hDq5YkDJc9e9DSCvUIzqxQWMQE=
|
||||
-----END RSA PRIVATE KEY-----
|
||||
59
vendor/k8s.io/kubernetes/test/images/porter/pod.json
generated
vendored
Normal file
59
vendor/k8s.io/kubernetes/test/images/porter/pod.json
generated
vendored
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
{
|
||||
"kind": "Pod",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "porter"
|
||||
},
|
||||
"spec": {
|
||||
"containers": [
|
||||
{
|
||||
"name": "porter",
|
||||
"image": "gcr.io/google_containers/porter:cd5cb5791ebaa8641955f0e8c2a9bed669b1eaab",
|
||||
"env": [
|
||||
{
|
||||
"name": "SERVE_PORT_80",
|
||||
"value": "foo"
|
||||
},
|
||||
{
|
||||
"name": "SERVE_PORT_81",
|
||||
"value": "<html><head></head><body><a href=\"/rewriteme\">rewritten link</a></body></html>"
|
||||
},
|
||||
{
|
||||
"name": "SERVE_TLS_PORT_443",
|
||||
"value": "tls foo"
|
||||
},
|
||||
{
|
||||
"name": "SERVE_TLS_PORT_444",
|
||||
"value": "<html><head></head><body><a href=\"/tls-rewriteme\">tls rewritten link</a></body></html>"
|
||||
},
|
||||
{
|
||||
"name": "CERT_FILE",
|
||||
"value": "/localhost.crt"
|
||||
},
|
||||
{
|
||||
"name": "KEY_FILE",
|
||||
"value": "/localhost.key"
|
||||
}
|
||||
],
|
||||
"ports": [
|
||||
{
|
||||
"name": "p80",
|
||||
"containerPort": 80
|
||||
},
|
||||
{
|
||||
"name": "p81",
|
||||
"containerPort": 81
|
||||
},
|
||||
{
|
||||
"name": "p443",
|
||||
"containerPort": 443
|
||||
},
|
||||
{
|
||||
"name": "p444",
|
||||
"containerPort": 444
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
82
vendor/k8s.io/kubernetes/test/images/porter/porter.go
generated
vendored
Normal file
82
vendor/k8s.io/kubernetes/test/images/porter/porter.go
generated
vendored
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
/*
|
||||
Copyright 2015 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// A tiny binary for testing ports.
|
||||
//
|
||||
// Reads env vars; for every var of the form SERVE_PORT_X, where X is a valid
|
||||
// port number, porter starts an HTTP server which serves the env var's value
|
||||
// in response to any query.
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
|
||||
const prefix = "SERVE_PORT_"
|
||||
const tlsPrefix = "SERVE_TLS_PORT_"
|
||||
|
||||
func main() {
|
||||
for _, vk := range os.Environ() {
|
||||
// Put everything before the first = sign in parts[0], and
|
||||
// everything else in parts[1] (even if there are multiple =
|
||||
// characters).
|
||||
parts := strings.SplitN(vk, "=", 2)
|
||||
key := parts[0]
|
||||
value := parts[1]
|
||||
if strings.HasPrefix(key, prefix) {
|
||||
port := strings.TrimPrefix(key, prefix)
|
||||
go servePort(port, value)
|
||||
}
|
||||
if strings.HasPrefix(key, tlsPrefix) {
|
||||
port := strings.TrimPrefix(key, tlsPrefix)
|
||||
go serveTLSPort(port, value)
|
||||
}
|
||||
}
|
||||
|
||||
select {}
|
||||
}
|
||||
|
||||
func servePort(port, value string) {
|
||||
s := &http.Server{
|
||||
Addr: "0.0.0.0:" + port,
|
||||
Handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
fmt.Fprint(w, value)
|
||||
}),
|
||||
}
|
||||
log.Printf("server on port %q failed: %v", port, s.ListenAndServe())
|
||||
}
|
||||
|
||||
func serveTLSPort(port, value string) {
|
||||
s := &http.Server{
|
||||
Addr: "0.0.0.0:" + port,
|
||||
Handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
fmt.Fprint(w, value)
|
||||
}),
|
||||
}
|
||||
certFile := os.Getenv("CERT_FILE")
|
||||
if len(certFile) == 0 {
|
||||
certFile = "localhost.crt"
|
||||
}
|
||||
keyFile := os.Getenv("KEY_FILE")
|
||||
if len(keyFile) == 0 {
|
||||
keyFile = "localhost.key"
|
||||
}
|
||||
log.Printf("tls server on port %q with certFile=%q, keyFile=%q failed: %v", port, certFile, keyFile, s.ListenAndServeTLS(certFile, keyFile))
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue