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

Add @Buildable annotation to all model classes for generating the Builder classes #49

Merged
merged 9 commits into from
Jun 3, 2024
4 changes: 3 additions & 1 deletion .checkstyle/suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@
* To suppress a bunch of class (for example generated code)
* To suppress warning we do not want for the whole project
* To suppress file-level warnings
In all other cases, you should use the annotations on the methods or classes affected by it. -->
In all other cases, you should use the an§notations on the methods or classes affected by it. -->
im-konge marked this conversation as resolved.
Show resolved Hide resolved
<suppress checks=".*"
files="io[/\\]strimzi[/\\]kafka[/\\]access[/\\]model[/\\].*(Builder|Fluent|FluentImpl)\.java"/>
</suppressions>
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@
<sourcepath>${project.build.sourceDirectory}:${project.build.directory}/generated-sources/annotations</sourcepath>
<show>public</show>
<failOnError>true</failOnError>
<failOnWarnings>true</failOnWarnings>
<failOnWarnings>false</failOnWarnings>
im-konge marked this conversation as resolved.
Show resolved Hide resolved
</configuration>
</execution>
</executions>
Expand Down
13 changes: 10 additions & 3 deletions src/main/java/io/strimzi/kafka/access/model/BindingStatus.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,16 @@
*/
package io.strimzi.kafka.access.model;

import io.strimzi.api.kafka.model.Constants;
import io.sundr.builder.annotations.Buildable;

/**
* The status class for keeping the state of service binding status
*/
@Buildable(
editableEnabled = false,
builderPackage = Constants.FABRIC8_KUBERNETES_API
)
public class BindingStatus {

private String name;
Expand All @@ -20,10 +27,10 @@ public BindingStatus() {
/**
* Constructor
*
* @param secretName The Kubernetes secret name
* @param name The Kubernetes secret name
*/
public BindingStatus(final String secretName) {
this.setName(secretName);
public BindingStatus(final String name) {
this.setName(name);
}

/**
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/io/strimzi/kafka/access/model/KafkaAccess.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
import io.fabric8.kubernetes.model.annotation.Group;
import io.fabric8.kubernetes.model.annotation.ShortNames;
import io.fabric8.kubernetes.model.annotation.Version;
import io.strimzi.api.kafka.model.Constants;
import io.sundr.builder.annotations.Buildable;
import io.sundr.builder.annotations.BuildableReference;

import java.io.Serial;

Expand All @@ -18,6 +21,11 @@
@Group("access.strimzi.io")
@Version("v1alpha1")
@ShortNames("ka")
@Buildable(
editableEnabled = false,
builderPackage = Constants.FABRIC8_KUBERNETES_API,
refs = {@BuildableReference(CustomResource.class)}
)
public class KafkaAccess extends CustomResource<KafkaAccessSpec, KafkaAccessStatus> implements Namespaced {
@Serial
private static final long serialVersionUID = 1L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,16 @@
package io.strimzi.kafka.access.model;

import io.fabric8.generator.annotation.Required;
import io.strimzi.api.kafka.model.Constants;
import io.sundr.builder.annotations.Buildable;

/**
* The spec model of the KafkaAccess resource
*/
@Buildable(
editableEnabled = false,
builderPackage = Constants.FABRIC8_KUBERNETES_API
)
public class KafkaAccessSpec {

@Required
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,21 @@
package io.strimzi.kafka.access.model;

import io.javaoperatorsdk.operator.api.ObservedGenerationAwareStatus;
import io.strimzi.api.kafka.model.Constants;
import io.strimzi.api.kafka.model.status.Condition;
import io.strimzi.kafka.access.internal.StatusUtils;
import io.sundr.builder.annotations.Buildable;

import java.util.ArrayList;
import java.util.List;

/**
* The status model of the KafkaAccess resource
*/
@Buildable(
editableEnabled = false,
builderPackage = Constants.FABRIC8_KUBERNETES_API
)
public class KafkaAccessStatus extends ObservedGenerationAwareStatus {

private BindingStatus binding;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,16 @@
package io.strimzi.kafka.access.model;

import io.fabric8.generator.annotation.Required;
import io.strimzi.api.kafka.model.Constants;
import io.sundr.builder.annotations.Buildable;

/**
* The Kafka reference. Keeps state for a Kafka resource of Strimzi Kafka Operator
*/
@Buildable(
editableEnabled = false,
builderPackage = Constants.FABRIC8_KUBERNETES_API
)
public class KafkaReference {

@Required
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,16 @@
package io.strimzi.kafka.access.model;

import io.fabric8.generator.annotation.Required;
import io.strimzi.api.kafka.model.Constants;
import io.sundr.builder.annotations.Buildable;

/**
* The Kafka user reference, which keeps state for a KafkaUser resource of Strimzi Kafka Operator
*/
@Buildable(
editableEnabled = false,
builderPackage = Constants.FABRIC8_KUBERNETES_API
)
public class KafkaUserReference {

@Required
Expand Down
Loading