Skip to content

Commit

Permalink
removed dead code
Browse files Browse the repository at this point in the history
Signed-off-by: Jeromy Cannon <[email protected]>
  • Loading branch information
jeromy-cannon committed Oct 20, 2023
1 parent 9c4608f commit 23645de
Showing 1 changed file with 3 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ abstract class KindArtifactTask() : DefaultTask() {

companion object {
const val KIND_RELEASE_URL_TEMPLATE = "https://kind.sigs.k8s.io/dl/v%s/kind-%s-%s"
const val KIND_ARTIFACT_TEMPLATE = "kind-%s-%s"
const val KIND_EXECUTABLE_PREFIX = "kind"
const val KIND_VERSION_FILE = "KIND_VERSION"
}
Expand All @@ -58,6 +57,8 @@ abstract class KindArtifactTask() : DefaultTask() {
download(tuple)
}

project.logger.log(LogLevel.WARN, "Kind download output directory ${output.get().asFile.toPath()}")

writeVersionFile(output.get().asFile.toPath())
}

Expand Down Expand Up @@ -96,27 +97,13 @@ abstract class KindArtifactTask() : DefaultTask() {
}
}

private fun createSubDirectory(subDirectory: String) {
try {
workingDirectory = workingDirectory!!.resolve(subDirectory)
workingDirectory!!.toFile().deleteOnExit()
} catch (e: Exception) {
throw StopExecutionException("Unable to create working sub-directory, full path: $workingDirectory")
}
}

private fun download(tuple: ArtifactTuple) {
val downloadUrl = String.format(
KIND_RELEASE_URL_TEMPLATE,
actualVersion!!.toString(),
tuple.operatingSystem.descriptor,
tuple.architecture.descriptor
)
val artifactName = String.format(
KIND_ARTIFACT_TEMPLATE,
tuple.operatingSystem.descriptor,
tuple.architecture.descriptor
)

val tempFile = workingDirectory!!.resolve(KIND_EXECUTABLE_PREFIX + tuple.operatingSystem.fileExtension)

Expand Down Expand Up @@ -148,7 +135,7 @@ abstract class KindArtifactTask() : DefaultTask() {
}

try {
project.logger.log(LogLevel.WARN, "Copying ${source} to ${destination}")
project.logger.log(LogLevel.DEBUG, "Copying ${source} to ${destination}")
project.copy {
from(source)
into(destination)
Expand Down

0 comments on commit 23645de

Please sign in to comment.