Struct shipcat_definitions::config::Config [−][src]
pub struct Config { pub defaults: Value, pub clusters: BTreeMap<String, Cluster>, pub contextAliases: BTreeMap<String, String>, pub locations: BTreeMap<String, Location>, pub slack: SlackParameters, pub github: GithubParameters, pub allowedLabels: Vec<String>, pub allowedCustomMetadata: BTreeSet<String>, pub versions: BTreeMap<Environment, Version>, pub owners: Owners, // some fields omitted }
Expand description
Main manifest, serializable from shipcat.conf
Fields
defaults: Value
Global defaults for the manifests (used by shipcat_filebacked only)
clusters: BTreeMap<String, Cluster>
Cluster definitions
contextAliases: BTreeMap<String, String>
Context aliases, e.g. prod-uk-green -> prod-uk
locations: BTreeMap<String, Location>
Location definitions
slack: SlackParameters
Slack parameters
github: GithubParameters
Gihub parameters
allowedLabels: Vec<String>
Allowed labels
allowedCustomMetadata: BTreeSet<String>
versions: BTreeMap<Environment, Version>
Shipcat version pins
owners: Owners
Owners of services, squads, tribes
Populated from teams.yml
Implementations
impl Config
[src]
impl Config
[src]pub fn verify(&self) -> Result<()>
[src]
pub fn verify_version_pin(&self, env: &Environment) -> Result<()>
[src]
pub fn get_appropriate_version_pin(&self, env: &Environment) -> Result<Version>
[src]
pub fn bail_on_version_older_than(pin: &Version) -> Result<()>
[src]
pub fn list_regions(&self) -> Vec<String>
[src]
pub fn list_regions(&self) -> Vec<String>
[src]Helper for small utils that don’t need the full struct
pub fn resolve_cluster(
&self,
ctx: &str,
cluster: Option<String>
) -> Result<(Cluster, Region)>
[src]
pub fn resolve_cluster(
&self,
ctx: &str,
cluster: Option<String>
) -> Result<(Cluster, Region)>
[src]Work out the cluster from the kube config
Can be done unambiguously when cluster name is specified, Otherwise we will find the first candidate cluster serving this context and bail if there’s more than one.
pub fn has_secrets(&self) -> bool
[src]
pub fn get_region(&self, ctx: &str) -> Result<Region>
[src]
pub fn get_region(&self, ctx: &str) -> Result<Region>
[src]Region retriever interface
This retieves the region after calling resolve_context. Useful for small helper subcommands that do validation later.
pub fn get_regions(&self) -> Vec<Region>
[src]
pub fn get_regions(&self) -> Vec<Region>
[src]Region exposer (needed in a few special cases, raftcat, crd reconcile)
pub fn find_owning_cluster(&self, region: &Region) -> Option<Cluster>
[src]
pub fn find_owning_cluster(&self, region: &Region) -> Option<Cluster>
[src]Find the Cluster struct that owns this Region
impl Config
[src]
impl Config
[src]Filesystem accessors for Config
These must live in here because they use private methods herein.
pub async fn new(state: ConfigState, context: &str) -> Result<(Config, Region)>
[src]
pub async fn new(state: ConfigState, context: &str) -> Result<(Config, Region)>
[src]Main constructor for CLI
Pass this a region request via argument or a current context
pub fn has_all_regions(&self) -> bool
[src]
pub fn get_region_unchecked(&self, region: &str) -> Option<&Region>
[src]
pub fn get_region_unchecked(&self, region: &str) -> Option<&Region>
[src]Region retriever for global reducers
Assumes you have not filtered a config in main accidentally.
Trait Implementations
impl<'de> Deserialize<'de> for Config
[src]
impl<'de> Deserialize<'de> for Config
[src]fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]Deserialize this value from the given Serde deserializer. Read more
impl From<Config> for ShipcatConfig
[src]
impl From<Config> for ShipcatConfig
[src]fn from(conf: Config) -> ShipcatConfig
[src]
fn from(conf: Config) -> ShipcatConfig
[src]Performs the conversion.
Auto Trait Implementations
impl !RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,