Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
e8d1dae1
Commit
e8d1dae1
authored
Jun 06, 2016
by
Aaron Levy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use a skeleton provider for unimplemented functionality
parent
6c549ae9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
104 additions
and
80 deletions
+104
-80
kube-util.sh
cluster/kube-util.sh
+7
-79
util.sh
cluster/skeleton/util.sh
+95
-0
e2e-tests.md
docs/devel/e2e-tests.md
+1
-0
ginkgo-e2e.sh
hack/ginkgo-e2e.sh
+1
-1
No files found.
cluster/kube-util.sh
View file @
e8d1dae1
...
...
@@ -14,87 +14,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# This script contains skeletons of helper functions that each provider hosting
# Kubernetes must implement to use cluster/kube-*.sh scripts.
# It sets KUBERNETES_PROVIDER to its default value (gce) if it is unset, and
# then sources cluster/${KUBERNETES_PROVIDER}/util.sh.
# This script will source the default skeleton helper functions, then sources
# cluster/${KUBERNETES_PROVIDER}/util.sh where KUBERNETES_PROVIDER, if unset,
# will use its default value (gce).
KUBERNETES_PROVIDER
=
"
${
KUBERNETES_PROVIDER
:-
gce
}
"
# Must ensure that the following ENV vars are set
function
detect-master
{
echo
"KUBE_MASTER_IP:
$KUBE_MASTER_IP
"
1>&2
echo
"KUBE_MASTER:
$KUBE_MASTER
"
1>&2
}
# Get node names if they are not static.
function
detect-node-names
{
echo
"NODE_NAMES: [
${
NODE_NAMES
[*]
}
]"
1>&2
}
# Get node IP addresses and store in KUBE_NODE_IP_ADDRESSES[]
function
detect-nodes
{
echo
"KUBE_NODE_IP_ADDRESSES: [
${
KUBE_NODE_IP_ADDRESSES
[*]
}
]"
1>&2
}
# Verify prereqs on host machine
function
verify-prereqs
{
echo
"TODO: verify-prereqs"
1>&2
}
# Validate a kubernetes cluster
function
validate-cluster
{
# by default call the generic validate-cluster.sh script, customizable by
# any cluster provider if this does not fit.
"
${
KUBE_ROOT
}
/cluster/validate-cluster.sh"
}
# Instantiate a kubernetes cluster
function
kube-up
{
echo
"TODO: kube-up"
1>&2
}
# Delete a kubernetes cluster
function
kube-down
{
echo
"TODO: kube-down"
1>&2
}
# Update a kubernetes cluster
function
kube-push
{
echo
"TODO: kube-push"
1>&2
}
# Prepare update a kubernetes component
function
prepare-push
{
echo
"TODO: prepare-push"
1>&2
}
# Update a kubernetes master
function
push-master
{
echo
"TODO: push-master"
1>&2
}
# Update a kubernetes node
function
push-node
{
echo
"TODO: push-node"
1>&2
}
# Execute prior to running tests to build a release if required for env
function
test-build-release
{
echo
"TODO: test-build-release"
1>&2
}
KUBE_ROOT
=
$(
dirname
"
${
BASH_SOURCE
}
"
)
/..
# Execute prior to running tests to initialize required structure
function
test-setup
{
echo
"TODO: test-setup"
1>&2
}
source
"
${
KUBE_ROOT
}
/cluster/skeleton/util.sh"
# Execute after running tests to perform any required clean-up
function
test-teardown
{
echo
"TODO: test-teardown"
1>&2
}
KUBE_ROOT
=
$(
dirname
"
${
BASH_SOURCE
}
"
)
/..
KUBERNETES_PROVIDER
=
"
${
KUBERNETES_PROVIDER
:-
gce
}
"
PROVIDER_UTILS
=
"
${
KUBE_ROOT
}
/cluster/
${
KUBERNETES_PROVIDER
}
/util.sh"
if
[
-f
${
PROVIDER_UTILS
}
]
;
then
source
"
${
PROVIDER_UTILS
}
"
...
...
@@ -112,7 +40,7 @@ function set-federated-zone-vars {
export
KUBE_GCE_ZONE
=
"
$zone
"
# gcloud has a 61 character limit, and for firewall rules this
# prefix gets appended to its
le
f, with some extra information
# prefix gets appended to its
el
f, with some extra information
# need tot keep it short
export
KUBE_GCE_INSTANCE_PREFIX
=
"
${
USER
}
-
${
zone
}
"
...
...
cluster/skeleton/util.sh
0 → 100644
View file @
e8d1dae1
#!/bin/bash
# Copyright 2016 The Kubernetes Authors All rights reserved.
#
# 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.
# This script contains the helper functions that each provider hosting
# Kubernetes must implement to use cluster/kube-*.sh scripts.
# Must ensure that the following ENV vars are set
function
detect-master
{
echo
"KUBE_MASTER_IP:
$KUBE_MASTER_IP
"
1>&2
echo
"KUBE_MASTER:
$KUBE_MASTER
"
1>&2
}
# Get node names if they are not static.
function
detect-node-names
{
echo
"NODE_NAMES: [
${
NODE_NAMES
[*]
}
]"
1>&2
}
# Get node IP addresses and store in KUBE_NODE_IP_ADDRESSES[]
function
detect-nodes
{
echo
"KUBE_NODE_IP_ADDRESSES: [
${
KUBE_NODE_IP_ADDRESSES
[*]
}
]"
1>&2
}
# Verify prereqs on host machine
function
verify-prereqs
{
echo
"Skeleton Provider: verify-prereqs not implemented"
1>&2
}
# Validate a kubernetes cluster
function
validate-cluster
{
# by default call the generic validate-cluster.sh script, customizable by
# any cluster provider if this does not fit.
"
${
KUBE_ROOT
}
/cluster/validate-cluster.sh"
}
# Instantiate a kubernetes cluster
function
kube-up
{
echo
"Skeleton Provider: kube-up not implemented"
1>&2
}
# Delete a kubernetes cluster
function
kube-down
{
echo
"Skeleton Provider: kube-down not implemented"
1>&2
}
# Update a kubernetes cluster
function
kube-push
{
echo
"Skeleton Provider: kube-push not implemented"
1>&2
}
# Prepare update a kubernetes component
function
prepare-push
{
echo
"Skeleton Provider: prepare-push not implemented"
1>&2
}
# Update a kubernetes master
function
push-master
{
echo
"Skeleton Provider: push-master not implemented"
1>&2
}
# Update a kubernetes node
function
push-node
{
echo
"Skeleton Provider: push-node not implemented"
1>&2
}
# Execute prior to running tests to build a release if required for env
function
test-build-release
{
echo
"Skeleton Provider: test-build-release not implemented"
1>&2
}
# Execute prior to running tests to initialize required structure
function
test-setup
{
echo
"Skeleton Provider: test-setup not implemented"
1>&2
}
# Execute after running tests to perform any required clean-up
function
test-teardown
{
echo
"Skeleton Provider: test-teardown not implemented"
1>&2
}
function
prepare-e2e
{
echo
"Skeleton Provider: prepare-e2e not implemented"
1>&2
}
docs/devel/e2e-tests.md
View file @
e8d1dae1
...
...
@@ -354,6 +354,7 @@ credentials.
# setup for conformance tests
export KUBECONFIG=/path/to/kubeconfig
export KUBERNETES_CONFORMANCE_TEST=y
export KUBERNETES_PROVIDER=skeleton
# run all conformance tests
go run hack/e2e.go -v --test --test_args="--ginkgo.focus=\[Conformance\]"
...
...
hack/ginkgo-e2e.sh
View file @
e8d1dae1
...
...
@@ -46,7 +46,7 @@ source "${KUBE_ROOT}/cluster/kube-util.sh"
# ---- Do cloud-provider-specific setup
if
[[
-n
"
${
KUBERNETES_CONFORMANCE_TEST
:-}
"
]]
;
then
echo
"Conformance test: not doing test setup."
KUBERNETES_PROVIDER
=
""
KUBERNETES_PROVIDER
=
"
skeleton
"
detect-master-from-kubeconfig
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment