Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Service as a new target type #3022

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

Razz4780
Copy link
Contributor

@Razz4780 Razz4780 commented Jan 17, 2025

@t4lz t4lz self-requested a review January 17, 2025 15:44
Copy link
Member

@t4lz t4lz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just a couple of doc nitpicks etc.

@@ -87,42 +94,67 @@ fn make_simple_target_custom_schema(gen: &mut SchemaGenerator) -> schemars::sche
/// }
/// ```
///
/// Setup above will result in a session targeting the `bear-pod` Kubernetes pod
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Setup above will result in a session targeting the `bear-pod` Kubernetes pod
/// The setup above will result in a session targeting the `bear-pod` Kubernetes pod

@@ -87,42 +94,67 @@ fn make_simple_target_custom_schema(gen: &mut SchemaGenerator) -> schemars::sche
/// }
/// ```
///
/// Setup above will result in a session targeting the `bear-pod` Kubernetes pod
/// in the user's default namespace. Target container will be chosen by mirrord.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// in the user's default namespace. Target container will be chosen by mirrord.
/// in the user's default namespace. A target container will be chosen by mirrord.

/// }
/// ```
///
/// Setup above will result in a session targeting the `bear-pod-container` container
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Setup above will result in a session targeting the `bear-pod-container` container
/// The setup above will result in a session targeting the `bear-pod-container` container

/// }
/// }
/// ```
///
/// Setup above will result in a session targeting the `bear-pod-container` container
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Setup above will result in a session targeting the `bear-pod-container` container
/// The setup above will result in a session targeting the `bear-pod-container` container

#[serde(skip_serializing_if = "Option::is_none")]
pub path: Option<Target>,

/// ### target.namespace {#target-namespace}
///
/// Namespace where the target lives.
///
/// Defaults to `"default"`.
/// Defaults to Kubernetes user's default namespace (defined in Kubernetes context).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Defaults to Kubernetes user's default namespace (defined in Kubernetes context).
/// Defaults to the Kubernetes user's default namespace (defined in Kubernetes context).

Pod(pod::PodTarget),

/// <!--${internal}-->
/// Mirror a rollout.
/// [Rollout](https://argoproj.github.io/argo-rollouts/#how-does-it-work).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// [Rollout](https://argoproj.github.io/argo-rollouts/#how-does-it-work).
/// [Argo Rollout](https://argoproj.github.io/argo-rollouts/#how-does-it-work).

Comment on lines -274 to +281
#[allow(async_fn_in_trait)]
async fn runtime_data(&self, client: &Client, namespace: Option<&str>) -> Result<RuntimeData>;
fn runtime_data(
&self,
client: &Client,
namespace: Option<&str>,
) -> impl Future<Output = Result<RuntimeData>>;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it better this way?

async fn get_selector_match_labels(
resource: &Self::Resource,
) -> Result<BTreeMap<String, String>> {
fn get_selector_match_labels(resource: &Self::Resource) -> Result<BTreeMap<String, String>> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should enable clippy's unused_async lint? I'm surprised it's not on by default.

@@ -303,13 +276,18 @@ impl ResolvedTarget<false> {
Ok(target)
}

/// Check if the target can be used as a mirrord target.
/// Checks if the target can be used as a via the mirrord Operator.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence needs fixing. ("... as a via ...")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants