public class ConfigSet extends Object
This class is used to parse the ConfigMap returned from the Kubernetes API. The ConfigMap will be parsed into a set of ConfigSetEntries. The client will then use the ConfigSet to find the compatible configuration version for the client's API schema version.
Ensure that we only have atmost one minor versions for a major version. This ensures that we better keep track of configurations and avoid any confusion because we would be sure which higher minor version could be used for a schema version.
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
<T> Optional<T> |
getCompatibleConfigVersion(String schemaVersion,
Class<T> typeParameterClass)
The ConfigMap will hold 1 remote configuration objects for each major API schema
version.
|
int |
hashCode() |
static ConfigSet |
parseConfigYaml(String configs)
We need to provide this convoluted way of parsing configs returned from the ConfigMap because
k8s only allows us to specify ConfigMaps of
Map<String, String>;
so we're unable to interpret the yaml directly. |
public static ConfigSet parseConfigYaml(String configs) throws com.fasterxml.jackson.core.JsonProcessingException
Map<String, String>;
so we're unable to interpret the yaml directly. We use Jackson to deserialize
the set of ConfigSetEntries and pass it to the ConfigSet constructor.com.fasterxml.jackson.core.JsonProcessingExceptionpublic <T> Optional<T> getCompatibleConfigVersion(String schemaVersion, Class<T> typeParameterClass)