Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nhudson committed Sep 9, 2024
1 parent 415a9aa commit d5688df
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
10 changes: 1 addition & 9 deletions .github/actions/argocd-update/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,15 @@ runs:
with:
cmd: |
yq -i '.spec.source.targetRevision= "${{ inputs.version }}"' ${{ inputs.clone_into }}/${{ inputs.subdirectory }}/tembo-metrics-use1.yaml
yq -i '.spec.source.targetRevision= "${{ inputs.version }}"' ${{ inputs.clone_into }}/${{ inputs.subdirectory }}/tembo-metrics-euc1.yaml
yq -i '(.spec.source.helm.parameters.[] | select(.name == "image.tag")).value = "${{ inputs.version }}"' ${{ inputs.clone_into }}/${{ inputs.subdirectory }}/tembo-metrics-use1.yaml
yq -i '(.spec.source.helm.parameters.[] | select(.name == "image.tag")).value = "${{ inputs.version }}"' ${{ inputs.clone_into }}/${{ inputs.subdirectory }}/tembo-metrics-euc1.yaml
- name: Update for prod deployments
if: inputs.branch == 'prod-updates'
uses: mikefarah/[email protected]
with:
cmd: |
yq -i '.spec.source.targetRevision= "${{ inputs.version }}"' ${{ inputs.clone_into }}/${{ inputs.subdirectory }}/tembo-metrics-use1.yaml
yq -i '.spec.source.targetRevision= "${{ inputs.version }}"' ${{ inputs.clone_into }}/${{ inputs.subdirectory }}/tembo-metrics-euc1.yaml
yq -i '.spec.source.targetRevision= "${{ inputs.version }}"' ${{ inputs.clone_into }}/${{ inputs.subdirectory }}/tembo-metrics-apse1.yaml
yq -i '.spec.source.targetRevision= "${{ inputs.version }}"' ${{ inputs.clone_into }}/${{ inputs.subdirectory }}/tembo-metrics-usw2.yaml
yq -i '(.spec.source.helm.parameters.[] | select(.name == "image.tag")).value = "${{ inputs.version }}"' ${{ inputs.clone_into }}/${{ inputs.subdirectory }}/tembo-metrics-use1.yaml
yq -i '(.spec.source.helm.parameters.[] | select(.name == "image.tag")).value = "${{ inputs.version }}"' ${{ inputs.clone_into }}/${{ inputs.subdirectory }}/tembo-metrics-euc1.yaml
yq -i '(.spec.source.helm.parameters.[] | select(.name == "image.tag")).value = "${{ inputs.version }}"' ${{ inputs.clone_into }}/${{ inputs.subdirectory }}/tembo-metrics-apse1.yaml
yq -i '(.spec.source.helm.parameters.[] | select(.name == "image.tag")).value = "${{ inputs.version }}"' ${{ inputs.clone_into }}/${{ inputs.subdirectory }}/tembo-metrics-usw2.yaml
- name: Git commit and push to remote
shell: bash
Expand All @@ -71,5 +63,5 @@ runs:
git add --all
# debugging
git diff HEAD
git commit -m "Update from coredb-io/control-plane: ${{ inputs.version }}"
git commit -m "Update from tembo-io/tembo-metrics: ${{ inputs.version }}"
git push origin ${{ inputs.branch }}
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ edition = "2021"
[dependencies]
actix-web = "4.8"
aws-config = "1.5"
aws-sdk-servicequotas = "1.36"
aws-sdk-cloudformation = "1.41"
aws-sdk-iam = "1.38"
aws-sdk-servicequotas = "1"
aws-sdk-cloudformation = "1"
aws-sdk-iam = "1"
tokio = { version = "1", features = ["rt", "sync", "time", "parking_lot"] }
serde_json = "1"
clap = { version = "4.5", features = ["derive"] }
Expand Down
6 changes: 4 additions & 2 deletions src/aws/servicequotas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub async fn get_cf_stack_quota(client: &Client) -> Result<i64, Box<dyn std::err
let quota = resp
.quota
.and_then(|q| q.value)
.ok_or("Failed to get Cloudformation Stack quote")?;
.ok_or("Failed to get Cloudformation Stack quota")?;

Ok(quota as i64)
}
Expand All @@ -28,10 +28,12 @@ pub async fn get_iam_role_quota(client: &Client) -> Result<i64, Box<dyn std::err
.send()
.await?;

println!("resp: {:?}", resp);

let quota = resp
.quota
.and_then(|q| q.value)
.ok_or("Failed to get IAM Role quote")?;
.ok_or("Failed to get IAM Role quota")?;

Ok(quota as i64)
}

0 comments on commit d5688df

Please sign in to comment.