diff --git a/src/main/kotlin/org/domaindrivenarchitecture/provs/server/application/Application.kt b/src/main/kotlin/org/domaindrivenarchitecture/provs/server/application/Application.kt index 8772647..1ff3e38 100644 --- a/src/main/kotlin/org/domaindrivenarchitecture/provs/server/application/Application.kt +++ b/src/main/kotlin/org/domaindrivenarchitecture/provs/server/application/Application.kt @@ -1,11 +1,9 @@ package org.domaindrivenarchitecture.provs.server.application import org.domaindrivenarchitecture.provs.framework.core.cli.createProvInstance -import org.domaindrivenarchitecture.provs.server.domain.ServerCliCommand import org.domaindrivenarchitecture.provs.server.domain.ServerType import org.domaindrivenarchitecture.provs.server.domain.k3s.K3sCliCommand import org.domaindrivenarchitecture.provs.server.domain.k3s.provisionK3s -import org.domaindrivenarchitecture.provs.server.infrastructure.genericFileExistenceCheck import kotlin.system.exitProcess @@ -33,13 +31,6 @@ fun main(args: Array) { println("Remote or localhost not valid, please try -h for help.") exitProcess(1) } - if (!cmd.isValidConfigFileName()) { - println("Config file not found. Please check if path is correct.") - exitProcess(1) - } - if (!cmd.isValidServerType()) { - throw RuntimeException("Unknown serverType. Currently only k3s is accepted.") - } val prov = createProvInstance(cmd.target) prov.provisionK3s(cmd as K3sCliCommand) diff --git a/src/main/kotlin/org/domaindrivenarchitecture/provs/server/domain/ServerCliCommand.kt b/src/main/kotlin/org/domaindrivenarchitecture/provs/server/domain/ServerCliCommand.kt index c619725..c1eaeb2 100644 --- a/src/main/kotlin/org/domaindrivenarchitecture/provs/server/domain/ServerCliCommand.kt +++ b/src/main/kotlin/org/domaindrivenarchitecture/provs/server/domain/ServerCliCommand.kt @@ -2,7 +2,6 @@ package org.domaindrivenarchitecture.provs.server.domain import org.domaindrivenarchitecture.provs.configuration.domain.ConfigFileName import org.domaindrivenarchitecture.provs.configuration.domain.TargetCliCommand -import org.domaindrivenarchitecture.provs.server.infrastructure.genericFileExistenceCheck enum class ServerType { K3D, K3S @@ -19,10 +18,4 @@ open class ServerCliCommand( fun isValidTarget(): Boolean { return target.isValid() } - fun isValidConfigFileName(): Boolean { - if (configFileName == null) { - return true - } - return genericFileExistenceCheck(configFileName.fileName) - } } diff --git a/src/test/kotlin/org/domaindrivenarchitecture/provs/server/application/CliArgumentParserTest.kt b/src/test/kotlin/org/domaindrivenarchitecture/provs/server/application/CliArgumentParserTest.kt index 017b182..1a0889e 100644 --- a/src/test/kotlin/org/domaindrivenarchitecture/provs/server/application/CliArgumentParserTest.kt +++ b/src/test/kotlin/org/domaindrivenarchitecture/provs/server/application/CliArgumentParserTest.kt @@ -1,7 +1,6 @@ package org.domaindrivenarchitecture.provs.server.application import org.domaindrivenarchitecture.provs.configuration.domain.TargetCliCommand -import org.domaindrivenarchitecture.provs.server.domain.ServerType import org.domaindrivenarchitecture.provs.server.domain.k3s.ApplicationFileName import org.domaindrivenarchitecture.provs.server.domain.k3s.K3sCliCommand import org.junit.jupiter.api.Assertions.assertEquals @@ -21,7 +20,6 @@ internal class CliArgumentParserTest { // then assertTrue(result.isValidServerType()) assertTrue(result.isValidTarget()) - assertTrue(result.isValidConfigFileName()) } @Test @@ -35,7 +33,6 @@ internal class CliArgumentParserTest { // then assertTrue(result.isValidServerType()) assertTrue(result.isValidTarget()) - assertTrue(result.isValidConfigFileName()) assertEquals(listOf("grafana"), result.submodules) assertEquals(TargetCliCommand("local"), result.target) }