Repository: GoogleContainerTools/jib
File: jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/ContainerParameters.java (Java)

Code before:
      return ConfigurationPropertyValidator.parseListProperty(
          System.getProperty(PropertyNames.CONTAINER_VOLUMES));
    }
    return volumes;
  }

  public void setVolumes(List<String> volumes) {
    this.volumes = volumes;
  }

  @Input
  @Optional
  public Map<String, String> getLabels() {
    if (System.getProperty(PropertyNames.CONTAINER_LABELS) != null) {
      return ConfigurationPropertyValidator.parseMapProperty(
          System.getProperty(PropertyNames.CONTAINER_LABELS));
    }
    return labels.get();
  }

  public void setLabels(Map<String, String> labels) {
    this.labels.set(labels);
  }

  public void setLabels(Provider<Map<String, String>> labels) {
    this.labels.set(labels);
  }

  @Input
  @Optional
  public String getAppRoot() {
    if (System.getProperty(PropertyNames.CONTAINER_APP_ROOT) != null) {
      return System.getProperty(PropertyNames.CONTAINER_APP_ROOT);
    }
    return appRoot;
  }

  public void setAppRoot(String appRoot) {
    this.appRoot = appRoot;
  }

  @Input
  @Nullable
  @Optional
  public String getUser() {
    if (System.getProperty(PropertyNames.CONTAINER_USER) != null) {
      return System.getProperty(PropertyNames.CONTAINER_USER);
    }
    return user;
  }


Review comment (suggestion):
We should do this in the new way like [this](https://github.com/GoogleContainerTools/jib/blob/026a263b22b7265ddb5323ac74351c99486cad21/jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/JibExtension.java#L234-L242) (#3034 and [#3121](https://github.com/GoogleContainerTools/jib/pull/3121/files#diff-ec1f44085899ade105be7cc3c4febe441db808c45bd067be6827bd19c2f52958R238) as explained in #3094). That is, no more setters, and `getLabels()` exposes the `MapProperty`. (This assumes the existing usage of directly assigning a map will continue to work, which I think will be the case.) The getter should also update its value after checking the corresponding system property (but only when the value differs).

Code after:
          System.getProperty(PropertyNames.CONTAINER_VOLUMES));
    }
    return volumes;
  }

  public void setVolumes(List<String> volumes) {
    this.volumes = volumes;
  }

  @Input
  @Optional
  public MapProperty<String, String> getLabels() {
    String labelsProperty = System.getProperty(PropertyNames.CONTAINER_LABELS);
    if (labelsProperty != null) {
      Map<String, String> parsedLabels =
          ConfigurationPropertyValidator.parseMapProperty(labelsProperty);
      if (!parsedLabels.equals(labels.get())) {
        labels.set(parsedLabels);
      }
    }
    return labels;
  }

  @Input
  @Optional
  public String getAppRoot() {
    if (System.getProperty(PropertyNames.CONTAINER_APP_ROOT) != null) {
      return System.getProperty(PropertyNames.CONTAINER_APP_ROOT);
    }
    return appRoot;
  }

  public void setAppRoot(String appRoot) {
    this.appRoot = appRoot;
  }

  @Input
  @Nullable
  @Optional
  public String getUser() {
    if (System.getProperty(PropertyNames.CONTAINER_USER) != null) {
      return System.getProperty(PropertyNames.CONTAINER_USER);
    }
    return user;
  }

  public void setUser(String user) {
    this.user = user;
  }

  @Input