6WWZUDNYHVYEQJHHJCUBMOZME2LG4SATAXSADBECKPBUGR3QLYTAC ---apiVersion: karbon/v1alpha1kind: Karbonfileresources:- ../../basetransformations:- target:kind: Deploymentpatches:- op: addpath: /spec/template/spec/containers/0/commandvalue: ["web"]- op: addpath: /spec/template/spec/containers/0/argsvalue: ["start", "-p", "8080"]
apiVersion: karbon/v1alpha1kind: Karbonfileresources:? !karbonfile ../../base? !files service.yml? !files ingress.ymltransformations:- nameSuffix: '-web'- filter:kind: Deploymentmetadata:name: testadd:/spec/template/spec/containers/0/ports/-/containerPort: 8080.spec.revisionHistoryLimit: 3spec:strategy:rollingUpdate:maxUnavailable: 0maxSurge: 50%
apiVersion: networking.k8s.io/v1kind: Ingressmetadata:creationTimestamp: nullname: testspec:rules:- host: test.localhttp:paths:- backend:service:name: testport:number: 8080path: /pathType: Exactstatus:loadBalancer: {}
apiVersion: karbon/v1alpha1kind: Karbonfileresources:? !files deployment.ymltransformations: []
apiVersion: apps/v1kind: Deploymentmetadata:creationTimestamp: nulllabels:app: testname: testspec:replicas: 1selector:matchLabels:app: teststrategy: {}template:metadata:creationTimestamp: nulllabels:app: testspec:containers:- image: bashname: bashresources: {}status: {}
#[derive(Deserialize, Debug)]
#[derive(Deserialize, Clone, Debug)]#[serde(rename_all = "lowercase")]#[serde(deny_unknown_fields)]enum Resource {Files(PathBuf),Karbonfile(PathBuf),//Git { path: PathBuf },}impl Resource {fn path(&self) -> PathBuf {use Resource::*;match self {Files(p) => { p.clone() }Karbonfile(p) => { p.clone() }}}}impl PartialEq for Resource {fn eq(&self, other: &Self) -> bool {self.path() == other.path()}}impl Eq for Resource {}impl Hash for Resource {fn hash<H: Hasher>(&self, state: &mut H) {use Resource::*;match self {Files(p) => p.hash(state),Karbonfile(p) => p.hash(state),}}}#[derive(Deserialize, Clone, Debug)]
fn build_tree(path: PathBuf, mut branch: Vec<PathBuf>, result: &mut Vec<Vec<PathBuf>>) {let canonical = find_resource_file(&path);
fn set_path(&mut self, p: PathBuf) {self.resource_path = Some(p);}fn add_transformation(&mut self, p: PathBuf, t: Vec<Transformation>) {self.transformations.insert(p, t);}}