-
Notifications
You must be signed in to change notification settings - Fork 24
Update JOSDK to v5.1.2 #93
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, few comments.
operator/src/test/java/io/strimzi/kafka/access/KafkaAccessReconcilerTest.java
Show resolved
Hide resolved
operator/src/test/java/io/strimzi/kafka/access/SecretDependentResourceTest.java
Outdated
Show resolved
Hide resolved
operator/src/test/java/io/strimzi/kafka/access/SecretDependentResourceTest.java
Outdated
Show resolved
Hide resolved
ec144f7
to
a7b7659
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @OwenCorrigan76. I think we need some additional changes for the switch to SSA and I don't think the Kafka Access Secret event source is being used correctly. Also from reviewing the migration docs I think we need to change the way we use the SDK generation to use the maven plugin.
api/src/main/java/io/strimzi/kafka/access/model/KafkaAccessStatus.java
Outdated
Show resolved
Hide resolved
api/src/main/java/io/strimzi/kafka/access/model/KafkaAccessStatus.java
Outdated
Show resolved
Hide resolved
operator/src/main/java/io/strimzi/kafka/access/KafkaAccessReconciler.java
Outdated
Show resolved
Hide resolved
operator/src/main/java/io/strimzi/kafka/access/KafkaAccessReconciler.java
Show resolved
Hide resolved
operator/src/main/java/io/strimzi/kafka/access/KafkaAccessReconciler.java
Outdated
Show resolved
Hide resolved
operator/src/main/java/io/strimzi/kafka/access/KafkaAccessReconciler.java
Outdated
Show resolved
Hide resolved
operator/src/main/java/io/strimzi/kafka/access/KafkaAccessReconciler.java
Outdated
Show resolved
Hide resolved
operator/src/main/java/io/strimzi/kafka/access/KafkaAccessReconciler.java
Show resolved
Hide resolved
operator/src/test/java/io/strimzi/kafka/access/KafkaAccessReconcilerTest.java
Outdated
Show resolved
Hide resolved
ceca15e
to
dedd7b5
Compare
@OwenCorrigan76 about the unused declared dependency -> you removed the |
That's exactly the reason. Thanks @im-konge |
03a26d0
to
e063acb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes, few more comments.
* The custom reconciler of Strimzi Access Operator | ||
*/ | ||
@SuppressWarnings("ClassFanOutComplexity") | ||
@SuppressWarnings({"ClassFanOutComplexity"}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SuppressWarnings({"ClassFanOutComplexity"}) | |
@SuppressWarnings("ClassFanOutComplexity") |
I think that you can revert this change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I had "ClassDataAbstractionCoupling"
at one stage and didn't remove the }
's.
|
||
/** | ||
* Prepares the event sources required for triggering the reconciliation | ||
* Prepares the event sources required for triggering the reconciliation. This tells the JOSDK framework which resources the operator needs to watch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Prepares the event sources required for triggering the reconciliation. This tells the JOSDK framework which resources the operator needs to watch. | |
* Prepares the event sources required for triggering the reconciliation. | |
* It configures the JOSDK framework with resources the operator needs to watch. |
Or something like that?
operator/src/main/java/io/strimzi/kafka/access/KafkaAccessReconciler.java
Show resolved
Hide resolved
void beforeEach() { | ||
operator = new Operator(overrider -> overrider.withKubernetesClient(client)); | ||
operator = new Operator(overrider -> overrider.withKubernetesClient(client) | ||
.withUseSSAToPatchPrimaryResource(false)); // Motivation: mock Kubernetes client doesn't fully support some SSA features. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should add the SSA implementation issue link into the comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it look like this:
void beforeEach() {
operator = new Operator(overrider -> overrider.withKubernetesClient(client)
/**
* Disables the use of Server-Side Apply for patching the primary resource.
* Motivation: Mock Kubernetes client doesn't fully support SSA features.
* See: <a href="https://github.com/fabric8io/kubernetes-client/issues/5337">fabric8io/kubernetes-client Issue #5337</a>
**/
.withUseSSAToPatchPrimaryResource(false));
operator.register(new KafkaAccessReconciler(operator.getKubernetesClient()));
operator.start();
}
Or what's the best format for the comment? Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding the following: return ErrorStatusUpdateControl.updateStatus(kafkaAccess);
This is deprecated in v5
. The only options are : patchStatus
, patchResource
and patchResourceAndStatus
pom.xml
Outdated
<javaoperatorsdk.version>4.4.2</javaoperatorsdk.version> | ||
<javaoperatorsdk.version>5.1.2</javaoperatorsdk.version> | ||
<fabric8.version>7.2.0</fabric8.version> | ||
<fabric8-client.version>7.4.0</fabric8-client.version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for my ignorance, for what is this used for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added to test something and forgot to remove. Will remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @OwenCorrigan76 I think we're pretty close now, but a couple more changes needed.
* | ||
* @return The observed generation. | ||
*/ | ||
public Long getObservedGeneration() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public Long getObservedGeneration() { | |
public long getObservedGeneration() { |
return observedGeneration; | ||
} | ||
|
||
public void setObservedGeneration(Long observedGeneration) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public void setObservedGeneration(Long observedGeneration) { | |
public void setObservedGeneration(long observedGeneration) { |
operator/src/main/java/io/strimzi/kafka/access/KafkaAccessReconciler.java
Show resolved
Hide resolved
@BeforeEach | ||
void beforeEach() { | ||
operator = new Operator(overrider -> overrider.withKubernetesClient(client)); | ||
operator = new Operator(overrider -> overrider.withKubernetesClient(client) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Presumably we need a matching change to this in the Operator class right? So it applies when running the actual operator as well as in the tests.
Signed-off-by: OwenCorrigan76 <[email protected]>
Signed-off-by: OwenCorrigan76 <[email protected]>
Signed-off-by: OwenCorrigan76 <[email protected]>
Signed-off-by: OwenCorrigan76 <[email protected]>
Signed-off-by: OwenCorrigan76 <[email protected]>
Signed-off-by: OwenCorrigan76 <[email protected]>
Signed-off-by: OwenCorrigan76 <[email protected]>
Signed-off-by: OwenCorrigan76 <[email protected]>
07fb651
to
1c73e14
Compare
This PR migrates the Java Operator SDK from v4.4.2 to v5.1.2. The updated vesrion will allow Access Operator to watch Kafka clusters in a remote Kubernetes cluster, as requested in issue #44.
This PR directly addresses the follwoing issue: #89