Skip to content

Commit

Permalink
refactor: use bundleName instead of deprecated name
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Laprun <claprun@redhat.com>
  • Loading branch information
metacosm committed Mar 21, 2024
1 parent 341f162 commit f002555
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

/**
* A marker interface used to identify classes bearing {@link CSVMetadata} that needs to be shared across reconcilers using the
* same {@link CSVMetadata#name()} attribute. Note that sharing metadata without using {@link SharedCSVMetadata} is not allowed.
* same {@link CSVMetadata#bundleName()} attribute. Note that sharing metadata without using {@link SharedCSVMetadata} is not
* allowed.
*/
public interface SharedCSVMetadata {
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import io.quarkiverse.operatorsdk.annotations.CSVMetadata;
import io.quarkiverse.operatorsdk.annotations.SharedCSVMetadata;

@CSVMetadata(name = AReconciler.SHARED, version = AReconciler.SHARED_VERSION)
@CSVMetadata(bundleName = AReconciler.SHARED, version = AReconciler.SHARED_VERSION)
public class AReconciler implements Reconciler<ConfigMap>, SharedCSVMetadata {

public static final String SHARED_VERSION = "0.0.1";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import io.javaoperatorsdk.operator.api.reconciler.UpdateControl;
import io.quarkiverse.operatorsdk.annotations.CSVMetadata;

@CSVMetadata(name = AReconciler.SHARED, version = "0.0.2")
@CSVMetadata(bundleName = AReconciler.SHARED, version = "0.0.2")
public class BReconciler implements Reconciler<Service> {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
import io.javaoperatorsdk.operator.api.reconciler.UpdateControl;
import io.quarkiverse.operatorsdk.annotations.CSVMetadata;

@CSVMetadata(name = "illegal")
@CSVMetadata(bundleName = "illegal")
public class DuplicatedBundleNameWithoutSharedCSVMetadata1 implements Reconciler<Role> {

@Override
public UpdateControl<Role> reconcile(Role role, Context<Role> context) throws Exception {
public UpdateControl<Role> reconcile(Role role, Context<Role> context) {
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
import io.javaoperatorsdk.operator.api.reconciler.UpdateControl;
import io.quarkiverse.operatorsdk.annotations.CSVMetadata;

@CSVMetadata(name = "illegal")
@CSVMetadata(bundleName = "illegal")
public class DuplicatedBundleNameWithoutSharedCSVMetadata2 implements Reconciler<RoleBinding> {

@Override
public UpdateControl<RoleBinding> reconcile(RoleBinding roleBinding, Context<RoleBinding> context)
throws Exception {
public UpdateControl<RoleBinding> reconcile(RoleBinding roleBinding, Context<RoleBinding> context) {
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import io.javaoperatorsdk.operator.api.reconciler.UpdateControl;
import io.quarkiverse.operatorsdk.annotations.CSVMetadata;

@CSVMetadata(name = "first-operator", version = FirstReconciler.VERSION)
@CSVMetadata(bundleName = "first-operator", version = FirstReconciler.VERSION)
public class FirstReconciler implements Reconciler<First> {

public static final String VERSION = "first-version";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import io.quarkiverse.operatorsdk.annotations.CSVMetadata;
import io.quarkiverse.operatorsdk.annotations.RBACRule;

@CSVMetadata(name = "second-operator")
@CSVMetadata(bundleName = "second-operator")
@RBACRule(apiGroups = SecondReconciler.RBAC_RULE_GROUP, resources = SecondReconciler.RBAC_RULE_RES, verbs = SecondReconciler.RBAC_RULE_VERBS)
@ControllerConfiguration(namespaces = "foo")
public class SecondReconciler implements Reconciler<Second> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import io.quarkiverse.operatorsdk.annotations.CSVMetadata.Annotations.Annotation;
import io.quarkiverse.operatorsdk.annotations.CSVMetadata.RequiredCRD;

@CSVMetadata(name = "third-operator", requiredCRDs = @RequiredCRD(kind = SecondExternal.KIND, name = "externalagains."
@CSVMetadata(bundleName = "third-operator", requiredCRDs = @RequiredCRD(kind = SecondExternal.KIND, name = "externalagains."
+ SecondExternal.GROUP, version = SecondExternal.VERSION), replaces = "1.0.0", annotations = @Annotations(skipRange = ">=1.0.0 <1.0.3", capabilities = "Test", others = @Annotation(name = "foo", value = "bar")))
@ControllerConfiguration(name = ThirdReconciler.NAME, dependents = {
@Dependent(type = ExternalDependentResource.class),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import io.quarkiverse.operatorsdk.annotations.CSVMetadata;
import io.quarkiverse.operatorsdk.annotations.SharedCSVMetadata;

@CSVMetadata(name = "pingpong-operator")
@CSVMetadata(bundleName = "pingpong-operator")
@SuppressWarnings("unused")
public class PingPongOperatorCSVMetadata implements SharedCSVMetadata {
}

0 comments on commit f002555

Please sign in to comment.