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

4. Adding Support For VPA and Auto Mode in CreateExperiment [KRUIZE-VPA Integration] #1415

Merged
merged 3 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,22 @@ public ExperimentUseCaseType(KruizeObject kruizeObject) throws Exception {
throw new Exception("Invalid Mode " + kruizeObject.getMode() + " for target cluster as Remote.");
}
} else if (kruizeObject.getTarget_cluster().equalsIgnoreCase(AnalyzerConstants.LOCAL)) {
if (kruizeObject.getMode().equalsIgnoreCase(AnalyzerConstants.MONITOR)) {
setLocal_monitoring(true);
} else if (kruizeObject.getMode().equalsIgnoreCase(AnalyzerConstants.EXPERIMENT)) {
setLocal_experiment(true);
} else {
throw new Exception("Invalid Mode " + kruizeObject.getMode() + " for target cluster as Local.");
switch (kruizeObject.getMode().toLowerCase()) {
case AnalyzerConstants.MONITOR:
setLocal_monitoring(true);
break;

case AnalyzerConstants.EXPERIMENT:
setLocal_experiment(true);
break;

case AnalyzerConstants.RECREATE:
case AnalyzerConstants.AUTO:
Copy link
Contributor

Choose a reason for hiding this comment

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

Please combine this with MONITOR as currently they are all the same

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure dino! I have updated the code to use switch case block and combined the RECREATE and AUTO cases with the MONITOR case.

setLocal_monitoring(true);
break;

default:
throw new Exception("Invalid Mode " + kruizeObject.getMode() + " for target cluster as Local.");
}
} else {
throw new Exception("Invalid Target cluster type");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ public class AnalyzerConstants {
public static final String EXPERIMENT = "experiment";
public static final String LOCAL = "local";
public static final String REMOTE = "remote";
public static final String AUTO = "auto";
public static final String RECREATE = "recreate";



// Used to parse autotune configmaps
Expand Down
Loading