Skip to content

Commit

Permalink
Apply camelCase naming and branch customization
Browse files Browse the repository at this point in the history
Added #[serde(rename_all = "camelCase")] to InnerGitStackSourceSpec structure for JSON serialization consistency. In git/service.rs, added a conditional check to apply a custom git branch if specified in 'git_ref', providing more flexibility in git operation.
  • Loading branch information
jan-br committed Sep 25, 2023
1 parent edc760d commit 73ce942
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions pulumi-operator-kubernetes-job/src/git/service.rs
Expand Up @@ -93,6 +93,9 @@ impl GitService {
fo.remote_callbacks(callback);

let mut builder = RepoBuilder::new();
if let Some(git_ref) = spec.git_ref {
builder.branch(&git_ref);
}
builder.fetch_options(fo);

builder.clone(spec.repository.as_str(), Path::new("./source"))?;
Expand Down
2 changes: 1 addition & 1 deletion pulumi-operator-kubernetes/src/stack/service.rs
Expand Up @@ -58,7 +58,7 @@ impl KubernetesPulumiStackService {

let mut main_container: Container = serde_json::from_value(json!({
"name": "pulumi",
"image": "ghcr.io/stromee/pulumi-operator/pulumi-operator-kubernetes-job:1.0.18",
"image": "ghcr.io/stromee/pulumi-operator/pulumi-operator-kubernetes-job:1.0.20",
"env": [{
"name": "PULUMI_STACK",
"value": name
Expand Down
1 change: 1 addition & 0 deletions pulumi-operator-kubernetes/src/stack/source/git/inner.rs
Expand Up @@ -2,6 +2,7 @@ use schemars::JsonSchema;
use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub struct InnerGitStackSourceSpec {
pub repository: String,
#[serde(rename = "ref")]
Expand Down

0 comments on commit 73ce942

Please sign in to comment.