feat(cf): default env if not set for account
MODIFY
clouddriver-cloudfoundry/src/main/java/com/netflix/spinnaker/clouddriver/cloudfoundry/security/CloudFoundryCredentials.java
clouddriver-cloudfoundry/src/main/java/com/netflix/spinnaker/clouddriver/cloudfoundry/security/CloudFoundryCredentials.java
@@ -24,10 +24,12 @@ import com.netflix.spinnaker.clouddriver.security.AccountCredentials;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
+import javax.annotation.Nullable;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
+import java.util.Optional;
import static java.util.Collections.emptyList;
import static java.util.Collections.singletonMap;
@@ -37,9 +39,14 @@ import static java.util.stream.Collectors.toList;
@Getter
@JsonIgnoreProperties({"credentials", "client"})
public class CloudFoundryCredentials implements AccountCredentials<CloudFoundryClient> {
+
private final String name;
+
+ @Nullable
private final String environment;
+
private final String accountType = "cloudfoundry";
+
private final String cloudProvider = "cloudfoundry";
@Deprecated
@@ -49,7 +56,7 @@ public class CloudFoundryCredentials implements AccountCredentials<CloudFoundryC
public CloudFoundryCredentials(String name, String appsManagerUri, String metricsUri, String apiHost, String userName, String password, String environment) {
this.name = name;
- this.environment = environment;
+ this.environment = Optional.ofNullable(environment).orElse("dev");
this.credentials = new HttpCloudFoundryClient(name, appsManagerUri, metricsUri, apiHost, userName, password);
}

feat(cf): default env if not set for account (#3425)

Co-Authored-By: Ria Stein <eleftheria.kousathana@gmail.com>