-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added ext dns aliases to application (#600)
* Added ext dns aliases to application * Fixed failed list
- Loading branch information
Showing
5 changed files
with
94 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package models | ||
|
||
// DNSExternalAlias holds public external DNS alias information | ||
// swagger:model DNSExternalAlias | ||
type DNSExternalAlias struct { | ||
// URL the public endpoint | ||
// | ||
// required: true | ||
// example: https://my-app.equinor.com | ||
URL string `json:"url"` | ||
|
||
// ComponentName the component exposing the endpoint | ||
// | ||
// required: true | ||
// example: frontend | ||
ComponentName string `json:"componentName"` | ||
|
||
// EnvironmentName the environment hosting the endpoint | ||
// | ||
// required: true | ||
// example: prod | ||
EnvironmentName string `json:"environmentName"` | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package models | ||
|
||
import ( | ||
"github.com/equinor/radix-api/api/applications/models" | ||
"github.com/equinor/radix-common/utils/slice" | ||
radixv1 "github.com/equinor/radix-operator/pkg/apis/radix/v1" | ||
) | ||
|
||
// BuildDNSExternalAliases builds DNSExternalAliases model list | ||
func BuildDNSExternalAliases(ra *radixv1.RadixApplication) []models.DNSExternalAlias { | ||
if ra == nil { | ||
return nil | ||
} | ||
return slice.Reduce(ra.Spec.DNSExternalAlias, make([]models.DNSExternalAlias, 0), func(acc []models.DNSExternalAlias, externalAlias radixv1.ExternalAlias) []models.DNSExternalAlias { | ||
return append(acc, models.DNSExternalAlias{ | ||
URL: externalAlias.Alias, | ||
ComponentName: externalAlias.Component, | ||
EnvironmentName: externalAlias.Environment, | ||
}) | ||
}) | ||
} |
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