diff --git a/.gitignore b/.gitignore index f08ae40..67e4d50 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ build /.idea/ /aot-smoke-test/native-image/ +/.kotlin/ diff --git a/kirc-core/src/main/kotlin/de/cmdjulian/kirc/spec/Platform.kt b/kirc-core/src/main/kotlin/de/cmdjulian/kirc/spec/Platform.kt index 728be5f..9b3ada9 100644 --- a/kirc-core/src/main/kotlin/de/cmdjulian/kirc/spec/Platform.kt +++ b/kirc-core/src/main/kotlin/de/cmdjulian/kirc/spec/Platform.kt @@ -29,7 +29,8 @@ enum class OS(@get:JsonValue val string: String) { WINDOWS("windows"), @JsonEnumDefaultValue - UNKNOWN("unknown"); + UNKNOWN("unknown"), + ; override fun toString() = string } @@ -47,7 +48,8 @@ enum class Architecture(@get:JsonValue val string: String) { ARM_V5("arm/v5"), @JsonEnumDefaultValue - UNKNOWN("unknown"); + UNKNOWN("unknown"), + ; override fun toString() = string } diff --git a/kirc-core/src/main/kotlin/de/cmdjulian/kirc/spec/blob/DockerMediaTypes.kt b/kirc-core/src/main/kotlin/de/cmdjulian/kirc/spec/blob/DockerMediaTypes.kt index dfc00ef..895c2ef 100644 --- a/kirc-core/src/main/kotlin/de/cmdjulian/kirc/spec/blob/DockerMediaTypes.kt +++ b/kirc-core/src/main/kotlin/de/cmdjulian/kirc/spec/blob/DockerMediaTypes.kt @@ -1,3 +1,5 @@ +@file:Suppress("ktlint:standard:property-naming") + package de.cmdjulian.kirc.spec.blob const val DockerBlobMediaType = "application/vnd.docker.image.rootfs.diff.tar.gzip" diff --git a/kirc-core/src/main/kotlin/de/cmdjulian/kirc/spec/blob/OciMediaTypes.kt b/kirc-core/src/main/kotlin/de/cmdjulian/kirc/spec/blob/OciMediaTypes.kt index 372e744..d9a8a5f 100644 --- a/kirc-core/src/main/kotlin/de/cmdjulian/kirc/spec/blob/OciMediaTypes.kt +++ b/kirc-core/src/main/kotlin/de/cmdjulian/kirc/spec/blob/OciMediaTypes.kt @@ -1,3 +1,5 @@ +@file:Suppress("ktlint:standard:property-naming") + package de.cmdjulian.kirc.spec.blob const val OciBlobMediaTypeTar = "application/vnd.oci.image.layer.v1.tar" diff --git a/kirc-core/src/main/kotlin/de/cmdjulian/kirc/spec/image/DockerImageConfigV1.kt b/kirc-core/src/main/kotlin/de/cmdjulian/kirc/spec/image/DockerImageConfigV1.kt index bb74a44..d51f4bf 100644 --- a/kirc-core/src/main/kotlin/de/cmdjulian/kirc/spec/image/DockerImageConfigV1.kt +++ b/kirc-core/src/main/kotlin/de/cmdjulian/kirc/spec/image/DockerImageConfigV1.kt @@ -33,6 +33,7 @@ data class DockerImageConfigV1( override val history: List, ) : ImageConfig { @ReflectionHint + @Suppress("ktlint:standard:property-naming") companion object { const val MediaType = "application/vnd.docker.container.image.v1+json" } diff --git a/kirc-core/src/main/kotlin/de/cmdjulian/kirc/spec/image/OciImageConfigV1.kt b/kirc-core/src/main/kotlin/de/cmdjulian/kirc/spec/image/OciImageConfigV1.kt index f0894a8..30c52a5 100644 --- a/kirc-core/src/main/kotlin/de/cmdjulian/kirc/spec/image/OciImageConfigV1.kt +++ b/kirc-core/src/main/kotlin/de/cmdjulian/kirc/spec/image/OciImageConfigV1.kt @@ -25,6 +25,7 @@ data class OciImageConfigV1( override val history: List, ) : ImageConfig { @ReflectionHint + @Suppress("ktlint:standard:property-naming") companion object { const val MediaType = "application/vnd.oci.image.config.v1+json" } diff --git a/kirc-core/src/main/kotlin/de/cmdjulian/kirc/spec/manifest/DockerManifestListV1.kt b/kirc-core/src/main/kotlin/de/cmdjulian/kirc/spec/manifest/DockerManifestListV1.kt index 1739f92..e7354e4 100644 --- a/kirc-core/src/main/kotlin/de/cmdjulian/kirc/spec/manifest/DockerManifestListV1.kt +++ b/kirc-core/src/main/kotlin/de/cmdjulian/kirc/spec/manifest/DockerManifestListV1.kt @@ -10,6 +10,7 @@ data class DockerManifestListV1( override val manifests: List, ) : ManifestList { @ReflectionHint + @Suppress("ktlint:standard:property-naming") companion object { const val MediaType = "application/vnd.docker.distribution.manifest.list.v2+json" } diff --git a/kirc-core/src/main/kotlin/de/cmdjulian/kirc/spec/manifest/DockerManifestV2.kt b/kirc-core/src/main/kotlin/de/cmdjulian/kirc/spec/manifest/DockerManifestV2.kt index 38ddb3e..514ee58 100644 --- a/kirc-core/src/main/kotlin/de/cmdjulian/kirc/spec/manifest/DockerManifestV2.kt +++ b/kirc-core/src/main/kotlin/de/cmdjulian/kirc/spec/manifest/DockerManifestV2.kt @@ -11,6 +11,7 @@ data class DockerManifestV2( override val layers: List, ) : ManifestSingle { @ReflectionHint + @Suppress("ktlint:standard:property-naming") companion object { const val MediaType = "application/vnd.docker.distribution.manifest.v2+json" } diff --git a/kirc-core/src/main/kotlin/de/cmdjulian/kirc/spec/manifest/OciManifestListV1.kt b/kirc-core/src/main/kotlin/de/cmdjulian/kirc/spec/manifest/OciManifestListV1.kt index 5ac4b53..fe98438 100644 --- a/kirc-core/src/main/kotlin/de/cmdjulian/kirc/spec/manifest/OciManifestListV1.kt +++ b/kirc-core/src/main/kotlin/de/cmdjulian/kirc/spec/manifest/OciManifestListV1.kt @@ -11,6 +11,7 @@ data class OciManifestListV1( val annotations: Map, ) : ManifestList { @ReflectionHint + @Suppress("ktlint:standard:property-naming") companion object { const val MediaType = "application/vnd.oci.image.index.v1+json" } diff --git a/kirc-core/src/main/kotlin/de/cmdjulian/kirc/spec/manifest/OciManifestV1.kt b/kirc-core/src/main/kotlin/de/cmdjulian/kirc/spec/manifest/OciManifestV1.kt index f0825f9..adf07cc 100644 --- a/kirc-core/src/main/kotlin/de/cmdjulian/kirc/spec/manifest/OciManifestV1.kt +++ b/kirc-core/src/main/kotlin/de/cmdjulian/kirc/spec/manifest/OciManifestV1.kt @@ -13,6 +13,7 @@ data class OciManifestV1( val annotations: Map, ) : ManifestSingle { @ReflectionHint + @Suppress("ktlint:standard:property-naming") companion object { const val MediaType = "application/vnd.oci.image.manifest.v1+json" } diff --git a/kirc-image/src/main/kotlin/de/cmdjulian/kirc/image/Reference.kt b/kirc-image/src/main/kotlin/de/cmdjulian/kirc/image/Reference.kt index 775f38f..e0dcc8c 100644 --- a/kirc-image/src/main/kotlin/de/cmdjulian/kirc/image/Reference.kt +++ b/kirc-image/src/main/kotlin/de/cmdjulian/kirc/image/Reference.kt @@ -30,6 +30,7 @@ class Tag(@JsonValue private val value: String) : Reference, Comparable { override fun toString(): String = value @ReflectionHint + @Suppress("ktlint:standard:property-naming") companion object { val LATEST = Tag("latest") const val separator: Char = ':' @@ -54,6 +55,7 @@ class Digest(@JsonValue private val value: String) : Reference, Comparable = - api.repositories(limit, last) - .map(Catalog::repositories) - .getOrElse { throw it.toRegistryClientError() } + override suspend fun repositories(limit: Int?, last: Int?): List = api.repositories(limit, last) + .map(Catalog::repositories) + .getOrElse { throw it.toRegistryClientError() } override suspend fun tags(repository: Repository, limit: Int?, last: Int?): List = api.tags(repository, limit, last) @@ -68,9 +67,8 @@ internal class SuspendingContainerImageRegistryClientImpl(private val api: Conta api.digest(repository, reference) .getOrElse { throw it.toRegistryClientError(repository, reference) } - override suspend fun blob(repository: Repository, digest: Digest): ByteArray = - api.blob(repository, digest) - .getOrElse { throw it.toRegistryClientError(repository) } + override suspend fun blob(repository: Repository, digest: Digest): ByteArray = api.blob(repository, digest) + .getOrElse { throw it.toRegistryClientError(repository) } override suspend fun config(repository: Repository, reference: Reference): ImageConfig = api.manifest(repository, reference)