Skip to content
This repository was archived by the owner on Mar 30, 2022. It is now read-only.
This repository was archived by the owner on Mar 30, 2022. It is now read-only.

Unknown field 'localityLbSetting' #131

@kent61314

Description

@kent61314

Hi

I am trying to create a DestinationRule with LocalityLoadBalancer using istio-client 1.7.7.1 on istio 1.8.3

            LocalityLoadBalancerSetting localityLbSetting = new LocalityLoadBalancerSetting(null, true, null);
            OutlierDetection outlierDetection = new OutlierDetection(null, 3, null, null, new Duration(0, (long) 10), null, null);
            DestinationRuleBuilder destinationRuleBuilder = new DestinationRuleBuilder()
                .withNewMetadata()
                    .withName("helloworld")
                    .withNamespace("sample")
                .endMetadata()
                .withNewSpec()
                    .withNewHost("helloworld.sample.svc.cluster.local")
                    .withNewTrafficPolicy()
                        .withNewLoadBalancer()
                            .withNewSimpleLbPolicy()
                                .withSimple(SimpleLB.ROUND_ROBIN)
                            .endSimpleLbPolicy()
                            .withLocalityLbSetting(localityLbSetting)
                        .endLoadBalancer()
                        .withOutlierDetection(outlierDetection)
                    .endTrafficPolicy()
                .endSpec();
            DestinationRule destinationRule = destinationRuleBuilder.build();
            destinationRule = istioClient.v1beta1DestinationRule().inNamespace("sample").withName("helloworld").createOrReplace(destinationRule);

I got the following error:

Caused by: com.fasterxml.jackson.databind.JsonMappingException: Unknown field 'localityLbSetting' (through reference chain: me.snowdrop.istio.api.networking.v1beta1.DestinationRule["spec"]->me.snowdrop.istio.api.networking.v1beta1.DestinationRuleSpec["trafficPolicy"]->me.snowdrop.istio.api.networking.v1beta1.TrafficPolicy["loadBalancer"])
	at com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:390)
	at com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:349)
	at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.wrapAndThrow(BeanDeserializerBase.java:1807)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:326)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:187)
	at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:324)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:187)
	at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:324)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:187)
	at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.readRootValue(DefaultDeserializationContext.java:322)
	at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4593)
	at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3593)
	at io.fabric8.kubernetes.client.utils.Serialization.unmarshal(Serialization.java:243)
	... 32 more
Caused by: java.lang.IllegalArgumentException: Unknown field 'localityLbSetting'
	at me.snowdrop.istio.api.internal.ClassWithInterfaceFieldsRegistry.getFieldInfo(ClassWithInterfaceFieldsRegistry.java:115)
	at me.snowdrop.istio.api.internal.ClassWithInterfaceFieldsDeserializer.deserialize(ClassWithInterfaceFieldsDeserializer.java:78)
	at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:324)

Is this the same issue with #64 (comment) ?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions