Skip to content
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

Add support for k8s 1.32 to K3sContainer #353

Merged
merged 2 commits into from
Feb 11, 2025
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
3 changes: 3 additions & 0 deletions k8s-versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@
},
{
"k8s": "1.31.0"
},
{
"k8s": "1.32.0"
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public static X509Certificate sign(

final X509v3CertificateBuilder certGenerator = new X509v3CertificateBuilder(
new X500Name(issuerDn),
BigInteger.valueOf(SECURE_RANDOM.nextInt()),
BigInteger.valueOf(Math.abs(SECURE_RANDOM.nextInt())),
notBefore,
notAfter,
new X500Name(ownerDn),
Expand Down
13 changes: 6 additions & 7 deletions src/test/java/com/dajudge/kindcontainer/webhook/WebhookTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
import static io.fabric8.kubernetes.client.Config.fromKubeconfig;
import static java.time.Duration.ofSeconds;
import static java.util.Collections.emptyMap;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.junit.jupiter.api.Assertions.*;
import static org.testcontainers.shaded.org.awaitility.Awaitility.await;

public class WebhookTest {
Expand Down Expand Up @@ -63,19 +62,19 @@ private static void assertObeysObjectSelector(NamespacedKubernetesClient client)
}

private static void awaitWebhooks(NamespacedKubernetesClient client) {
await().ignoreExceptions()
.timeout(ofSeconds(30))
await().timeout(ofSeconds(30))
.untilAsserted(() -> assertValidates(client.inNamespace("default")));
await().ignoreExceptions()
.timeout(ofSeconds(30))
await().timeout(ofSeconds(30))
.untilAsserted(() -> assertMutates(client.inNamespace("default")));
}

private static void assertValidates(NamespacedKubernetesClient client) {
try {
client.configMaps().create(buildConfigMap(false, true));
fail("ConfigMap should not have been accepted");
} catch (final KubernetesClientException e) {
if (e.getCode() == 400) {
if (e.getStatus().getCode() == 400) {
// This is what we expect: the validating webhook failed our request
return;
}
throw e;
Expand Down
Loading