Skip to content

Commit

Permalink
feat: migration org.tkit
Browse files Browse the repository at this point in the history
  • Loading branch information
andrejpetras committed Feb 1, 2024
1 parent cc71b2b commit 0f2100c
Show file tree
Hide file tree
Showing 15 changed files with 54 additions and 39 deletions.
12 changes: 10 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>io.github.onecx</groupId>
<groupId>org.tkit.onecx</groupId>
<artifactId>onecx-quarkus3-parent</artifactId>
<version>0.25.0</version>
<version>0.31.0</version>
</parent>

<artifactId>onecx-product-store-operator</artifactId>
Expand Down Expand Up @@ -62,6 +62,14 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-rest-client-reactive-jackson</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-oidc-client</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-oidc-client-reactive-filter</artifactId>
</dependency>

<!-- OTHER -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: products.onecx.github.io
name: products.onecx.tkit.org
spec:
group: onecx.github.io
group: onecx.tkit.org
names:
kind: Product
plural: products
Expand Down
2 changes: 1 addition & 1 deletion src/main/helm/templates/product-cluster-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: {{ .Release.Name }}-{{ .Values.app.name }}-cluster-role
rules:
- apiGroups:
- onecx.github.io
- onecx.tkit.org
resources:
- products
- products/status
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package io.github.onecx.product.store.operator;
package org.tkit.onecx.product.store.operator;

import io.fabric8.kubernetes.api.model.Namespaced;
import io.fabric8.kubernetes.client.CustomResource;
import io.fabric8.kubernetes.model.annotation.Group;
import io.fabric8.kubernetes.model.annotation.Version;

@Version("v1")
@Group("onecx.github.io")
@Group("onecx.tkit.org")
public class Product extends CustomResource<ProductSpec, ProductStatus> implements Namespaced {

}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package io.github.onecx.product.store.operator;
package org.tkit.onecx.product.store.operator;

import jakarta.inject.Inject;
import jakarta.ws.rs.WebApplicationException;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.tkit.onecx.product.store.operator.client.ProductStoreService;

import io.github.onecx.product.store.operator.client.ProductStoreService;
import io.javaoperatorsdk.operator.api.reconciler.*;
import io.javaoperatorsdk.operator.processing.event.source.filter.OnAddFilter;
import io.javaoperatorsdk.operator.processing.event.source.filter.OnUpdateFilter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.onecx.product.store.operator;
package org.tkit.onecx.product.store.operator;

import java.util.Set;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.onecx.product.store.operator;
package org.tkit.onecx.product.store.operator;

import com.fasterxml.jackson.annotation.JsonProperty;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package io.github.onecx.product.store.operator.client;
package org.tkit.onecx.product.store.operator.client;

import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;

import org.eclipse.microprofile.rest.client.inject.RestClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.tkit.onecx.product.store.operator.Product;
import org.tkit.onecx.product.store.operator.ProductSpec;
import org.tkit.onecx.product.store.operator.client.mappers.ProductStoreMapper;

import gen.io.github.onecx.product.store.product.v1.api.OperatorProductApi;
import gen.io.github.onecx.product.store.product.v1.model.UpdateProductRequest;
import io.github.onecx.product.store.operator.Product;
import io.github.onecx.product.store.operator.ProductSpec;
import io.github.onecx.product.store.operator.client.mappers.ProductStoreMapper;
import gen.org.tkit.onecx.product.store.product.v1.api.OperatorProductApi;
import gen.org.tkit.onecx.product.store.product.v1.model.UpdateProductRequest;

@ApplicationScoped
public class ProductStoreService {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package org.tkit.onecx.product.store.operator.client.mappers;

import org.mapstruct.Mapper;
import org.tkit.onecx.product.store.operator.ProductSpec;

import gen.org.tkit.onecx.product.store.product.v1.model.UpdateProductRequest;

@Mapper
public interface ProductStoreMapper {

UpdateProductRequest map(ProductSpec spec);
}
9 changes: 8 additions & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,17 @@ quarkus.kubernetes-client.devservices.override-kubeconfig=true
# PROD
%prod.quarkus.rest-client.product_store_client.url=http://onecx-product-store-svc:8080

# OIDC
#quarkus.rest-client.product_store_client.providers=io.quarkus.oidc.client.reactive.filter.OidcClientRequestReactiveFilter
#quarkus.oidc-client.client-id=${quarkus.application.name}
#quarkus.oidc-client.credentials.secret=
#quarkus.oidc-client.auth-server-url=

# BUILD
quarkus.operator-sdk.helm.enabled=true
quarkus.openapi-generator.codegen.input-base-dir=target/tmp/openapi
quarkus.openapi-generator.codegen.spec.onecx_product_store_operator_product_v1_yaml.config-key=product_store_client
quarkus.openapi-generator.codegen.spec.onecx_product_store_operator_product_v1_yaml.base-package=gen.io.github.onecx.product.store.product.v1
quarkus.openapi-generator.codegen.spec.onecx_product_store_operator_product_v1_yaml.base-package=gen.org.tkit.onecx.product.store.product.v1
quarkus.openapi-generator.codegen.spec.onecx_product_store_operator_product_v1_yaml.return-response=true


Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.onecx.product.store.operator;
package org.tkit.onecx.product.store.operator;

import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.ArgumentMatchers.any;
Expand All @@ -8,9 +8,9 @@
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
import org.tkit.onecx.product.store.operator.client.ProductStoreService;
import org.tkit.onecx.product.store.test.AbstractTest;

import io.github.onecx.product.store.operator.client.ProductStoreService;
import io.github.onecx.product.store.test.AbstractTest;
import io.javaoperatorsdk.operator.api.reconciler.UpdateControl;
import io.quarkus.test.InjectMock;
import io.quarkus.test.junit.QuarkusTest;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.onecx.product.store.operator;
package org.tkit.onecx.product.store.operator;

import static java.util.concurrent.TimeUnit.SECONDS;
import static org.assertj.core.api.Assertions.assertThat;
Expand All @@ -17,10 +17,10 @@
import org.junit.jupiter.params.provider.MethodSource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.tkit.onecx.product.store.test.AbstractTest;

import io.fabric8.kubernetes.api.model.ObjectMetaBuilder;
import io.fabric8.kubernetes.client.KubernetesClient;
import io.github.onecx.product.store.test.AbstractTest;
import io.javaoperatorsdk.operator.Operator;
import io.quarkus.test.junit.QuarkusTest;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package org.tkit.onecx.product.store.test;

public abstract class AbstractTest {
}

0 comments on commit 0f2100c

Please sign in to comment.