Skip to content

apply naming convention for the Fabric8IstioIT #1487

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

Merged
merged 8 commits into from
Oct 25, 2023
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 @@ -14,7 +14,7 @@
* limitations under the License.
*/

package org.springframework.cloud.kubernetes.fabric8.istio;
package org.springframework.cloud.kubernetes.fabric8.client.istio;

import io.fabric8.istio.client.DefaultIstioClient;
import io.fabric8.istio.client.IstioClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package org.springframework.cloud.kubernetes.fabric8.istio;
package org.springframework.cloud.kubernetes.fabric8.client.istio;

import java.util.Arrays;

Expand All @@ -25,7 +25,7 @@
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cloud.kubernetes.fabric8.istio.utils.MeshUtils;
import org.springframework.cloud.kubernetes.fabric8.client.istio.utils.MeshUtils;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.ConfigurableEnvironment;
Expand Down Expand Up @@ -69,7 +69,7 @@ public void detectIstio() {
}

void addIstioProfile(ConfigurableEnvironment environment) {
if (this.utils.isIstioEnabled()) {
if (utils.isIstioEnabled()) {
if (hasIstioProfile(environment)) {
if (LOG.isDebugEnabled()) {
LOG.debug("'istio' already in list of active profiles");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package org.springframework.cloud.kubernetes.fabric8.istio;
package org.springframework.cloud.kubernetes.fabric8.client.istio;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
* limitations under the License.
*/

package org.springframework.cloud.kubernetes.fabric8.istio.utils;
package org.springframework.cloud.kubernetes.fabric8.client.istio.utils;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.cloud.kubernetes.fabric8.istio.IstioClientProperties;
import org.springframework.cloud.kubernetes.fabric8.client.istio.IstioClientProperties;
import org.springframework.http.ResponseEntity;
import org.springframework.web.client.RestTemplate;

Expand All @@ -35,7 +35,7 @@ public class MeshUtils {

private final IstioClientProperties istioClientProperties;

private RestTemplate restTemplate = new RestTemplateBuilder().build();
private final RestTemplate restTemplate = new RestTemplateBuilder().build();

public MeshUtils(IstioClientProperties istioClientProperties) {
this.istioClientProperties = istioClientProperties;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
org.springframework.cloud.bootstrap.BootstrapConfiguration=\
org.springframework.cloud.kubernetes.fabric8.istio.IstioBootstrapConfiguration
org.springframework.cloud.kubernetes.fabric8.client.istio.IstioBootstrapConfiguration
Original file line number Diff line number Diff line change
@@ -1 +1 @@
org.springframework.cloud.kubernetes.fabric8.istio.IstioAutoConfiguration
org.springframework.cloud.kubernetes.fabric8.client.istio.IstioAutoConfiguration
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package org.springframework.cloud.kubernetes.fabric8.istio;
package org.springframework.cloud.kubernetes.fabric8.client.istio;

import org.springframework.boot.autoconfigure.SpringBootApplication;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package org.springframework.cloud.kubernetes.fabric8.istio;
package org.springframework.cloud.kubernetes.fabric8.client.istio;

import io.fabric8.istio.client.IstioClient;
import org.junit.jupiter.api.Test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package org.springframework.cloud.kubernetes.fabric8.istio;
package org.springframework.cloud.kubernetes.fabric8.client.istio;

import io.fabric8.istio.client.IstioClient;
import org.junit.jupiter.api.Test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package org.springframework.cloud.kubernetes.fabric8.istio;
package org.springframework.cloud.kubernetes.fabric8.client.istio;

import io.fabric8.istio.client.IstioClient;
import org.junit.jupiter.api.Test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package org.springframework.cloud.kubernetes.fabric8.istio;
package org.springframework.cloud.kubernetes.fabric8.client.istio;

import io.fabric8.istio.client.IstioClient;
import org.junit.jupiter.api.Test;
Expand Down
5 changes: 3 additions & 2 deletions spring-cloud-kubernetes-integration-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,16 @@
<module>spring-cloud-kubernetes-fabric8-client-reload</module>
<module>spring-cloud-kubernetes-k8s-client-reload</module>

<!-- at the moment there is no k8s native client support for istio -->
<module>spring-cloud-kubernetes-fabric8-client-istio</module>

<!-- discovery using discovery server -->
<!-- since discovery controller is based on k8s-client, we do not have a fabric8 module -->
<module>spring-cloud-kubernetes-k8s-client-discovery-server</module>

<!-- configuration watcher is based on k8s-client, there's no fabric8 counterpart -->
<module>spring-cloud-kubernetes-k8s-client-configuration-watcher</module>

<module>spring-cloud-kubernetes-fabric8-istio-it</module>

<module>spring-cloud-kubernetes-client-loadbalancer-it</module>
<module>spring-cloud-kubernetes-client-configmap-event-reload-multiple-apps</module>
<module>spring-cloud-kubernetes-client-secrets-event-reload-multiple-apps</module>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>spring-cloud-kubernetes-fabric8-istio-it</artifactId>
<artifactId>spring-cloud-kubernetes-fabric8-client-istio</artifactId>

<dependencies>
<dependency>
Expand Down Expand Up @@ -44,6 +44,7 @@
</resources>

<plugins>

<!-- build image in the 'package' phase, and ignore plain tests -->
<!-- via maven-surefire-plugin::skipTests -->
<plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package org.springframework.cloud.kubernetes.fabric8.istio;
package org.springframework.cloud.kubernetes.fabric8.client.istio;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package org.springframework.cloud.kubernetes.fabric8.istio;
package org.springframework.cloud.kubernetes.fabric8.client.istio;

import java.util.Arrays;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package org.springframework.cloud.kubernetes.fabric8.istio;
package org.springframework.cloud.kubernetes.fabric8.client.istio;

import java.io.InputStream;
import java.time.Duration;
Expand All @@ -24,7 +24,6 @@
import io.fabric8.kubernetes.api.model.Service;
import io.fabric8.kubernetes.api.model.apps.Deployment;
import io.fabric8.kubernetes.api.model.networking.v1.Ingress;
import io.fabric8.kubernetes.client.KubernetesClient;
import io.fabric8.kubernetes.client.utils.Serialization;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.Assertions;
Expand All @@ -51,14 +50,12 @@ class Fabric8IstioIT {

private static final String NAMESPACE = "istio-test";

private static final String IMAGE_NAME = "spring-cloud-kubernetes-fabric8-istio-it";
private static final String IMAGE_NAME = "spring-cloud-kubernetes-fabric8-client-istio";

private static final String ISTIO_PROXY = "istio/proxyv2";

private static final String ISTIO_PILOT = "istio/pilot";

private static KubernetesClient client;

private static Util util;

private static K3sContainer K3S;
Expand All @@ -68,7 +65,6 @@ static void beforeAll() throws Exception {
K3S = Commons.container();
K3S.start();
util = new Util(K3S);
client = util.client();
Commons.validateImage(IMAGE_NAME, K3S);
Commons.loadSpringCloudKubernetesImage(IMAGE_NAME, K3S);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: spring-cloud-kubernetes-fabric8-istio-it-deployment
name: spring-cloud-kubernetes-fabric8-client-istio
spec:
selector:
matchLabels:
app: spring-cloud-kubernetes-fabric8-istio-it
app: spring-cloud-kubernetes-fabric8-client-istio
template:
metadata:
labels:
app: spring-cloud-kubernetes-fabric8-istio-it
app: spring-cloud-kubernetes-fabric8-client-istio
spec:
serviceAccountName: spring-cloud-kubernetes-istio-serviceaccount
containers:
- name: spring-cloud-kubernetes-fabric8-istio-it
image: docker.io/springcloud/spring-cloud-kubernetes-fabric8-istio-it
- name: spring-cloud-kubernetes-fabric8-client-istio
image: docker.io/springcloud/spring-cloud-kubernetes-fabric8-client-istio
imagePullPolicy: IfNotPresent
readinessProbe:
httpGet:
Expand All @@ -26,3 +26,6 @@ spec:
path: /actuator/health/liveness
ports:
- containerPort: 8080
env:
- name: LOGGING_LEVEL_ORG_SPRINGFRAMEWORK_CLOUD_KUBERNETES_FABRIC8_CLIENT_ISTIO
value: "DEBUG"
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: it-ingress
name: spring-cloud-kubernetes-fabric8-client-istio
namespace: istio-test
spec:
rules:
Expand All @@ -11,6 +11,6 @@ spec:
pathType: Prefix
backend:
service:
name: spring-cloud-kubernetes-fabric8-istio-it
name: spring-cloud-kubernetes-fabric8-client-istio
port:
number: 8080
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
labels:
app: spring-cloud-kubernetes-fabric8-client-istio
name: spring-cloud-kubernetes-fabric8-client-istio
spec:
ports:
- name: http
port: 8080
targetPort: 8080
selector:
app: spring-cloud-kubernetes-fabric8-client-istio
type: ClusterIP

This file was deleted.