java icon indicating copy to clipboard operation
java copied to clipboard

`Taints.Effect.NO_EXECUTE.toString()` returns "NoExcute" instead of "NoExecute"

Open sky-bro opened this issue 3 years ago • 3 comments

Describe the bug

the enum value Taints.Effect.NO_EXECUTE's toString() method returns "NoExcute" instead of "NoExecute".

source code: https://github.com/kubernetes-client/java/blob/master/util/src/main/java/io/kubernetes/client/util/taints/Taints.java#L35

Client Version 16.0.0

Kubernetes Version 1.24.3

Java Version Java 8

To Reproduce add a taint to a node with:

import io.kubernetes.client.extended.kubectl.Kubectl;
import io.kubernetes.client.extended.kubectl.exception.KubectlException;
import io.kubernetes.client.openapi.Configuration;
import io.kubernetes.client.util.Config;

import java.io.IOException;

class Main{
    public static void main(String[] args) throws KubectlException, IOException {
        Configuration.setDefaultApiClient(Config.defaultClient());
        String nodeName = "myk8s-4nodes-worker";
        // neither "NoExecute" or "NoExcute" will work
        Kubectl.taint().name(nodeName).addTaint("key", "value", "NoExecute").execute();
    }
}

Expected behavior taint (with Effect "NoExecute") should be added correctly

sky-bro avatar Aug 14 '22 07:08 sky-bro

Yeah, that's a bug. We'd happily take a PR with the fix or we'll get to it eventually.

brendandburns avatar Aug 15 '22 15:08 brendandburns

/assign

priyal13m avatar Aug 16 '22 06:08 priyal13m

Before: image After: image

priyal13m avatar Aug 16 '22 08:08 priyal13m

good catch!

yue9944882 avatar Aug 18 '22 10:08 yue9944882