snowdrop / istio-java-api

A Java API to generate Istio descriptors, inspired by Fabric8's kubernetes-model.
Apache License 2.0
112 stars 33 forks source link

Bug - Bad resourceT in ServiceEntryOperationImpl class #46

Closed jmirc closed 5 years ago

jmirc commented 5 years ago

Hi,

I am using the library with Rancher 2.0 and EKS and I am not able to create a serviceEntry or to list of serviceEntry previously created. The resourceT in the ServiceEntryOperationImpl class is set as serviceentrys. This seems to be an issue with the plurials.

I changed to serviceentries and everything works as expected.

  public ServiceEntryOperationImpl(OkHttpClient client, Config config, String apiVersion, String namespace, String name, Boolean cascading, ServiceEntry item, String resourceVersion, Boolean reloadingFromServer, long gracePeriodSeconds, Map<String, String> labels, Map<String, String> labelsNot, Map<String, String[]> labelsIn, Map<String, String[]> labelsNotIn, Map<String, String> fields) {
    super(client, config, "networking.istio.io", apiVersion, "serviceentrys", namespace, name, cascading, item, resourceVersion, reloadingFromServer, gracePeriodSeconds, labels, labelsNot, labelsIn, labelsNotIn, fields);
  }
geoand commented 5 years ago

Hi,

Could you tell us what version of the library you are using?

We fixed an issue with the plurals (see this), but we haven't released a new version yet.

@metacosm Are we planning on making any more changes or can we release 1.0.0.Alpha2?

metacosm commented 5 years ago

Will check if we can merge #45 and then will release 1.0.0.Alpha2

jmirc commented 5 years ago

If you merged, I will fix it. For now, I just created two classes to avoid the problem.

metacosm commented 5 years ago

Working on it. I'd be interested in hearing about how you use the API and if you have any comments/suggestions… :)

jmirc commented 5 years ago

I am developing on a new tool to deploy micro-services with rancherv2/kubernetes/istio. I am working for Expedia and I need to integrate this new tool under our CICD platform. I didn't find any external tools that I could re-use. For now, the library is very similar to the one I am using for kubernetes (fabric8), so I didn't find any problems in term of usability.

However, here are two points that could be improved

1) inNamespace method not implemented I created a new client that extends the me.snowdrop.istio.clientv2.DefaultIstioClient class and I implemented the method and it works.

    override fun inNamespace(namespace: String): NamespacedIstioClient {
        val updated = (ConfigBuilder(this.configuration).withNamespace(namespace) as ConfigBuilder).build()
        return DefaultIstioClient(httpClient, updated)
    }

Why the method returns null for now?

2) kotlin DSL I am using kotlin and I found this DSL for kubernetes (https://github.com/fkorotkov/k8s-kotlin-dsl). It allows having a better readability of the code.

Great job. Jerome

metacosm commented 5 years ago

@jmirc we've just released a new version of the API which should address both of your concerns. Please give that version a try and close this issue if the issues you were seeing are indeed fixed. Thank you for the feedback and encouraging words!

jmirc commented 5 years ago

Everything works including the fix in the inNamespace method.

Thanks. I am closing the issue.