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

Confluent CLI migration #91

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
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
Prev Previous commit
add ACLs before removing ACLs
  • Loading branch information
tball-dev committed May 4, 2022
commit 98e28c6c5f3e2830b0d2b887d6c985dbd9ff43d1
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.devshawn.kafka.gitops.manager;

import com.devshawn.kafka.gitops.config.ManagerConfig;
import com.devshawn.kafka.gitops.domain.plan.AclPlan;
import com.devshawn.kafka.gitops.domain.plan.DesiredPlan;
import com.devshawn.kafka.gitops.domain.plan.TopicConfigPlan;
import com.devshawn.kafka.gitops.domain.plan.TopicPlan;
Expand Down Expand Up @@ -63,7 +64,9 @@ private void applyTopicConfiguration(TopicPlan topicPlan, TopicConfigPlan topicC
}

public void applyAcls(DesiredPlan desiredPlan) {
desiredPlan.getAclPlans().forEach(aclPlan -> {
List<AclPlan> modifiableAclPlan = new ArrayList<>(desiredPlan.getAclPlans());
modifiableAclPlan.sort(Comparator.comparing(AclPlan::getAction));
modifiableAclPlan.forEach(aclPlan -> {
if (aclPlan.getAction() == PlanAction.ADD) {
LogUtil.printAclPreApply(aclPlan);
kafkaService.createAcl(aclPlan.getAclDetails().toAclBinding());
Expand Down