diff options
Diffstat (limited to 'config-model')
-rw-r--r-- | config-model/src/main/java/com/yahoo/vespa/model/application/validation/CloudClientsValidator.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/CloudClientsValidator.java b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/CloudClientsValidator.java index 2882489ef0a..557df5c7324 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/CloudClientsValidator.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/CloudClientsValidator.java @@ -1,6 +1,6 @@ package com.yahoo.vespa.model.application.validation; -import com.yahoo.config.model.deploy.DeployState; +import com.yahoo.vespa.model.application.validation.Validation.Context; import org.bouncycastle.asn1.x509.TBSCertificate; import java.security.cert.CertificateEncodingException; @@ -19,12 +19,12 @@ public class CloudClientsValidator implements Validator { if (!ctx.deployState().isHosted()) return; ctx.model().getContainerClusters().forEach((clusterName, cluster) -> { for (var client : cluster.getClients()) { - client.certificates().forEach(cert -> validateCertificate(clusterName, client.id(), cert, ctx.deployState())); + client.certificates().forEach(cert -> validateCertificate(clusterName, client.id(), cert, ctx)); } }); } - static void validateCertificate(String clusterName, String clientId, X509Certificate cert, DeployState state) { + static void validateCertificate(String clusterName, String clientId, X509Certificate cert, Context ctx) { try { var extensions = TBSCertificate.getInstance(cert.getTBSCertificate()).getExtensions(); if (extensions == null) return; // Certificate without any extensions is okay @@ -42,10 +42,10 @@ public class CloudClientsValidator implements Validator { "Please update the application package with a new certificate, " + "e.g by generating a new one using the Vespa CLI `$ vespa auth cert`. " + "Such certificate will no longer be accepted in near future."; - state.getDeployLogger().log(Level.WARNING, errorMessage(clusterName, clientId, message)); + ctx.deployState().getDeployLogger().log(Level.WARNING, errorMessage(clusterName, clientId, message)); } } catch (CertificateEncodingException e) { - throw new IllegalArgumentException(errorMessage(clusterName, clientId, e.getMessage()), e); + ctx.illegal(errorMessage(clusterName, clientId, e.getMessage()), e); } } |