Skip to content

Commit

Permalink
chore: Upgrade crates, adjust labels, Bump version to 0.8.10
Browse files Browse the repository at this point in the history
  • Loading branch information
wangeguo committed Jan 31, 2024
1 parent b375f40 commit ade15fb
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 15 deletions.
16 changes: 8 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[workspace.package]
version = "0.8.9"
version = "0.8.10"
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/amphitheatre-app/amphitheatre"
Expand Down
2 changes: 1 addition & 1 deletion apiserver/src/handlers/actor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ pub async fn logs(
// Watch the status of the pod, if the pod is running, then create a stream for it.
tokio::spawn(async move {
let api: Api<Pod> = Api::namespaced(ctx.k8s.clone(), &format!("amp-{pid}"));
let config = watcher::Config::default().labels(&format!("app.kubernetes.io/name={name}"));
let config = watcher::Config::default().labels(&format!("amphitheatre.app/character={name}"));
let mut watcher = watcher(api.clone(), config).applied_objects().boxed();
let subs = Arc::new(RwLock::new(HashSet::new()));

Expand Down
2 changes: 1 addition & 1 deletion resources/src/actor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ pub async fn patch_status(client: &Client, actor: &Actor, condition: Condition)

pub async fn metrics(client: &Client, namespace: &str, name: &str) -> Result<PodMetrics> {
let api: Api<PodMetrics> = Api::namespaced(client.clone(), namespace);
let params = ListParams::default().labels(&format!("app.kubernetes.io/name={}", name)).limit(1);
let params = ListParams::default().labels(&format!("amphitheatre.app/character={}", name)).limit(1);
let resources = api.list(&params).await;
debug!("Metrics for Actor {}:\n{:?}", name, resources);

Expand Down
2 changes: 1 addition & 1 deletion resources/src/deployment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ pub fn new(actor: &Actor, pod: PodSpec) -> Result<Deployment> {
// Build the metadata for the deployment
let owner_reference = actor.controller_owner_ref(&()).unwrap();
let labels = BTreeMap::from([
("app.kubernetes.io/name".into(), name.clone()),
("amphitheatre.app/character".into(), name.clone()),
("app.kubernetes.io/managed-by".into(), "Amphitheatre".into()),
]);
let annotations = BTreeMap::from([(LAST_APPLIED_HASH_KEY.into(), hash(&actor.spec)?)]);
Expand Down
6 changes: 5 additions & 1 deletion resources/src/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ fn new(actor: &Actor) -> Result<DynamicObject> {
"kind": "Image",
"metadata": {
"name": name.clone(),
"ownerReferences": vec![owner_reference]
"ownerReferences": vec![owner_reference],
"labels": {
"amphitheatre.app/character": name.clone(),
"app.kubernetes.io/managed-by": "Amphitheatre",
},
},
"spec": {
"tag": actor.spec.image,
Expand Down
2 changes: 1 addition & 1 deletion resources/src/job.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ fn new(actor: &Actor, pod: PodSpec) -> Result<Job> {
let owner_reference = actor.controller_owner_ref(&()).unwrap();
let annotations = BTreeMap::from([(LAST_APPLIED_HASH_KEY.into(), hash(&actor.spec)?)]);
let labels = BTreeMap::from([
("app.kubernetes.io/name".into(), name.clone()),
("amphitheatre.app/character".into(), name.clone()),
("app.kubernetes.io/managed-by".into(), "Amphitheatre".into()),
]);

Expand Down
2 changes: 1 addition & 1 deletion resources/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ fn new(actor: &Actor) -> Result<Service> {
// Build the metadata for the service
let owner_reference = actor.controller_owner_ref(&()).unwrap();
let labels = BTreeMap::from([
("app.kubernetes.io/name".into(), name.clone()),
("amphitheatre.app/character".into(), name.clone()),
("app.kubernetes.io/managed-by".into(), "Amphitheatre".into()),
]);
let annotations = BTreeMap::from([(LAST_APPLIED_HASH_KEY.into(), hash(&actor.spec)?)]);
Expand Down

0 comments on commit ade15fb

Please sign in to comment.