-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
de1ae75
commit 8d004dc
Showing
71 changed files
with
1,312 additions
and
1,409 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
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
43 changes: 43 additions & 0 deletions
43
pkg/controllers/dynakube/activegate/capability/dnsentrypoint.go
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,43 @@ | ||
package capability | ||
|
||
import ( | ||
"fmt" | ||
"strings" | ||
|
||
"github.com/Dynatrace/dynatrace-operator/pkg/api/v1beta3/dynakube" | ||
"github.com/Dynatrace/dynatrace-operator/pkg/controllers/dynakube/activegate/consts" | ||
"k8s.io/utils/net" | ||
) | ||
|
||
func BuildDNSEntryPoint(dk dynakube.DynaKube, capability Capability) string { | ||
entries := []string{} | ||
|
||
for _, ip := range dk.Status.ActiveGate.ServiceIPs { | ||
if net.IsIPv6String(ip) { | ||
ip = "[" + ip + "]" | ||
} | ||
|
||
serviceHostEntry := buildDNSEntry(buildServiceHostName(ip)) | ||
entries = append(entries, serviceHostEntry) | ||
} | ||
|
||
if dk.IsRoutingActiveGateEnabled() { | ||
serviceDomain := buildServiceDomainName(dk.Name, dk.Namespace, capability.ShortName()) | ||
serviceDomainEntry := buildDNSEntry(serviceDomain) | ||
entries = append(entries, serviceDomainEntry) | ||
} | ||
|
||
return strings.Join(entries, ",") | ||
} | ||
|
||
func buildServiceHostName(host string) string { | ||
return fmt.Sprintf("%s:%d", host, consts.HttpsServicePort) | ||
} | ||
|
||
func buildServiceDomainName(dynakubeName string, namespaceName string, module string) string { | ||
return fmt.Sprintf("%s.%s:%d", BuildServiceName(dynakubeName, module), namespaceName, consts.HttpsServicePort) | ||
} | ||
|
||
func buildDNSEntry(host string) string { | ||
return fmt.Sprintf("https://%s/communication", host) | ||
} |
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.