Struct kubewarden_policy_sdk::cluster_context::ClusterContext[][src]

pub struct ClusterContext {}

A ClusterContext allows a waPC guest policy to retrieve cluster contextual information from a Kubernetes cluster.

Right now a set of well known resources is hardcoded, but the idea is to generalize this so the SDK can support any kind of Kubernetes resource and custom resource definition.

Implementations

impl ClusterContext[src]

pub fn ingresses(namespace: NamespaceFilter) -> Result<Vec<Ingress>>[src]

Return the list of Ingress resources that exist in the cluster.

pub fn namespaces() -> Result<Vec<Namespace>>[src]

Return the list of Namespace resources that exist in the cluster.

pub fn services(namespace: NamespaceFilter) -> Result<Vec<Service>>[src]

Return the list of Service resources that exist in the cluster.

impl ClusterContext[src]

pub fn ingress(namespace: NamespaceFilter, name: &str) -> Result<Vec<Ingress>>[src]

Return a specific ingress object with a given name and a namespace filter. If the namespace filter is broad, more than one resource might be returned.

pub fn namespace(name: &str) -> Result<Option<Namespace>>[src]

pub fn service(namespace: NamespaceFilter, name: &str) -> Result<Vec<Service>>[src]

Return a specific service object with a given name and a namespace filter. If the namespace filter is broad, more than one resource might be returned.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

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

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

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

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

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.

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.