Skip to content

Commit

Permalink
Merge pull request #32872 from vespa-engine/hmusum/log-warning-when-u…
Browse files Browse the repository at this point in the history
…sing-admin-version-2.0-in-cloud

Log warning (shown in console) when using admin version 2.0 on cloud
  • Loading branch information
oyving authored Nov 18, 2024
2 parents 9c69720 + 96bf71e commit d1ea0f3
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@

import java.util.Collection;
import java.util.List;
import java.util.logging.Level;

import static java.util.logging.Level.WARNING;

/**
* Config model adaptor of the Admin class.
Expand Down Expand Up @@ -78,7 +79,10 @@ public BuilderV2() {

@Override
public void doBuild(AdminModel model, Element adminElement, ConfigModelContext modelContext) {
if (modelContext.getDeployState().isHosted()) { // admin v4 is used on hosted: Build a default V4 instead
// admin v4 is used on hosted: Build a default V4 instead
if (modelContext.getDeployState().isHosted()) {
modelContext.getDeployLogger().logApplicationPackage(WARNING, "<admin> version 2.0 is deprecated" +
" and will be ignored, please use <admin> version 4.0 instead");
new BuilderV4().doBuild(model, adminElement, modelContext);
return;
}
Expand Down Expand Up @@ -114,7 +118,7 @@ public void doBuild(AdminModel model, Element adminElement, ConfigModelContext m
// TODO: Remove in Vespa 9
if ("3.0".equals(adminElement.getAttribute("version")))
modelContext.getDeployState().getDeployLogger()
.logApplicationPackage(Level.WARNING, "admin model version 3.0 is deprecated and support will removed in Vespa 9, " +
.logApplicationPackage(WARNING, "admin model version 3.0 is deprecated and support will removed in Vespa 9, " +
"please use version 4.0 or remove the element completely. See https://cloud.vespa.ai/en/reference/services#ignored-elements");

TreeConfigProducer<AnyConfigProducer> parent = modelContext.getParentProducer();
Expand Down

0 comments on commit d1ea0f3

Please sign in to comment.