Skip to content

Instantly share code, notes, and snippets.

View mati865's full-sized avatar

Mateusz Mikuła mati865

  • małopolskie, Poland
  • 05:34 (UTC +01:00)
View GitHub Profile
@BrandonPotter
BrandonPotter / kubernetes-latest-image.md
Last active February 21, 2020 01:20
Force Kubernetes to pull latest container image in a deployment

Force Kubernetes to pull latest container image in a deployment

kubectl patch deployment DEPLOYMENT_NAME -p "{\"spec\":{\"template\":{\"metadata\":{\"labels\":{\"date\":\"`date +'%s'`\"}}}}}"
kubectl get pods | grep Evicted | awk '{print $1}' | xargs kubectl delete pod
use git2::Delta;
use git2::DiffOptions;
use git2::Repository;
use std::collections::BTreeMap;
use std::env::set_current_dir;
use std::process::Command;
fn main() {
let repo = Repository::open_from_env().unwrap();
set_current_dir(repo.workdir().unwrap()).unwrap();