-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clean up CRD metrics types and add validation rule, tests
Signed-off-by: Michael Edgar <[email protected]>
- Loading branch information
Showing
7 changed files
with
195 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
.../com/github/streamshub/console/api/v1alpha1/spec/metrics/MetricsSourceAuthentication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package com.github.streamshub.console.api.v1alpha1.spec.metrics; | ||
|
||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
|
||
import io.fabric8.generator.annotation.ValidationRule; | ||
import io.sundr.builder.annotations.Buildable; | ||
|
||
@Buildable(builderPackage = "io.fabric8.kubernetes.api.builder") | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
@ValidationRule( | ||
value = "has(self.token) || (has(self.username) && has(self.password))", | ||
message = "One of `token` or `username` + `password` must be provided") | ||
public class MetricsSourceAuthentication { | ||
|
||
private String username; | ||
private String password; | ||
private String token; | ||
|
||
public String getUsername() { | ||
return username; | ||
} | ||
|
||
public void setUsername(String username) { | ||
this.username = username; | ||
} | ||
|
||
public String getPassword() { | ||
return password; | ||
} | ||
|
||
public void setPassword(String password) { | ||
this.password = password; | ||
} | ||
|
||
public String getToken() { | ||
return token; | ||
} | ||
|
||
public void setToken(String token) { | ||
this.token = token; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.