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]

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 print(&self) -> Result<()>[src]

Print Config to stdout

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]

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]

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]

Region exposer (needed in a few special cases, raftcat, crd reconcile)

pub fn find_owning_cluster(&self, region: &Region) -> Option<Cluster>[src]

Find the Cluster struct that owns this Region

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]

Main constructor for CLI

Pass this a region request via argument or a current context

pub async fn read() -> Result<Config>[src]

Read a config in pwd and leave placeholders

pub fn has_all_regions(&self) -> bool[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 Clone for Config[src]

fn clone(&self) -> Config[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Config[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl<'de> Deserialize<'de> for Config[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]

fn from(conf: Config) -> ShipcatConfig[src]

Performs the conversion.

impl Serialize for Config[src]

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
    __S: Serializer
[src]

Serialize this value into the given Serde serializer. Read more

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> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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]

🔬 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, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]

pub fn vzip(self) -> V[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]