Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
csviri committed Jul 20, 2023
1 parent 8ab0e6a commit fe6fda0
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 55 deletions.
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
package io.quarkiverse.operatorsdk.deployment.helm;

import io.quarkus.kubernetes.spi.GeneratedKubernetesResourceBuildItem;
import java.util.List;

import org.jboss.logging.Logger;

import io.quarkus.deployment.annotations.BuildProducer;
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.pkg.builditem.ArtifactResultBuildItem;

import java.util.List;
import io.quarkus.kubernetes.spi.GeneratedKubernetesResourceBuildItem;

public class HelmChartProcessor {

private static final Logger log = Logger.getLogger(HelmChartProcessor.class);

@BuildStep
public void handleHelmCharts(BuildProducer<ArtifactResultBuildItem> dummy,
List<GeneratedKubernetesResourceBuildItem> generatedResources) {
List<GeneratedKubernetesResourceBuildItem> generatedResources) {

log.infov("Generating helm chart");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package io.quarkiverse.operatorsdk.test;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

import io.quarkiverse.operatorsdk.test.sources.SimpleCR;
import io.quarkiverse.operatorsdk.test.sources.SimpleReconciler;
import io.quarkiverse.operatorsdk.test.sources.SimpleSpec;
import io.quarkiverse.operatorsdk.test.sources.SimpleStatus;
import io.quarkus.test.QuarkusProdModeTest;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

public class HelmChartGeneratorTest {

Expand All @@ -17,7 +18,6 @@ public class HelmChartGeneratorTest {
(jar) -> jar.addClasses(SimpleReconciler.class, SimpleCR.class, SimpleSpec.class, SimpleStatus.class))
.overrideConfigKey("quarkus.operator-sdk.crd.generate", "false");


@Test
void generatesHelmChart() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

import java.io.IOException;
import java.io.InputStream;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.Instant;
import java.util.Date;
import java.util.Properties;

Expand Down Expand Up @@ -68,11 +65,11 @@ public static Version loadFromProperties() {

Date builtTime = new Date();
// todo check how to run this from intellij
// try {
// builtTime = (new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ")).parse(properties.getProperty("git.build.time"));
// } catch (ParseException var4) {
// builtTime = Date.from(Instant.EPOCH);
// }
// try {
// builtTime = (new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ")).parse(properties.getProperty("git.build.time"));
// } catch (ParseException var4) {
// builtTime = Date.from(Instant.EPOCH);
// }

return new Version(sdkVersion.getCommit(), sdkVersion.getBuiltTime(),
properties.getProperty("git.build.version", UNKNOWN),
Expand Down
2 changes: 1 addition & 1 deletion target-helm-chart-joke/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
name: josdk-generic-helm-chart
version: 1.0.10-SNAPSHOT
version: 0.0.1-SNAPSHOT
apiVersion: v2
17 changes: 0 additions & 17 deletions target-helm-chart-joke/README.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ roleRef:
name: josdk-crd-validating-cluster-role
subjects:
- kind: ServiceAccount
name: quarkus-operator-sdk-samples-joke
name: {{ .Chart.Name }}
2 changes: 1 addition & 1 deletion target-helm-chart-joke/templates/cr-role-bindings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ roleRef:
name: jokerequestreconciler-cluster-role
subjects:
- kind: ServiceAccount
name: quarkus-operator-sdk-samples-joke
name: {{ .Chart.Name }}
20 changes: 10 additions & 10 deletions target-helm-chart-joke/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,29 @@ kind: Deployment
metadata:
labels:
app.kubernetes.io/managed-by: quarkus
app.kubernetes.io/name: quarkus-operator-sdk-samples-joke
app.kubernetes.io/version: 6.2.2-SNAPSHOT
name: quarkus-operator-sdk-samples-joke
app.kubernetes.io/name: {{ .Chart.Name }}
app.kubernetes.io/version: {{ .Values.qosdk.version }}
name: {{ .Chart.Name }}
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: quarkus-operator-sdk-samples-joke
app.kubernetes.io/version: 6.2.2-SNAPSHOT
app.kubernetes.io/name: {{ .Chart.Name }}
app.kubernetes.io/version: {{ .Values.qosdk.version }}
template:
metadata:
labels:
app.kubernetes.io/managed-by: quarkus
app.kubernetes.io/name: quarkus-operator-sdk-samples-joke
app.kubernetes.io/version: 6.2.2-SNAPSHOT
app.kubernetes.io/name: {{ .Chart.Name }}
app.kubernetes.io/version: {{ .Values.qosdk.version }}
spec:
containers:
- env:
- name: KUBERNETES_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
image: csviri/quarkus-operator-sdk-samples-joke:6.2.2-SNAPSHOT
image: {{ .Values.image }}
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
Expand All @@ -37,7 +37,7 @@ spec:
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 10
name: quarkus-operator-sdk-samples-joke
name: {{ .Chart.Name }}
ports:
- containerPort: 8080
name: http
Expand All @@ -62,4 +62,4 @@ spec:
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 10
serviceAccountName: quarkus-operator-sdk-samples-joke
serviceAccountName: {{ .Chart.Name }}
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ roleRef:
name: josdk-crd-validating-cluster-role
subjects:
- kind: ServiceAccount
name: quarkus-operator-sdk-samples-joke
name: {{ .Chart.Name }}
10 changes: 5 additions & 5 deletions target-helm-chart-joke/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ metadata:
app.quarkus.io/commit-id: 77d1e2545ac9dd0e6599bffdec4f892cd148984b
app.quarkus.io/build-timestamp: 2023-07-20 - 11:57:20 +0000
labels:
app.kubernetes.io/name: quarkus-operator-sdk-samples-joke
app.kubernetes.io/version: 6.2.2-SNAPSHOT
app.kubernetes.io/name: {{ .Chart.Name }}
app.kubernetes.io/version: {{ .Values.qosdk.version }}
app.kubernetes.io/managed-by: quarkus
name: quarkus-operator-sdk-samples-joke
name: {{ .Chart.Name }}
spec:
ports:
- name: http
port: 80
protocol: TCP
targetPort: 8080
selector:
app.kubernetes.io/name: quarkus-operator-sdk-samples-joke
app.kubernetes.io/version: 6.2.2-SNAPSHOT
app.kubernetes.io/name: {{ .Chart.Name }}
app.kubernetes.io/version: {{ .Values.qosdk.version }}
type: ClusterIP
6 changes: 3 additions & 3 deletions target-helm-chart-joke/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ kind: ServiceAccount
metadata:
labels:
app.kubernetes.io/managed-by: quarkus
app.kubernetes.io/name: quarkus-operator-sdk-samples-joke
app.kubernetes.io/version: 6.2.2-SNAPSHOT
name: quarkus-operator-sdk-samples-joke
app.kubernetes.io/name: {{ .Chart.Name }}
app.kubernetes.io/version: {{ .Values.qosdk.version }}
name: {{ .Chart.Name }}
3 changes: 2 additions & 1 deletion target-helm-chart-joke/values.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

qosdk:
version: 6.2.2-SNAPSHOT

image: csviri/quarkus-operator-sdk-samples-joke:6.2.2-SNAPSHOT

0 comments on commit fe6fda0

Please sign in to comment.