Uploaded image for project: 'Karaf'
  1. Karaf
  2. KARAF-4729

cluster:feature-repo-refresh never works

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • cellar-4.0.2
    • cellar-4.0.3
    • cellar
    • None

    Description

      It is impossible to refresh a feature repo:

      > feature-repo-list default | grep standard
      standard-4.0.6 | cluster/local | mvn:org.apache.karaf.features/standard/4.0.6/xml/features
      > feature-repo-refresh default standard-4.0.6
      Features repository standard-4.0.6 doesn't exist in cluster group default

      I believe the problem lies here:

      https://github.com/apache/karaf-cellar/blob/master/features/src/main/java/org/apache/karaf/cellar/features/shell/RepoRefreshCommand.java#L76-L83

      It essentially calls Map<String,String>#get(URI) which always returns null:

      java> java.net.URI uri = new java.net.URI("https://google.com");
      java.net.URL uri = https://google.com
      java> Map<String, String> m = new HashMap<>();
      java.util.Map<java.lang.String, java.lang.String> m = {}
      java> m.put("https://google.com", "test");
      java.lang.Object res3 = null
      java> m.get(uri);
      java.lang.Object res4 = null

      I also see that there's a similar problem in other parts, like here: https://github.com/apache/karaf-cellar/blob/master/features/src/main/java/org/apache/karaf/cellar/features/shell/RepoAddCommand.java#L90-L97

      Or is there anything I am missing about this code?

      If necessary, I can send a PR.

      Attachments

        Activity

          People

            jbonofre Jean-Baptiste Onofré
            yrashk Yurii Rashkovskii
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: