Skip to content

Commit

Permalink
Remove primary_node_name variable from manifests
Browse files Browse the repository at this point in the history
Not needed anymore.

Signed-off-by: Roman Mohr <[email protected]>
  • Loading branch information
rmohr committed Dec 4, 2017
1 parent 5113f58 commit b844354
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 36 deletions.
3 changes: 1 addition & 2 deletions docs/dev-env-local.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,11 @@ step using
## Building kubevirt

First configure kubevirt with site specific parameters. As above
we need the hostname and IP address.
we need the IP address of the host.

```bash
cat > hack/config-local.sh <<EOF
master_ip=192.168.122.13
primary_node_name=kubdev
docker_tag=latest
EOF
make manifests docker
Expand Down
1 change: 0 additions & 1 deletion hack/build-manifests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ rm -f "manifests/*.yaml"
# Render kubernetes manifests
for arg in $args; do
sed -e "s/{{ master_ip }}/$master_ip/g" \
-e "s/{{ primary_node_name }}/$primary_node_name/g" \
-e "s/{{ docker_tag }}/$docker_tag/g" \
-e "s/{{ docker_prefix }}/$docker_prefix/g" \
$arg > ${arg%%.in}
Expand Down
1 change: 0 additions & 1 deletion hack/config-default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ manifest_templates="`ls ${KUBEVIRT_PATH}manifests/*.in`"
master_ip=192.168.200.2
master_port=8184
network_provider=weave
primary_node_name=${primary_node_name:-master}
4 changes: 2 additions & 2 deletions hack/config.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
unset binaries docker_images docker_prefix docker_tag manifest_templates \
master_ip master_port network_provider primary_node_name
master_ip master_port network_provider

source ${KUBEVIRT_PATH}hack/config-default.sh

Expand All @@ -8,4 +8,4 @@ source ${KUBEVIRT_PATH}hack/config-default.sh
test -f "hack/config-local.sh" && source hack/config-local.sh

export binaries docker_images docker_prefix docker_tag manifest_templates \
master_ip master_port network_provider primary_node_name
master_ip master_port network_provider
12 changes: 0 additions & 12 deletions manifests/virt-manifest.yaml.in
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
apiVersion: v1
kind: Service
metadata:
name: virt-manifest
namespace: kube-system
spec:
ports:
- port: 8186
targetPort: virt-manifest
selector:
app: virt-manifest
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
Expand Down
12 changes: 1 addition & 11 deletions tests/virtmanifest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ package tests_test

import (
"flag"
"fmt"
"net/url"
"strings"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
Expand All @@ -46,14 +43,7 @@ var _ = Describe("Virtmanifest", func() {
BeforeEach(func() {
tests.BeforeTestCleanup()

var err error
var masterUrl *url.URL
masterUrl, err = url.Parse(flag.Lookup("master").Value.String())
Expect(err).ToNot(HaveOccurred())
hostParts := strings.Split(masterUrl.Host, ":")
Expect(len(hostParts)).To(Equal(2))

virtClient, err := kubecli.GetKubevirtClientFromFlags(fmt.Sprintf("http://%s:8186", hostParts[0]), "")
virtClient, err := kubecli.GetKubevirtClient()
Expect(err).ToNot(HaveOccurred())

manifestClient = virtClient.RestClient()
Expand Down
15 changes: 8 additions & 7 deletions tests/vmlifecycle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ import (

var _ = Describe("Vmlifecycle", func() {

primaryNodeName := os.Getenv("primary_node_name")
if primaryNodeName == "" {
primaryNodeName = "master"
}
dockerTag := os.Getenv("docker_tag")
if dockerTag == "" {
dockerTag = "latest"
Expand Down Expand Up @@ -231,10 +227,15 @@ var _ = Describe("Vmlifecycle", func() {

_, exists := os.LookupEnv("JENKINS_HOME")
if exists {
Skip("Skip log query tests for JENKINs ci test environment")
Skip("Skip log query tests for JENKINS ci test environment")
}
nodes, err := virtClient.CoreV1().Nodes().List(metav1.ListOptions{})
Expect(err).ToNot(HaveOccurred())
Expect(nodes.Items).ToNot(BeEmpty())
node := nodes.Items[0].Name

vm = tests.NewRandomVMWithNS(namespace)
virtHandlerPod, err := kubecli.NewVirtHandlerClient(virtClient).ForNode(primaryNodeName).Pod()
virtHandlerPod, err := kubecli.NewVirtHandlerClient(virtClient).ForNode(node).Pod()
Expect(err).ToNot(HaveOccurred())

handlerName := virtHandlerPod.GetObjectMeta().GetName()
Expand All @@ -243,7 +244,7 @@ var _ = Describe("Vmlifecycle", func() {
logsQuery := virtClient.CoreV1().Pods(handlerNamespace).GetLogs(handlerName, &k8sv1.PodLogOptions{SinceSeconds: &seconds, Container: "virt-handler"})

// Make sure we schedule the VM to master
vm.Spec.NodeSelector = map[string]string{"kubernetes.io/hostname": primaryNodeName}
vm.Spec.NodeSelector = map[string]string{"kubernetes.io/hostname": node}

// Start the VM and wait for the confirmation of the start
obj, err := virtClient.RestClient().Post().Resource("virtualmachines").Namespace(vm.GetObjectMeta().GetNamespace()).Body(vm).Do().Get()
Expand Down

0 comments on commit b844354

Please sign in to comment.