Closed geoand closed 6 years ago
json reports this error as it parses text while the model has been defined as integer
Model
@JsonInclude(Include.NON_EMPTY)
@JsonPropertyOrder({"apiVersion", "kind", "metadata", "accessLogFile", "authPolicy", "connectTimeout", "defaultConfig", "disablePolicyChecks", "egressProxyAddress", "enableTracing", "ingressClass", "ingressControllerMode", "ingressService", "mixerAddress", "mtlsExcludedServices", "proxyHttpPort", "proxyListenPort", "rdsRefreshDelay"})
public class MeshConfig {
@JsonProperty("accessLogFile")
@JsonPropertyDescription("")
private String accessLogFile;
@JsonProperty("authPolicy")
@JsonPropertyDescription("")
private Integer authPolicy;
Istio config protobuf maps auth mode to an integer value
const (
// Do not encrypt Envoy to Envoy traffic.
AuthenticationPolicy_NONE AuthenticationPolicy = 0
// Envoy to Envoy traffic is wrapped into mutual TLS connections.
AuthenticationPolicy_MUTUAL_TLS AuthenticationPolicy = 1
// Use the policy defined by the parent scope. Should not be used for mesh
// policy.
AuthenticationPolicy_INHERIT AuthenticationPolicy = 1000
)
var AuthenticationPolicy_name = map[int32]string{
0: "NONE",
1: "MUTUAL_TLS",
1000: "INHERIT",
}
var AuthenticationPolicy_value = map[string]int32{
"NONE": 0,
"MUTUAL_TLS": 1,
"INHERIT": 1000,
}
I was testing whether or not the demo Spring Boot Istio application works correctly when Istio Auth is enabled. Unfortunately I encountered the following issue when deploying the application using
mvn clean package fabric8:deploy -Pistio-openshift
.It seems that there is a mismatch between the Java model specified for the
MeshConfig
object and the actual data being used in Openshift.When Auth is enabled, the ConfigMap that holds the Mesh configuration in Openshift looks something like the following:
Note that when Auth is not enabled, the line
authPolicy: MUTUAL_TLS
is commented out, which is why there is no mapping exception occurring in that case.Furthermore, this seems to be the AuthenticationPolicy type definition in istio/api.
I am guessing that the Java model assumes the Golang enum would end up in the ConfigMap as an Integer, when it actually ends up as a String.