Skip to content

Commit

Permalink
change event recorder cluster namespace to kube-system
Browse files Browse the repository at this point in the history
because publishing to "default" is a fallback thing.
fixes #870

Signed-off-by: clux <sszynrae@gmail.com>
  • Loading branch information
clux committed Apr 8, 2022
1 parent 7b2d145 commit a9315c9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kube-runtime/src/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ impl Recorder {
/// Cluster scoped objects will publish events in the "default" namespace.
#[must_use]
pub fn new(client: Client, reporter: Reporter, reference: ObjectReference) -> Self {
let default_namespace = "default".to_owned();
let default_namespace = "kube-system".to_owned(); // default does not work on k8s < 1.22
let events = Api::namespaced(client, reference.namespace.as_ref().unwrap_or(&default_namespace));
Self {
events,
Expand Down Expand Up @@ -294,7 +294,7 @@ mod test {
secondary: None,
})
.await?;
let events: Api<CoreEvent> = Api::namespaced(client, "default");
let events: Api<CoreEvent> = Api::namespaced(client, "kube-system");

let event_list = events.list(&Default::default()).await?;
let found_event = event_list
Expand Down

0 comments on commit a9315c9

Please sign in to comment.