diff --git a/src/main/java/com/devshawn/kafka/gitops/MainCommand.java b/src/main/java/com/devshawn/kafka/gitops/MainCommand.java index e4b7b4cd..ef3b9a5c 100644 --- a/src/main/java/com/devshawn/kafka/gitops/MainCommand.java +++ b/src/main/java/com/devshawn/kafka/gitops/MainCommand.java @@ -30,6 +30,9 @@ public class MainCommand implements Callable { @Option(names = {"--no-delete"}, description = "Disable the ability to delete resources.") private boolean deleteDisabled = false; + @Option(names = {"--skip-acls"}, description = "Do not take ACL into account in the plan file.") + private boolean skipAcls = false; + @Option(names = {"-h", "--help"}, usageHelp = true, description = "Display this help message.") private boolean helpRequested = false; @@ -65,6 +68,10 @@ public boolean isDeleteDisabled() { return deleteDisabled; } + public boolean areAclsDisabled() { + return skipAcls; + } + public static void main(String[] args) { int exitCode = new CommandLine(new MainCommand()).execute(args); System.exit(exitCode); diff --git a/src/main/java/com/devshawn/kafka/gitops/StateManager.java b/src/main/java/com/devshawn/kafka/gitops/StateManager.java index 3120f64b..a10c8319 100644 --- a/src/main/java/com/devshawn/kafka/gitops/StateManager.java +++ b/src/main/java/com/devshawn/kafka/gitops/StateManager.java @@ -86,7 +86,9 @@ public DesiredPlan plan() { private DesiredPlan generatePlan() { DesiredState desiredState = getDesiredState(); DesiredPlan.Builder desiredPlan = new DesiredPlan.Builder(); - planManager.planAcls(desiredState, desiredPlan); + if (!managerConfig.isSkipAclsDisabled()) { + planManager.planAcls(desiredState, desiredPlan); + } planManager.planTopics(desiredState, desiredPlan); return desiredPlan.build(); } diff --git a/src/main/java/com/devshawn/kafka/gitops/cli/AccountCommand.java b/src/main/java/com/devshawn/kafka/gitops/cli/AccountCommand.java index 3fdb6d86..31ebcdc5 100644 --- a/src/main/java/com/devshawn/kafka/gitops/cli/AccountCommand.java +++ b/src/main/java/com/devshawn/kafka/gitops/cli/AccountCommand.java @@ -45,6 +45,7 @@ private ManagerConfig generateStateManagerConfig() { .setVerboseRequested(parent.isVerboseRequested()) .setDeleteDisabled(parent.isDeleteDisabled()) .setIncludeUnchangedEnabled(false) + .setSkipAclsDisabled(parent.areAclsDisabled()) .setStateFile(parent.getFile()) .build(); } diff --git a/src/main/java/com/devshawn/kafka/gitops/cli/ApplyCommand.java b/src/main/java/com/devshawn/kafka/gitops/cli/ApplyCommand.java index 429ab628..af47826b 100644 --- a/src/main/java/com/devshawn/kafka/gitops/cli/ApplyCommand.java +++ b/src/main/java/com/devshawn/kafka/gitops/cli/ApplyCommand.java @@ -54,6 +54,7 @@ private ManagerConfig generateStateManagerConfig() { .setVerboseRequested(parent.isVerboseRequested()) .setDeleteDisabled(parent.isDeleteDisabled()) .setIncludeUnchangedEnabled(false) + .setSkipAclsDisabled(parent.areAclsDisabled()) .setStateFile(parent.getFile()) .setNullablePlanFile(planFile) .build(); diff --git a/src/main/java/com/devshawn/kafka/gitops/cli/PlanCommand.java b/src/main/java/com/devshawn/kafka/gitops/cli/PlanCommand.java index f482de1b..d6e3c119 100644 --- a/src/main/java/com/devshawn/kafka/gitops/cli/PlanCommand.java +++ b/src/main/java/com/devshawn/kafka/gitops/cli/PlanCommand.java @@ -59,6 +59,7 @@ private ManagerConfig generateStateManagerConfig() { .setDeleteDisabled(parent.isDeleteDisabled()) .setIncludeUnchangedEnabled(includeUnchanged) .setStateFile(parent.getFile()) + .setSkipAclsDisabled(parent.areAclsDisabled()) .setNullablePlanFile(outputFile) .build(); } diff --git a/src/main/java/com/devshawn/kafka/gitops/cli/ValidateCommand.java b/src/main/java/com/devshawn/kafka/gitops/cli/ValidateCommand.java index 91c8905d..eac01493 100644 --- a/src/main/java/com/devshawn/kafka/gitops/cli/ValidateCommand.java +++ b/src/main/java/com/devshawn/kafka/gitops/cli/ValidateCommand.java @@ -37,6 +37,7 @@ private ManagerConfig generateStateManagerConfig() { .setVerboseRequested(parent.isVerboseRequested()) .setDeleteDisabled(parent.isDeleteDisabled()) .setIncludeUnchangedEnabled(false) + .setSkipAclsDisabled(parent.areAclsDisabled()) .setStateFile(parent.getFile()) .build(); } diff --git a/src/main/java/com/devshawn/kafka/gitops/config/ManagerConfig.java b/src/main/java/com/devshawn/kafka/gitops/config/ManagerConfig.java index a9688505..c1db3468 100644 --- a/src/main/java/com/devshawn/kafka/gitops/config/ManagerConfig.java +++ b/src/main/java/com/devshawn/kafka/gitops/config/ManagerConfig.java @@ -16,6 +16,8 @@ public interface ManagerConfig { boolean isIncludeUnchangedEnabled(); + boolean isSkipAclsDisabled(); + File getStateFile(); Optional getPlanFile();