forked from LaconicNetwork/kompose
Change warning to debug for services without ports.
This commit is contained in:
parent
8f2dd5b03b
commit
90febe7f7f
@ -258,7 +258,7 @@ func convertToVersion(obj runtime.Object, groupVersion unversioned.GroupVersion)
|
|||||||
// PortsExist checks if service has ports defined
|
// PortsExist checks if service has ports defined
|
||||||
func (k *Kubernetes) PortsExist(name string, service kobject.ServiceConfig) bool {
|
func (k *Kubernetes) PortsExist(name string, service kobject.ServiceConfig) bool {
|
||||||
if len(service.Port) == 0 {
|
if len(service.Port) == 0 {
|
||||||
logrus.Warningf("[%s] No ports defined, we will create a Headless service.", name)
|
logrus.Debugf("[%s] No ports defined. Headless service will be created.", name)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
|
|||||||
@ -21,9 +21,7 @@ source $KOMPOSE_ROOT/script/test/cmd/lib.sh
|
|||||||
# Tests related to docker-compose file in /script/test/fixtures/etherpad
|
# Tests related to docker-compose file in /script/test/fixtures/etherpad
|
||||||
convert::expect_failure "kompose -f $KOMPOSE_ROOT/script/test/fixtures/etherpad/docker-compose.yml convert --stdout"
|
convert::expect_failure "kompose -f $KOMPOSE_ROOT/script/test/fixtures/etherpad/docker-compose.yml convert --stdout"
|
||||||
|
|
||||||
# commenting this test case out until image handling is fixed
|
|
||||||
convert::expect_failure "kompose -f $KOMPOSE_ROOT/script/test/fixtures/etherpad/docker-compose-no-image.yml convert --stdout"
|
convert::expect_failure "kompose -f $KOMPOSE_ROOT/script/test/fixtures/etherpad/docker-compose-no-image.yml convert --stdout"
|
||||||
convert::expect_warning "kompose -f $KOMPOSE_ROOT/script/test/fixtures/etherpad/docker-compose-no-ports.yml convert --stdout" "No ports defined, we will create a Headless service."
|
|
||||||
|
|
||||||
export $(cat $KOMPOSE_ROOT/script/test/fixtures/etherpad/envs)
|
export $(cat $KOMPOSE_ROOT/script/test/fixtures/etherpad/envs)
|
||||||
# kubernetes test
|
# kubernetes test
|
||||||
@ -52,9 +50,9 @@ convert::expect_success_warning "kompose --provider=openshift -f $KOMPOSE_ROOT/s
|
|||||||
######
|
######
|
||||||
# Tests related to docker-compose file in /script/test/fixtures/entrypoint-command
|
# Tests related to docker-compose file in /script/test/fixtures/entrypoint-command
|
||||||
# kubernetes test
|
# kubernetes test
|
||||||
convert::expect_success_and_warning "kompose -f $KOMPOSE_ROOT/script/test/fixtures/entrypoint-command/docker-compose.yml convert --stdout -j" "$KOMPOSE_ROOT/script/test/fixtures/entrypoint-command/output-k8s.json" "No ports defined, we will create a Headless service."
|
convert::expect_success "kompose -f $KOMPOSE_ROOT/script/test/fixtures/entrypoint-command/docker-compose.yml convert --stdout -j" "$KOMPOSE_ROOT/script/test/fixtures/entrypoint-command/output-k8s.json"
|
||||||
# openshift test
|
# openshift test
|
||||||
convert::expect_success_and_warning "kompose --provider=openshift -f $KOMPOSE_ROOT/script/test/fixtures/entrypoint-command/docker-compose.yml convert --stdout -j" "$KOMPOSE_ROOT/script/test/fixtures/entrypoint-command/output-os.json" "No ports defined, we will create a Headless service."
|
convert::expect_success "kompose --provider=openshift -f $KOMPOSE_ROOT/script/test/fixtures/entrypoint-command/docker-compose.yml convert --stdout -j" "$KOMPOSE_ROOT/script/test/fixtures/entrypoint-command/output-os.json"
|
||||||
|
|
||||||
|
|
||||||
######
|
######
|
||||||
@ -106,7 +104,7 @@ convert::expect_success_and_warning "kompose --provider=openshift -f $KOMPOSE_RO
|
|||||||
|
|
||||||
######
|
######
|
||||||
# Test related to kompose --bundle convert to ensure that DSB bundles are converted properly
|
# Test related to kompose --bundle convert to ensure that DSB bundles are converted properly
|
||||||
convert::expect_success_and_warning "kompose --bundle $KOMPOSE_ROOT/script/test/fixtures/bundles/dsb/docker-voting-bundle.dsb convert --stdout -j" "$KOMPOSE_ROOT/script/test/fixtures/bundles/dsb/output-k8s.json" "No ports defined, we will create a Headless service."
|
convert::expect_success_and_warning "kompose --bundle $KOMPOSE_ROOT/script/test/fixtures/bundles/dsb/docker-voting-bundle.dsb convert --stdout -j" "$KOMPOSE_ROOT/script/test/fixtures/bundles/dsb/output-k8s.json" "Unsupported Networks key - ignoring"
|
||||||
|
|
||||||
######
|
######
|
||||||
# Test related to restart options in docker-compose
|
# Test related to restart options in docker-compose
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user