Skip to content
Open
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
38 changes: 30 additions & 8 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,6 @@
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk18on</artifactId>
</dependency>
<dependency>
<groupId>dev.streamx</groupId>
<artifactId>streamx-runner</artifactId>
</dependency>
<dependency>
<groupId>dev.streamx</groupId>
<artifactId>streamx-operator-mesh-api</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jdk8</artifactId>
Expand All @@ -67,6 +59,11 @@
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>26.0.2-1</version>
</dependency>
<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
Expand Down Expand Up @@ -119,6 +116,31 @@
<artifactId>kubernetes-httpclient-okhttp</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers-bom</artifactId>
<version>2.0.2</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.20.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>33.5.0-jre</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk18on</artifactId>
<version>1.83</version>
<scope>compile</scope>
</dependency>
</dependencies>

<build>
Expand Down
4 changes: 1 addition & 3 deletions core/src/main/java/dev/streamx/cli/BannerPrinter.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import static dev.streamx.cli.util.Output.print;

import dev.streamx.cli.command.dev.DevCommand;
import dev.streamx.cli.command.run.RunCommand;
import jakarta.enterprise.context.ApplicationScoped;
import java.util.Set;
import picocli.CommandLine;
Expand All @@ -13,7 +11,7 @@
public class BannerPrinter {

private static final Set<String> COMMANDS_REQUIRING_PRINTING_BANNER =
Set.of(DevCommand.COMMAND_NAME, RunCommand.COMMAND_NAME);
Set.of();

private static final String BANNER = """
____ _ __ __
Expand Down
6 changes: 0 additions & 6 deletions core/src/main/java/dev/streamx/cli/StreamxCommand.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
package dev.streamx.cli;

import dev.streamx.cli.command.cloud.deploy.DeployCommand;
import dev.streamx.cli.command.cloud.undeploy.UndeployCommand;
import dev.streamx.cli.command.dev.DevCommand;
import dev.streamx.cli.command.ingestion.batch.BatchCommand;
import dev.streamx.cli.command.ingestion.publish.PublishCommand;
import dev.streamx.cli.command.ingestion.stream.StreamCommand;
import dev.streamx.cli.command.ingestion.unpublish.UnpublishCommand;
import dev.streamx.cli.command.init.InitCommand;
import dev.streamx.cli.command.run.RunCommand;
import dev.streamx.cli.config.ArgumentConfigSource;
import dev.streamx.cli.config.validation.ConfigSourcesValidator;
import dev.streamx.cli.license.LicenseArguments;
Expand All @@ -31,10 +27,8 @@
name = "streamx",
subcommands = {
InitCommand.class,
RunCommand.class, DevCommand.class,
PublishCommand.class, UnpublishCommand.class,
BatchCommand.class, StreamCommand.class,
DeployCommand.class, UndeployCommand.class,
HelpCommand.class
},
versionProvider = VersionProvider.class)
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
package dev.streamx.cli.command.cloud;

import dev.streamx.operator.Component;
import io.fabric8.kubernetes.api.model.HasMetadata;
import io.fabric8.kubernetes.client.utils.KubernetesResourceUtil;
import java.util.HashMap;
import java.util.Map;

public class MetadataUtils {

public static final String NAME_LABEL = "app.kubernetes.io/name";
public static final String INSTANCE_LABEL = "app.kubernetes.io/instance";
public static final String COMPONENT_LABEL = "app.kubernetes.io/component";
public static final String MANAGED_BY_LABEL = "app.kubernetes.io/managed-by";
public static final String MANAGED_BY_LABEL_VALUE = "streamx-cli";
public static final String CONFIG_TYPE_LABEL = "mesh.streamx.dev/config-type";
public static final String PART_OF_LABEL = "app.kubernetes.io/part-of";
public static final String SERVICEMESH_CRD_NAME = "servicemeshes.streamx.dev";
public static final String DEFAULT_K8S_NAMESPACE = "default";

private MetadataUtils() {
// No instances
Expand All @@ -29,25 +21,11 @@ public static Map<String, String> createPartOfAndManagedByLabels(String meshName
);
}

public static void setMetadata(String meshName, Component component, String name,
HasMetadata resource) {
String instanceName = getResourceName(meshName, component.getShortName(), name);
resource.getMetadata().setName(instanceName);
setLabel(resource, INSTANCE_LABEL, instanceName);
setLabel(resource, COMPONENT_LABEL, component.getName());
setLabel(resource, NAME_LABEL, name);
setManagedByAndPartOfLabels(resource, meshName);
}

public static void setManagedByAndPartOfLabels(HasMetadata resource, String meshName) {
setLabel(resource, PART_OF_LABEL, meshName);
setLabel(resource, MANAGED_BY_LABEL, MANAGED_BY_LABEL_VALUE);
}

public static String getResourceName(String meshName, String componentName, String name) {
return KubernetesResourceUtil.sanitizeName(meshName + "-" + componentName + "-" + name);
}

public static void setLabel(HasMetadata resource, String key, String value) {
if (resource.getMetadata().getLabels() == null) {
resource.getMetadata().setLabels(new HashMap<>());
Expand Down

This file was deleted.

Loading
Loading