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

chore(operator): Try removing redundant label matching from k8s dependent annotations #5918

Merged
merged 1 commit into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,13 @@

import static io.apicurio.registry.operator.api.v1.ContainerNames.REGISTRY_APP_CONTAINER_NAME;
import static io.apicurio.registry.operator.resource.LabelDiscriminators.AppDeploymentDiscriminator;
import static io.apicurio.registry.operator.resource.ResourceFactory.COMPONENT_APP;
import static io.apicurio.registry.operator.resource.ResourceKey.APP_DEPLOYMENT_KEY;
import static io.apicurio.registry.operator.resource.ResourceKey.STUDIO_UI_SERVICE_KEY;
import static io.apicurio.registry.operator.utils.Mapper.toYAML;
import static java.util.Objects.requireNonNull;
import static java.util.Optional.ofNullable;

@KubernetesDependent(
labelSelector = "app.kubernetes.io/name=apicurio-registry,app.kubernetes.io/component=" + COMPONENT_APP,
resourceDiscriminator = AppDeploymentDiscriminator.class
)
@KubernetesDependent(resourceDiscriminator = AppDeploymentDiscriminator.class)
public class AppDeploymentResource extends CRUDKubernetesDependentResource<Deployment, ApicurioRegistry3> {

private static final Logger log = LoggerFactory.getLogger(AppDeploymentResource.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@
import static io.apicurio.registry.operator.utils.IngressUtils.withIngressRule;
import static io.apicurio.registry.operator.utils.Mapper.toYAML;

@KubernetesDependent(
labelSelector = "app.kubernetes.io/name=apicurio-registry,app.kubernetes.io/component=" + COMPONENT_APP,
resourceDiscriminator = AppIngressDiscriminator.class
)
@KubernetesDependent(resourceDiscriminator = AppIngressDiscriminator.class)
public class AppIngressResource extends CRUDKubernetesDependentResource<Ingress, ApicurioRegistry3> {

private static final Logger log = LoggerFactory.getLogger(AppIngressResource.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,11 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import static io.apicurio.registry.operator.resource.LabelDiscriminators.*;
import static io.apicurio.registry.operator.resource.ResourceFactory.COMPONENT_APP;
import static io.apicurio.registry.operator.resource.LabelDiscriminators.AppServiceDiscriminator;
import static io.apicurio.registry.operator.resource.ResourceKey.APP_SERVICE_KEY;
import static io.apicurio.registry.operator.utils.Mapper.toYAML;

@KubernetesDependent(
labelSelector = "app.kubernetes.io/name=apicurio-registry,app.kubernetes.io/component=" + COMPONENT_APP,
resourceDiscriminator = AppServiceDiscriminator.class
)
@KubernetesDependent(resourceDiscriminator = AppServiceDiscriminator.class)
public class AppServiceResource extends CRUDKubernetesDependentResource<Service, ApicurioRegistry3> {

private static final Logger log = LoggerFactory.getLogger(AppServiceResource.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,14 @@
import java.util.LinkedHashMap;

import static io.apicurio.registry.operator.api.v1.ContainerNames.STUDIO_UI_CONTAINER_NAME;
import static io.apicurio.registry.operator.resource.ResourceFactory.COMPONENT_STUDIO_UI;
import static io.apicurio.registry.operator.resource.ResourceKey.*;
import static io.apicurio.registry.operator.resource.app.AppDeploymentResource.addEnvVar;
import static io.apicurio.registry.operator.resource.app.AppDeploymentResource.getContainerFromDeployment;
import static io.apicurio.registry.operator.utils.IngressUtils.withIngressRule;
import static io.apicurio.registry.operator.utils.Mapper.toYAML;
import static java.util.Optional.ofNullable;

@KubernetesDependent(
labelSelector = "app.kubernetes.io/name=apicurio-registry,app.kubernetes.io/component=" + COMPONENT_STUDIO_UI,
resourceDiscriminator = StudioUIDeploymentDiscriminator.class
)
@KubernetesDependent(resourceDiscriminator = StudioUIDeploymentDiscriminator.class)
public class StudioUIDeploymentResource
extends CRUDKubernetesDependentResource<Deployment, ApicurioRegistry3> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,13 @@
import org.slf4j.LoggerFactory;

import static io.apicurio.registry.operator.resource.ResourceFactory.COMPONENT_STUDIO_UI;
import static io.apicurio.registry.operator.resource.ResourceKey.*;
import static io.apicurio.registry.operator.resource.ResourceKey.STUDIO_UI_INGRESS_KEY;
import static io.apicurio.registry.operator.resource.ResourceKey.STUDIO_UI_SERVICE_KEY;
import static io.apicurio.registry.operator.utils.IngressUtils.getHost;
import static io.apicurio.registry.operator.utils.IngressUtils.withIngressRule;
import static io.apicurio.registry.operator.utils.Mapper.toYAML;

@KubernetesDependent(
labelSelector = "app.kubernetes.io/name=apicurio-registry,app.kubernetes.io/component=" + COMPONENT_STUDIO_UI,
resourceDiscriminator = StudioUIIngressDiscriminator.class
)
@KubernetesDependent(resourceDiscriminator = StudioUIIngressDiscriminator.class)
public class StudioUIIngressResource extends CRUDKubernetesDependentResource<Ingress, ApicurioRegistry3> {

private static final Logger log = LoggerFactory.getLogger(StudioUIIngressResource.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,10 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import static io.apicurio.registry.operator.resource.ResourceFactory.COMPONENT_STUDIO_UI;
import static io.apicurio.registry.operator.resource.ResourceKey.STUDIO_UI_SERVICE_KEY;
import static io.apicurio.registry.operator.utils.Mapper.toYAML;

@KubernetesDependent(
labelSelector = "app.kubernetes.io/name=apicurio-registry,app.kubernetes.io/component=" + COMPONENT_STUDIO_UI,
resourceDiscriminator = StudioUIServiceDiscriminator.class
)
@KubernetesDependent(resourceDiscriminator = StudioUIServiceDiscriminator.class)
public class StudioUIServiceResource extends CRUDKubernetesDependentResource<Service, ApicurioRegistry3> {

private static final Logger log = LoggerFactory.getLogger(StudioUIServiceResource.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,14 @@

import static io.apicurio.registry.operator.api.v1.ContainerNames.REGISTRY_UI_CONTAINER_NAME;
import static io.apicurio.registry.operator.resource.LabelDiscriminators.UIDeploymentDiscriminator;
import static io.apicurio.registry.operator.resource.ResourceFactory.COMPONENT_UI;
import static io.apicurio.registry.operator.resource.ResourceKey.*;
import static io.apicurio.registry.operator.resource.app.AppDeploymentResource.addEnvVar;
import static io.apicurio.registry.operator.resource.app.AppDeploymentResource.getContainerFromDeployment;
import static io.apicurio.registry.operator.utils.IngressUtils.withIngressRule;
import static io.apicurio.registry.operator.utils.Mapper.toYAML;
import static java.util.Optional.ofNullable;

@KubernetesDependent(
labelSelector = "app.kubernetes.io/name=apicurio-registry,app.kubernetes.io/component=" + COMPONENT_UI,
resourceDiscriminator = UIDeploymentDiscriminator.class
)
@KubernetesDependent(resourceDiscriminator = UIDeploymentDiscriminator.class)
public class UIDeploymentResource extends CRUDKubernetesDependentResource<Deployment, ApicurioRegistry3> {

private static final Logger log = LoggerFactory.getLogger(UIDeploymentResource.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@
import static io.apicurio.registry.operator.utils.IngressUtils.withIngressRule;
import static io.apicurio.registry.operator.utils.Mapper.toYAML;

@KubernetesDependent(
labelSelector = "app.kubernetes.io/name=apicurio-registry,app.kubernetes.io/component=" + COMPONENT_UI,
resourceDiscriminator = UIIngressDiscriminator.class
)
@KubernetesDependent(resourceDiscriminator = UIIngressDiscriminator.class)
public class UIIngressResource extends CRUDKubernetesDependentResource<Ingress, ApicurioRegistry3> {

private static final Logger log = LoggerFactory.getLogger(UIIngressResource.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,11 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import static io.apicurio.registry.operator.resource.LabelDiscriminators.*;
import static io.apicurio.registry.operator.resource.ResourceFactory.COMPONENT_UI;
import static io.apicurio.registry.operator.resource.LabelDiscriminators.UIServiceDiscriminator;
import static io.apicurio.registry.operator.resource.ResourceKey.UI_SERVICE_KEY;
import static io.apicurio.registry.operator.utils.Mapper.toYAML;

@KubernetesDependent(
labelSelector = "app.kubernetes.io/name=apicurio-registry,app.kubernetes.io/component=" + COMPONENT_UI,
resourceDiscriminator = UIServiceDiscriminator.class
)
@KubernetesDependent(resourceDiscriminator = UIServiceDiscriminator.class)
public class UIServiceResource extends CRUDKubernetesDependentResource<Service, ApicurioRegistry3> {

private static final Logger log = LoggerFactory.getLogger(UIServiceResource.class);
Expand Down
Loading