mirror of https://github.com/k3s-io/k3s.git
commit
b4bb70d998
|
@ -12,3 +12,6 @@
|
|||
|
||||
# Emacs save files
|
||||
*~
|
||||
|
||||
# Go test binaries
|
||||
*.test
|
||||
|
|
|
@ -46,15 +46,8 @@ KUBE_TEMP=$(mktemp -d -t kubernetes.XXXXXX)
|
|||
trap "rm -rf ${KUBE_TEMP}" EXIT
|
||||
|
||||
get-password
|
||||
echo "Generating password: $user:$passwd"
|
||||
echo "Using password: $user:$passwd"
|
||||
htpasswd -b -c ${KUBE_TEMP}/htpasswd $user $passwd
|
||||
cat << EOF > ~/.kubernetes_auth
|
||||
{
|
||||
"User": "$user",
|
||||
"Password": "$passwd"
|
||||
}
|
||||
EOF
|
||||
chmod 0600 ~/.kubernetes_auth
|
||||
HTPASSWD=$(cat ${KUBE_TEMP}/htpasswd)
|
||||
|
||||
(
|
||||
|
|
|
@ -89,5 +89,14 @@ function get-password {
|
|||
fi
|
||||
user=admin
|
||||
passwd=$(python -c 'import string,random; print "".join(random.SystemRandom().choice(string.ascii_letters + string.digits) for _ in range(16))')
|
||||
|
||||
# Store password for reuse.
|
||||
cat << EOF > ~/.kubernetes_auth
|
||||
{
|
||||
"User": "$user",
|
||||
"Password": "$passwd"
|
||||
}
|
||||
EOF
|
||||
chmod 0600 ~/.kubernetes_auth
|
||||
}
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@ 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 basic integration test for the service.
|
||||
// Assumes that there is a pre-existing etcd server running on localhost.
|
||||
package main
|
||||
|
@ -26,7 +27,7 @@ import (
|
|||
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/apiserver"
|
||||
kube_client "github.com/GoogleCloudPlatform/kubernetes/pkg/client"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/registry"
|
||||
"github.com/coreos/go-etcd/etcd"
|
||||
)
|
||||
|
@ -42,13 +43,13 @@ func main() {
|
|||
reg := registry.MakeEtcdRegistry(etcdClient, machineList)
|
||||
|
||||
apiserver := apiserver.New(map[string]apiserver.RESTStorage{
|
||||
"pods": registry.MakePodRegistryStorage(reg, &kube_client.FakeContainerInfo{}, registry.MakeRoundRobinScheduler(machineList)),
|
||||
"pods": registry.MakePodRegistryStorage(reg, &client.FakeContainerInfo{}, registry.MakeRoundRobinScheduler(machineList)),
|
||||
"replicationControllers": registry.MakeControllerRegistryStorage(reg),
|
||||
}, "/api/v1beta1")
|
||||
server := httptest.NewServer(apiserver)
|
||||
|
||||
controllerManager := registry.MakeReplicationManager(etcd.NewClient(servers),
|
||||
kube_client.Client{
|
||||
client.Client{
|
||||
Host: server.URL,
|
||||
})
|
||||
|
||||
|
@ -60,7 +61,7 @@ func main() {
|
|||
// Wait for the synchronization threads to come up.
|
||||
time.Sleep(time.Second * 10)
|
||||
|
||||
kubeClient := kube_client.Client{
|
||||
kubeClient := client.Client{
|
||||
Host: server.URL,
|
||||
}
|
||||
data, err := ioutil.ReadFile("api/examples/controller.json")
|
||||
|
|
|
@ -19,7 +19,7 @@ limitations under the License.
|
|||
package api
|
||||
|
||||
// ContainerManifest corresponds to the Container Manifest format, documented at:
|
||||
// https://developers.google.com/compute/docs/containers#container_manifest
|
||||
// https://developers.google.com/compute/docs/containers/container_vms#container_manifest
|
||||
// This is used as the representation of Kubernete's workloads.
|
||||
type ContainerManifest struct {
|
||||
Version string `yaml:"version" json:"version"`
|
||||
|
|
|
@ -13,6 +13,7 @@ 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.
|
||||
*/
|
||||
|
||||
package util
|
||||
|
||||
import (
|
||||
|
|
Loading…
Reference in New Issue