Skip to content

Commit 143926d

Browse files
authored
Merge pull request #4 from podmortem/patternlibrary
Add the Podmortem and PatternLibrary custom resources
2 parents c441202 + a387fdd commit 143926d

30 files changed

+278
-31
lines changed

.github/workflows/maven-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ jobs:
3333
- name: Build and Publish Package
3434
run: mvn -B --no-transfer-progress deploy
3535
env:
36-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.mvn/extensions.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
<artifactId>jgitver-maven-plugin</artifactId>
66
<version>1.9.0</version>
77
</extension>
8-
</extensions>
8+
</extensions>

.pre-commit-config.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ repos:
1212
hooks:
1313
- id: spotless
1414
name: spotless
15-
entry: mvn spotless:apply
15+
entry: bash -c 'mvn spotless:apply'
1616
language: system
17-
files: \.java$
18-
stages: [pre-commit]
17+
files: \.(java|xml|json|md)$

pom.xml

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@
2828
<type>pom</type>
2929
<scope>import</scope>
3030
</dependency>
31+
<dependency>
32+
<groupId>${quarkus.platform.group-id}</groupId>
33+
<artifactId>quarkus-operator-sdk-bom</artifactId>
34+
<version>${quarkus.platform.version}</version>
35+
<type>pom</type>
36+
<scope>import</scope>
37+
</dependency>
3138
</dependencies>
3239
</dependencyManagement>
3340

@@ -36,10 +43,16 @@
3643
<groupId>io.quarkus</groupId>
3744
<artifactId>quarkus-arc</artifactId>
3845
</dependency>
46+
3947
<dependency>
4048
<groupId>io.quarkus</groupId>
41-
<artifactId>quarkus-rest</artifactId>
49+
<artifactId>quarkus-kubernetes-client</artifactId>
50+
</dependency>
51+
<dependency>
52+
<groupId>io.quarkiverse.operatorsdk</groupId>
53+
<artifactId>quarkus-operator-sdk</artifactId>
4254
</dependency>
55+
4356
<dependency>
4457
<groupId>io.quarkus</groupId>
4558
<artifactId>quarkus-junit5</artifactId>
@@ -64,10 +77,19 @@
6477
<version>1.17.0</version>
6578
<style>AOSP</style>
6679
</googleJavaFormat>
67-
<removeUnusedImports/>
68-
<trimTrailingWhitespace/>
80+
<removeUnusedImports />
81+
<trimTrailingWhitespace />
6982
</java>
7083
</configuration>
84+
<executions>
85+
<execution>
86+
<id>spotless-check</id>
87+
<phase>verify</phase>
88+
<goals>
89+
<goal>check</goal>
90+
</goals>
91+
</execution>
92+
</executions>
7193
</plugin>
7294
<plugin>
7395
<groupId>${quarkus.platform.group-id}</groupId>
@@ -145,4 +167,4 @@
145167
<url>https://maven.pkg.github.com/podmortem/common-lib</url>
146168
</repository>
147169
</distributionManagement>
148-
</project>
170+
</project>

src/main/java/com/redhat/podmortem/common/model/analysis/PodAnalysisRequest.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
11
package com.redhat.podmortem.common.model.analysis;
22

3-
import com.redhat.podmortem.common.model.event.Event;
4-
import com.redhat.podmortem.common.model.pod.Pod;
3+
import com.redhat.podmortem.common.model.kube.event.Event;
4+
import com.redhat.podmortem.common.model.kube.pod.Pod;
5+
import io.quarkus.runtime.annotations.RegisterForReflection;
56
import java.util.List;
67

8+
@RegisterForReflection
79
public class PodAnalysisRequest {
810

911
private Pod pod;
1012
private String logs;
1113
private List<Event> events;
1214

15+
public PodAnalysisRequest(Pod pod, String logs, List<Event> events) {
16+
this.pod = pod;
17+
this.logs = logs;
18+
this.events = events;
19+
}
20+
1321
public Pod getPod() {
1422
return pod;
1523
}

src/main/java/com/redhat/podmortem/common/model/event/Event.java renamed to src/main/java/com/redhat/podmortem/common/model/kube/event/Event.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
package com.redhat.podmortem.common.model.event;
1+
package com.redhat.podmortem.common.model.kube.event;
22

3+
import io.quarkus.runtime.annotations.RegisterForReflection;
4+
5+
@RegisterForReflection
36
public class Event {
47

58
private String kind;

src/main/java/com/redhat/podmortem/common/model/event/EventMetadata.java renamed to src/main/java/com/redhat/podmortem/common/model/kube/event/EventMetadata.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
package com.redhat.podmortem.common.model.event;
1+
package com.redhat.podmortem.common.model.kube.event;
22

3-
import com.redhat.podmortem.common.model.pod.ManagedField;
3+
import com.redhat.podmortem.common.model.kube.pod.ManagedField;
4+
import io.quarkus.runtime.annotations.RegisterForReflection;
45
import java.util.List;
56

7+
@RegisterForReflection
68
public class EventMetadata {
79
private String name;
810
private String namespace;

src/main/java/com/redhat/podmortem/common/model/event/EventSource.java renamed to src/main/java/com/redhat/podmortem/common/model/kube/event/EventSource.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
package com.redhat.podmortem.common.model.event;
1+
package com.redhat.podmortem.common.model.kube.event;
22

3+
import io.quarkus.runtime.annotations.RegisterForReflection;
4+
5+
@RegisterForReflection
36
public class EventSource {
47
private String component;
58
private String host;

src/main/java/com/redhat/podmortem/common/model/event/InvolvedObject.java renamed to src/main/java/com/redhat/podmortem/common/model/kube/event/InvolvedObject.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
package com.redhat.podmortem.common.model.event;
1+
package com.redhat.podmortem.common.model.kube.event;
22

3+
import io.quarkus.runtime.annotations.RegisterForReflection;
4+
5+
@RegisterForReflection
36
public class InvolvedObject {
47
private String kind;
58
private String namespace;
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package com.redhat.podmortem.common.model.kube.patternlibrary;
2+
3+
import com.fasterxml.jackson.annotation.JsonInclude;
4+
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
5+
import io.quarkus.runtime.annotations.RegisterForReflection;
6+
7+
@JsonDeserialize
8+
@RegisterForReflection
9+
@JsonInclude(JsonInclude.Include.NON_NULL)
10+
public class Credentials {
11+
12+
private String secretRef;
13+
14+
public String getSecretRef() {
15+
return secretRef;
16+
}
17+
18+
public void setSecretRef(String secretRef) {
19+
this.secretRef = secretRef;
20+
}
21+
}

0 commit comments

Comments
 (0)