Giter VIP home page Giter VIP logo

Comments (4)

rohanKanojia avatar rohanKanojia commented on July 23, 2024

@amihalfa : Is it possible for you to debug this to check what's wrong with Enricher behavior?

  1. Set a breakpoint in Enricher
  2. Run mvnDebug k8s:resource from terminal
  3. Connect Via Remote JVM Debug from your IDE

I see that in code we're only setting name when it's blank:

if (StringUtils.isNotBlank(configuredName)) {
resource.withName(configuredName);
} else if (StringUtils.isBlank(resource.getName())) {
resource.withName(defaultName);

from jkube.

amihalfa avatar amihalfa commented on July 23, 2024

Hello @rohanKanojia

When I debug :

  • configuredName has the value set in my pom.xml
  • defaultName has the value of my ${project.artifactId}

The resource name is always overwritten if a configuredName is set. From my point of view, if the resource already has a name, we keep the name, even if there is a configuredName.

My expected behaviour is to have in NameEnricher something like this :

        builder.accept(new TypedVisitor<ObjectMetaBuilder>() {
            @Override
            public void visit(ObjectMetaBuilder resource) {
                if (StringUtils.isBlank(resource.getName())) {
                    if (StringUtils.isNotBlank(configuredName)) {
                        resource.withName(configuredName);
                    } else {
                        resource.withName(defaultName);
                    }
                }
            }
        });

Thanks !

from jkube.

rohanKanojia avatar rohanKanojia commented on July 23, 2024

@amihalfa : Your approach looks correct to me. Is it possible to contribute a pull request for this?

from jkube.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.