[fabric] require-profile-set doesn't handle multi versions of profiles

Solution Verified - Updated -

Issue

  • To set requirements (require-profile-set command) on a profile xxx, the default version must be the version of the profile, unless we have the message "Profile xxx is not valid".
fabric:create --wait-for-provisioning --resolver localip
version-create 1.1
profile-create --version 1.1 test
require-profile-set test

# Error executing command: Profile test is not valid
2017-06-19 15:48:00,702 | ERROR | l Console Thread | Console                          | 38 - org.apache.karaf.shell.console - 2.4.0.redhat-630262 | Exception caught while executing command
java.lang.IllegalArgumentException: Profile test is not valid
    at io.fabric8.api.Profiles.assertValidProfileId(Profiles.java:446)
    at io.fabric8.service.FabricServiceImpl.validateProfileRequirements(FabricServiceImpl.java:1174)
    at io.fabric8.service.FabricServiceImpl.validateRequirements(FabricServiceImpl.java:1168)
    at io.fabric8.service.FabricServiceImpl.setRequirements(FabricServiceImpl.java:1140)
    at io.fabric8.commands.support.ChangeRequirementSupport.doExecute(ChangeRequirementSupport.java:43)
    at org.apache.karaf.shell.console.AbstractAction.execute(AbstractAction.java:33)
    at org.apache.felix.gogo.commands.basic.AbstractCommand.execute(AbstractCommand.java:35)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.7.0_121]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.7.0_121]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_121]
    at java.lang.reflect.Method.invoke(Method.java:606)[:1.7.0_121]
    at org.apache.aries.proxy.impl.ProxyHandler$1.invoke(ProxyHandler.java:54)[19:org.apache.aries.proxy.impl:1.0.5]
    at org.apache.aries.proxy.impl.ProxyHandler.invoke(ProxyHandler.java:119)[19:org.apache.aries.proxy.impl:1.0.5]
    at io.fabric8.commands.$RequireProfileSet435153531.execute(Unknown Source)[mvn:org.apache.aries.proxy/org.apache.aries.proxy.impl/1.0.5:]
    at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78)[38:org.apache.karaf.shell.console:2.4.0.redhat-630262]
    at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:477)[38:org.apache.karaf.shell.console:2.4.0.redhat-630262]
    at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:403)[38:org.apache.karaf.shell.console:2.4.0.redhat-630262]
    at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[38:org.apache.karaf.shell.console:2.4.0.redhat-630262]
    at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)[38:org.apache.karaf.shell.console:2.4.0.redhat-630262]
    at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)[38:org.apache.karaf.shell.console:2.4.0.redhat-630262]
    at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:92)[38:org.apache.karaf.shell.console:2.4.0.redhat-630262]
    at org.apache.karaf.shell.console.jline.Console.run(Console.java:197)[38:org.apache.karaf.shell.console:2.4.0.redhat-630262]
    at org.apache.karaf.shell.console.jline.DelayedStarted.run(DelayedStarted.java:79)[38:org.apache.karaf.shell.console:2.4.0.redhat-630262]

Environment

  • Red Hat JBoss Fuse
    • 6.3.0

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In