All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.netflix.spinnaker.keel.bakery.DefaultBaseImageCache.kt Maven / Gradle / Ivy

There is a newer version: 1.4.1
Show newest version
package com.netflix.spinnaker.keel.bakery

import com.netflix.spinnaker.keel.api.artifacts.BaseLabel
import org.springframework.boot.context.properties.ConfigurationProperties

/**
 * @param baseImages a map of OS to label -> base AMI version. For example
 * ```
 * xenial:
 *   CANDIDATE: nflx-base-5.530.0-h1663.61bf5c1
 *   RELEASE: nflx-base-5.523.0-h1645.61bf5c1
 * bionic:
 *   CANDIDATE: nflx-base-5.530.0-h1663.61bf5c1
 *   RELEASE: nflx-base-5.523.0-h1645.61bf5c1
 * ```
 */
class DefaultBaseImageCache(
  private val baseImages: Map>
) : BaseImageCache {
  override fun getBaseAmiName(os: String, label: BaseLabel) =
    baseImages[os]?.get(label.name.toLowerCase()) ?: throw UnknownBaseImage(os, label)

  override val allVersions: Map>
    get() = baseImages
}

@ConfigurationProperties(prefix = "keel.plugins.bakery")
class BaseImageCacheProperties {
  var baseImages: Map> = emptyMap()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy