Skip to content
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
41 changes: 36 additions & 5 deletions .github/workflows/composites/pre-test-actions/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,57 @@ runs:
with:
jdk-version: ${{ inputs.jdk-version }}

- name: restore common images
# restore or download common docker test images, like: busybox, wiremock.
# these will be placed in /tmp/docker/images
- name: restore common images to /tmp/docker/images
uses: ./.github/workflows/composites/restore-docker-images

- name: build project
shell: bash
run: |
./mvnw clean install -Dspring-boot.build-image.skip=true -DskipITs -DskipTests -T1C -U -B -q

# we could cache these images also, but the vast majority of time, we will
# be running against a SNAPSHOT version.
- name: build controllers project
uses: ./.github/workflows/composites/build-controllers-project

# we could cache these images also, but the vast majority of time, we will
# be running against a SNAPSHOT version.
- name: build integration tests project
uses: ./.github/workflows/composites/build-integration-tests-project

- name: put controllers and integration tests tars to /tmp/docker/images
shell: bash
run: |

# find the version of our project from file: spring-cloud-kubernetes-integration-tests/pom.xml
PROJECT_VERSION="$(./mvnw -q -f spring-cloud-kubernetes-integration-tests/pom.xml help:evaluate -Dexpression=project.version -DforceStdout)"

# get the existing docker images ( controllers and integration tests ) into the 'images' array
mapfile -t images < <(
docker image ls --format '{{.Repository}}:{{.Tag}}' \
| grep "^springcloud/.*:${PROJECT_VERSION}$" \
| sort -u
)

# print what we currently have
for i in "${!images[@]}"; do
printf 'images[%s]=%s\n' "$i" "${images[$i]}"
done

# look at variable 'var', if it starts with 'springcloud/', remove it, return the rest.
for image in "${images[@]}"; do
tar_name="${image#springcloud/}.tar"
docker save -o "/tmp/docker/images/${tar_name}" "$image"
done

- name: display /tmp/docker/images
shell: bash
run: ls -l /tmp/docker/images

- name: download tests
uses: actions/download-artifact@v4
with:
name: tests-${{ inputs.branch }}-jdk${{ inputs.jdk-version }}.txt
path: /tmp




Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
"spring.cloud.kubernetes.reload.monitoring-config-maps=false",
"spring.cloud.kubernetes.reload.monitoring-secrets=true",
"spring.cloud.kubernetes.secrets.enabled=true",
"spring.cloud.kubernetes.secrets.enabled=true",
"spring.cloud.kubernetes.reload.secrets-labels[spring.cloud.kubernetes.secret]=true",
"spring.cloud.kubernetes.configuration.watcher.refresh-delay=1ms" })
class SecretWatcherWithLabelsTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ static void manifests(Phase phase, Fabric8ClientKubernetesFixture fabric8Kuberne

if (phase.equals(Phase.CREATE)) {
fabric8KubernetesFixture.createAndWait(namespace, configMap, null);
fabric8KubernetesFixture.createAndWait(namespace, null, deployment, service, true);
fabric8KubernetesFixture.createAndWait(namespace, deployment, service, true);
}
else {
fabric8KubernetesFixture.deleteAndWait(namespace, configMap, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class ConfigurationWatcherBusKafkaIT {
void setup(NativeClientKubernetesFixture fixture) {
V1Deployment deployment = fixture.yaml("app/app-deployment.yaml", V1Deployment.class);
V1Service service = fixture.yaml("app/app-service.yaml", V1Service.class);
fixture.createAndWait("default", null, deployment, service, true);
fixture.createAndWait("default", deployment, service, true);
}

@AfterEach
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class ConfigurationWatcherBusAmqpIT {
void setup(NativeClientKubernetesFixture fixture) {
V1Deployment deployment = fixture.yaml("app/app-deployment.yaml", V1Deployment.class);
V1Service service = fixture.yaml("app/app-service.yaml", V1Service.class);
fixture.createAndWait("default", null, deployment, service, true);
fixture.createAndWait("default", deployment, service, true);
}

@AfterEach
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ class K8sClientConfigMapConfigTreeIT extends K8sClientReloadBase {

@BeforeAll
static void beforeAllLocal(NativeClientKubernetesFixture fixture) {
manifests(Phase.CREATE, fixture, "default", "spring-cloud-kubernetes-k8s-client-reload");
manifests(Phase.CREATE, fixture, "default");
}

@AfterAll
static void afterAll(NativeClientKubernetesFixture fixture) {
manifests(Phase.DELETE, fixture, "default", "spring-cloud-kubernetes-k8s-client-reload");
manifests(Phase.DELETE, fixture, "default");
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,15 @@ protected static void replaceConfigMap(CoreV1Api api, V1ConfigMap configMap) {
}
}

protected static void manifests(Phase phase, NativeClientKubernetesFixture fixture, String namespace,
String imageName) {
protected static void manifests(Phase phase, NativeClientKubernetesFixture fixture, String namespace) {

V1Deployment deployment = fixture.yaml("mount/deployment.yaml", V1Deployment.class);
V1Service service = fixture.yaml("mount/service.yaml", V1Service.class);
V1ConfigMap configMap = fixture.yaml("mount/configmap.yaml", V1ConfigMap.class);

if (phase.equals(Phase.CREATE)) {
fixture.createAndWait(namespace, configMap, null);
fixture.createAndWait(namespace, imageName, deployment, service, true);
fixture.createAndWait(namespace, deployment, service, true);
}
else {
fixture.deleteAndWait(namespace, configMap, null);
Expand All @@ -114,7 +113,7 @@ protected static void manifestsSecret(Phase phase, NativeClientKubernetesFixture

if (phase.equals(Phase.CREATE)) {
fixture.createAndWait("default", null, secret);
fixture.createAndWait("default", "spring-cloud-kubernetes-k8s-client-reload", deployment, service, true);
fixture.createAndWait("default", deployment, service, true);
}
else {
fixture.deleteAndWait("default", null, secret);
Expand Down
Loading
Loading