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

Target StatefulSet without copy_target. #2536

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

Conversation

meowjesty
Copy link
Member

  1. Small refactor on the cli getting a list of (kube) resources;
  2. Adds statefulset compliance to verify-config;

@aviramha
Copy link
Member

aviramha commented Jun 20, 2024

Create an issue to check for new targets for after we finish the backward compatibility fixes with operator (jobs,cronjobs,statefulsets should be tested only when operator)

@Razz4780 Razz4780 self-requested a review July 2, 2024 15:23
@Razz4780 Razz4780 self-assigned this Jul 2, 2024
Copy link
Contributor

@Razz4780 Razz4780 left a comment

Choose a reason for hiding this comment

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

Only nits, needs rebasing though.

mirrord/cli/src/kube_resource.rs Outdated Show resolved Hide resolved
mirrord/cli/src/kube_resource.rs Outdated Show resolved Hide resolved
mirrord/cli/src/verify_config.rs Show resolved Hide resolved
mirrord/cli/src/verify_config.rs Outdated Show resolved Hide resolved
tests/src/utils.rs Show resolved Hide resolved
Copy link
Contributor

@Razz4780 Razz4780 left a comment

Choose a reason for hiding this comment

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

One more thing

Comment on lines 206 to 208
"{verified_target} target requires the mirrord-operator, but the config \
was set to `operator: false`! Consider setting `operator: true` for \
this target type."
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"{verified_target} target requires the mirrord-operator, but the config \
was set to `operator: false`! Consider setting `operator: true` for \
this target type."
format!("{} targets require the mirrord-operator, but operator usage was explicitly disabled. Consider enabling mirrord-operator in your mirrord config.", verified_target.target_type())

Requires implementing VerifiedTarget::target_type(&self) -> TargetType and Display for TargetType but would be nicer, I think

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed. I ended up impl'ing Into, wdyt?

Comment on lines +50 to +52
fn requires_operator(&self) -> bool {
matches!(self, Self::CronJob(_) | Self::Job(_) | Self::StatefulSet(_))
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this check be in LayerConfig::verify_config?

Copy link
Member Author

Choose a reason for hiding this comment

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

Do you mean in here pub fn verify(&self, context: &mut ConfigContext) -> Result<(), ConfigError>, instead of in the verify_config?

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.

None yet

3 participants