Skip to content

Commit

Permalink
Merge pull request #20 from statisticsnorway/add-repo-config-override
Browse files Browse the repository at this point in the history
Add repo_config_override to atlantis block
  • Loading branch information
nicolst authored May 14, 2024
2 parents 20c7bf5 + 96d6549 commit e56ab2e
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
@JsonPropertyOrder({
"name",
"repos",
"repo_config_override",
"folder_iam"
})
@Generated("jsonschema2pojo")
Expand All @@ -44,6 +45,13 @@ public class Atlantis implements Serializable
@JsonPropertyDescription("Which repositories under Statistics Norway-organisation this team atlantis instance will monitor.")
@Valid
private List<String> repos = new ArrayList<String>();
/**
* Override values in this Atlantis' repos.yaml config. Values get merged on top of default values. Should be a valid YAML string.
*
*/
@JsonProperty("repo_config_override")
@JsonPropertyDescription("Override values in this Atlantis' repos.yaml config. Values get merged on top of default values. Should be a valid YAML string.")
private String repoConfigOverride;
/**
* Array of folder bindings to set for the Atlantis SA.
*
Expand All @@ -55,7 +63,7 @@ public class Atlantis implements Serializable
@JsonIgnore
@Valid
private Map<String, Object> additionalProperties = new LinkedHashMap<String, Object>();
private final static long serialVersionUID = 854245460037993476L;
private final static long serialVersionUID = -2127862757532224175L;

/**
* No args constructor for use in serialization
Expand All @@ -72,11 +80,14 @@ public Atlantis() {
* Array of folder bindings to set for the Atlantis SA.
* @param name
* The name of the atlantis instance.
* @param repoConfigOverride
* Override values in this Atlantis' repos.yaml config. Values get merged on top of default values. Should be a valid YAML string.
*/
public Atlantis(String name, List<String> repos, List<FolderIam__1> folderIam) {
public Atlantis(String name, List<String> repos, String repoConfigOverride, List<FolderIam__1> folderIam) {
super();
this.name = name;
this.repos = repos;
this.repoConfigOverride = repoConfigOverride;
this.folderIam = folderIam;
}

Expand Down Expand Up @@ -122,6 +133,24 @@ public void setRepos(List<String> repos) {
this.repos = repos;
}

/**
* Override values in this Atlantis' repos.yaml config. Values get merged on top of default values. Should be a valid YAML string.
*
*/
@JsonProperty("repo_config_override")
public String getRepoConfigOverride() {
return repoConfigOverride;
}

/**
* Override values in this Atlantis' repos.yaml config. Values get merged on top of default values. Should be a valid YAML string.
*
*/
@JsonProperty("repo_config_override")
public void setRepoConfigOverride(String repoConfigOverride) {
this.repoConfigOverride = repoConfigOverride;
}

/**
* Array of folder bindings to set for the Atlantis SA.
*
Expand Down Expand Up @@ -162,6 +191,10 @@ public String toString() {
sb.append('=');
sb.append(((this.repos == null)?"<null>":this.repos));
sb.append(',');
sb.append("repoConfigOverride");
sb.append('=');
sb.append(((this.repoConfigOverride == null)?"<null>":this.repoConfigOverride));
sb.append(',');
sb.append("folderIam");
sb.append('=');
sb.append(((this.folderIam == null)?"<null>":this.folderIam));
Expand All @@ -182,6 +215,7 @@ public String toString() {
public int hashCode() {
int result = 1;
result = ((result* 31)+((this.name == null)? 0 :this.name.hashCode()));
result = ((result* 31)+((this.repoConfigOverride == null)? 0 :this.repoConfigOverride.hashCode()));
result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode()));
result = ((result* 31)+((this.repos == null)? 0 :this.repos.hashCode()));
result = ((result* 31)+((this.folderIam == null)? 0 :this.folderIam.hashCode()));
Expand All @@ -197,7 +231,7 @@ public boolean equals(Object other) {
return false;
}
Atlantis rhs = ((Atlantis) other);
return (((((this.name == rhs.name)||((this.name!= null)&&this.name.equals(rhs.name)))&&((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))))&&((this.repos == rhs.repos)||((this.repos!= null)&&this.repos.equals(rhs.repos))))&&((this.folderIam == rhs.folderIam)||((this.folderIam!= null)&&this.folderIam.equals(rhs.folderIam))));
return ((((((this.name == rhs.name)||((this.name!= null)&&this.name.equals(rhs.name)))&&((this.repoConfigOverride == rhs.repoConfigOverride)||((this.repoConfigOverride!= null)&&this.repoConfigOverride.equals(rhs.repoConfigOverride))))&&((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))))&&((this.repos == rhs.repos)||((this.repos!= null)&&this.repos.equals(rhs.repos))))&&((this.folderIam == rhs.folderIam)||((this.folderIam!= null)&&this.folderIam.equals(rhs.folderIam))));
}

public static class AtlantisBuilder
Expand All @@ -209,8 +243,8 @@ public AtlantisBuilder() {
super();
}

public AtlantisBuilder(String name, List<String> repos, List<FolderIam__1> folderIam) {
super(name, repos, folderIam);
public AtlantisBuilder(String name, List<String> repos, String repoConfigOverride, List<FolderIam__1> folderIam) {
super(name, repos, repoConfigOverride, folderIam);
}

}
Expand All @@ -228,10 +262,10 @@ public AtlantisBuilderBase() {
}

@SuppressWarnings("unchecked")
public AtlantisBuilderBase(String name, List<String> repos, List<FolderIam__1> folderIam) {
public AtlantisBuilderBase(String name, List<String> repos, String repoConfigOverride, List<FolderIam__1> folderIam) {
// Skip initialization when called from subclass
if (this.getClass().equals(Atlantis.AtlantisBuilder.class)) {
this.instance = ((T) new Atlantis(name, repos, folderIam));
this.instance = ((T) new Atlantis(name, repos, repoConfigOverride, folderIam));
}
}

Expand All @@ -252,6 +286,11 @@ public Atlantis.AtlantisBuilderBase withRepos(List<String> repos) {
return this;
}

public Atlantis.AtlantisBuilderBase withRepoConfigOverride(String repoConfigOverride) {
((Atlantis) this.instance).repoConfigOverride = repoConfigOverride;
return this;
}

public Atlantis.AtlantisBuilderBase withFolderIam(List<FolderIam__1> folderIam) {
((Atlantis) this.instance).folderIam = folderIam;
return this;
Expand Down
4 changes: 4 additions & 0 deletions src/v1/kuben-team-definition.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@
"pattern": "^[a-zA-Z-_.0-9]*$"
}
},
"repo_config_override": {
"type": "string",
"description": "Override values in this Atlantis' repos.yaml config. Values get merged on top of default values. Should be a valid YAML string."
},
"folder_iam": {
"type": "array",
"description": "Array of folder bindings to set for the Atlantis SA.",
Expand Down

0 comments on commit e56ab2e

Please sign in to comment.