Skip to content

Commit

Permalink
refactor(dns): switch ci and ci alias name roles
Browse files Browse the repository at this point in the history
  • Loading branch information
tunahanertekin committed Dec 25, 2023
1 parent 49c50ad commit 63b9c0c
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 28 deletions.
8 changes: 4 additions & 4 deletions internal/resources/relay_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ func GetRelayServerIngress(relayserver *robotv1alpha1.RelayServer, ingressNamesp
secretName := relayserver.Spec.TLSSecretReference.Name

annotations := map[string]string{
internal.INGRESS_AUTH_URL_KEY: fmt.Sprintf(internal.INGRESS_AUTH_URL_VAL, tenancy.CloudInstanceAlias, rootDNSConfig.Host),
internal.INGRESS_AUTH_SIGNIN_KEY: fmt.Sprintf(internal.INGRESS_AUTH_SIGNIN_VAL, tenancy.CloudInstanceAlias, rootDNSConfig.Host),
internal.INGRESS_AUTH_URL_KEY: fmt.Sprintf(internal.INGRESS_AUTH_URL_VAL, tenancy.CloudInstance, rootDNSConfig.Host),
internal.INGRESS_AUTH_SIGNIN_KEY: fmt.Sprintf(internal.INGRESS_AUTH_SIGNIN_VAL, tenancy.CloudInstance, rootDNSConfig.Host),
internal.INGRESS_AUTH_RESPONSE_HEADERS_KEY: internal.INGRESS_AUTH_RESPONSE_HEADERS_VAL,
internal.INGRESS_CONFIGURATION_SNIPPET_KEY: internal.INGRESS_IDE_CONFIGURATION_SNIPPET_VAL,
internal.INGRESS_CERT_MANAGER_KEY: internal.INGRESS_CERT_MANAGER_VAL,
Expand All @@ -125,14 +125,14 @@ func GetRelayServerIngress(relayserver *robotv1alpha1.RelayServer, ingressNamesp
TLS: []networkingv1.IngressTLS{
{
Hosts: []string{
tenancy.CloudInstanceAlias + "." + rootDNSConfig.Host,
tenancy.CloudInstance + "." + rootDNSConfig.Host,
},
SecretName: secretName,
},
},
Rules: []networkingv1.IngressRule{
{
Host: tenancy.CloudInstanceAlias + "." + rootDNSConfig.Host,
Host: tenancy.CloudInstance + "." + rootDNSConfig.Host,
IngressRuleValue: networkingv1.IngressRuleValue{
HTTP: &networkingv1.HTTPIngressRuleValue{
Paths: []networkingv1.HTTPIngressPath{
Expand Down
16 changes: 8 additions & 8 deletions internal/resources/robot_ide.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ func GetRobotIDEIngress(robotIDE *robotv1alpha1.RobotIDE, ingressNamespacedName
secretName := robot.Spec.TLSSecretReference.Name

annotations := map[string]string{
internal.INGRESS_AUTH_URL_KEY: fmt.Sprintf(internal.INGRESS_AUTH_URL_VAL, tenancy.CloudInstanceAlias, rootDNSConfig.Host),
internal.INGRESS_AUTH_SIGNIN_KEY: fmt.Sprintf(internal.INGRESS_AUTH_SIGNIN_VAL, tenancy.CloudInstanceAlias, rootDNSConfig.Host),
internal.INGRESS_AUTH_URL_KEY: fmt.Sprintf(internal.INGRESS_AUTH_URL_VAL, tenancy.CloudInstance, rootDNSConfig.Host),
internal.INGRESS_AUTH_SIGNIN_KEY: fmt.Sprintf(internal.INGRESS_AUTH_SIGNIN_VAL, tenancy.CloudInstance, rootDNSConfig.Host),
internal.INGRESS_AUTH_RESPONSE_HEADERS_KEY: internal.INGRESS_AUTH_RESPONSE_HEADERS_VAL,
internal.INGRESS_CONFIGURATION_SNIPPET_KEY: internal.INGRESS_IDE_CONFIGURATION_SNIPPET_VAL,
internal.INGRESS_CERT_MANAGER_KEY: internal.INGRESS_CERT_MANAGER_VAL,
Expand All @@ -191,14 +191,14 @@ func GetRobotIDEIngress(robotIDE *robotv1alpha1.RobotIDE, ingressNamespacedName
TLS: []networkingv1.IngressTLS{
{
Hosts: []string{
tenancy.CloudInstanceAlias + "." + rootDNSConfig.Host,
tenancy.CloudInstance + "." + rootDNSConfig.Host,
},
SecretName: secretName,
},
},
Rules: []networkingv1.IngressRule{
{
Host: tenancy.CloudInstanceAlias + "." + rootDNSConfig.Host,
Host: tenancy.CloudInstance + "." + rootDNSConfig.Host,
IngressRuleValue: networkingv1.IngressRuleValue{
HTTP: &networkingv1.HTTPIngressRuleValue{
Paths: []networkingv1.HTTPIngressPath{
Expand Down Expand Up @@ -307,8 +307,8 @@ func GetRobotIDECustomIngress(robotIDE *robotv1alpha1.RobotIDE, ingressNamespace
secretName := robot.Spec.TLSSecretReference.Name

annotations := map[string]string{
internal.INGRESS_AUTH_URL_KEY: fmt.Sprintf(internal.INGRESS_AUTH_URL_VAL, tenancy.CloudInstanceAlias, rootDNSConfig.Host),
internal.INGRESS_AUTH_SIGNIN_KEY: fmt.Sprintf(internal.INGRESS_AUTH_SIGNIN_VAL, tenancy.CloudInstanceAlias, rootDNSConfig.Host),
internal.INGRESS_AUTH_URL_KEY: fmt.Sprintf(internal.INGRESS_AUTH_URL_VAL, tenancy.CloudInstance, rootDNSConfig.Host),
internal.INGRESS_AUTH_SIGNIN_KEY: fmt.Sprintf(internal.INGRESS_AUTH_SIGNIN_VAL, tenancy.CloudInstance, rootDNSConfig.Host),
internal.INGRESS_AUTH_RESPONSE_HEADERS_KEY: internal.INGRESS_AUTH_RESPONSE_HEADERS_VAL,
internal.INGRESS_CONFIGURATION_SNIPPET_KEY: internal.INGRESS_IDE_CONFIGURATION_SNIPPET_VAL,
internal.INGRESS_CERT_MANAGER_KEY: internal.INGRESS_CERT_MANAGER_VAL,
Expand Down Expand Up @@ -349,14 +349,14 @@ func GetRobotIDECustomIngress(robotIDE *robotv1alpha1.RobotIDE, ingressNamespace
TLS: []networkingv1.IngressTLS{
{
Hosts: []string{
tenancy.CloudInstanceAlias + "." + rootDNSConfig.Host,
tenancy.CloudInstance + "." + rootDNSConfig.Host,
},
SecretName: secretName,
},
},
Rules: []networkingv1.IngressRule{
{
Host: tenancy.CloudInstanceAlias + "." + rootDNSConfig.Host,
Host: tenancy.CloudInstance + "." + rootDNSConfig.Host,
IngressRuleValue: networkingv1.IngressRuleValue{
HTTP: &networkingv1.HTTPIngressRuleValue{
Paths: ingressPaths,
Expand Down
16 changes: 8 additions & 8 deletions internal/resources/robot_vdi.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,8 @@ func GetRobotVDIIngress(robotVDI *robotv1alpha1.RobotVDI, ingressNamespacedName
secretName := robot.Spec.TLSSecretReference.Name

annotations := map[string]string{
internal.INGRESS_AUTH_URL_KEY: fmt.Sprintf(internal.INGRESS_AUTH_URL_VAL, tenancy.CloudInstanceAlias, rootDNSConfig.Host),
internal.INGRESS_AUTH_SIGNIN_KEY: fmt.Sprintf(internal.INGRESS_AUTH_SIGNIN_VAL, tenancy.CloudInstanceAlias, rootDNSConfig.Host),
internal.INGRESS_AUTH_URL_KEY: fmt.Sprintf(internal.INGRESS_AUTH_URL_VAL, tenancy.CloudInstance, rootDNSConfig.Host),
internal.INGRESS_AUTH_SIGNIN_KEY: fmt.Sprintf(internal.INGRESS_AUTH_SIGNIN_VAL, tenancy.CloudInstance, rootDNSConfig.Host),
internal.INGRESS_AUTH_RESPONSE_HEADERS_KEY: internal.INGRESS_AUTH_RESPONSE_HEADERS_VAL,
internal.INGRESS_CONFIGURATION_SNIPPET_KEY: internal.INGRESS_VDI_CONFIGURATION_SNIPPET_VAL,
internal.INGRESS_CERT_MANAGER_KEY: internal.INGRESS_CERT_MANAGER_VAL,
Expand All @@ -288,14 +288,14 @@ func GetRobotVDIIngress(robotVDI *robotv1alpha1.RobotVDI, ingressNamespacedName
TLS: []networkingv1.IngressTLS{
{
Hosts: []string{
tenancy.CloudInstanceAlias + "." + rootDNSConfig.Host,
tenancy.CloudInstance + "." + rootDNSConfig.Host,
},
SecretName: secretName,
},
},
Rules: []networkingv1.IngressRule{
{
Host: tenancy.CloudInstanceAlias + "." + rootDNSConfig.Host,
Host: tenancy.CloudInstance + "." + rootDNSConfig.Host,
IngressRuleValue: networkingv1.IngressRuleValue{
HTTP: &networkingv1.HTTPIngressRuleValue{
Paths: []networkingv1.HTTPIngressPath{
Expand Down Expand Up @@ -392,8 +392,8 @@ func GetRobotVDICustomIngress(robotVDI *robotv1alpha1.RobotVDI, ingressNamespace
secretName := robot.Spec.TLSSecretReference.Name

annotations := map[string]string{
internal.INGRESS_AUTH_URL_KEY: fmt.Sprintf(internal.INGRESS_AUTH_URL_VAL, tenancy.CloudInstanceAlias, rootDNSConfig.Host),
internal.INGRESS_AUTH_SIGNIN_KEY: fmt.Sprintf(internal.INGRESS_AUTH_SIGNIN_VAL, tenancy.CloudInstanceAlias, rootDNSConfig.Host),
internal.INGRESS_AUTH_URL_KEY: fmt.Sprintf(internal.INGRESS_AUTH_URL_VAL, tenancy.CloudInstance, rootDNSConfig.Host),
internal.INGRESS_AUTH_SIGNIN_KEY: fmt.Sprintf(internal.INGRESS_AUTH_SIGNIN_VAL, tenancy.CloudInstance, rootDNSConfig.Host),
internal.INGRESS_AUTH_RESPONSE_HEADERS_KEY: internal.INGRESS_AUTH_RESPONSE_HEADERS_VAL,
internal.INGRESS_CONFIGURATION_SNIPPET_KEY: internal.INGRESS_IDE_CONFIGURATION_SNIPPET_VAL,
internal.INGRESS_CERT_MANAGER_KEY: internal.INGRESS_CERT_MANAGER_VAL,
Expand Down Expand Up @@ -434,14 +434,14 @@ func GetRobotVDICustomIngress(robotVDI *robotv1alpha1.RobotVDI, ingressNamespace
TLS: []networkingv1.IngressTLS{
{
Hosts: []string{
tenancy.CloudInstanceAlias + "." + rootDNSConfig.Host,
tenancy.CloudInstance + "." + rootDNSConfig.Host,
},
SecretName: secretName,
},
},
Rules: []networkingv1.IngressRule{
{
Host: tenancy.CloudInstanceAlias + "." + rootDNSConfig.Host,
Host: tenancy.CloudInstance + "." + rootDNSConfig.Host,
IngressRuleValue: networkingv1.IngressRuleValue{
HTTP: &networkingv1.HTTPIngressRuleValue{
Paths: ingressPaths,
Expand Down
8 changes: 4 additions & 4 deletions internal/resources/ros_bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ func GetBridgeIngress(rosBridge *robotv1alpha1.ROSBridge, ingressNamespacedName
secretName := robot.Spec.TLSSecretReference.Name

annotations := map[string]string{
internal.INGRESS_AUTH_URL_KEY: fmt.Sprintf(internal.INGRESS_AUTH_URL_VAL, tenancy.CloudInstanceAlias, rootDNSConfig.Host),
internal.INGRESS_AUTH_SIGNIN_KEY: fmt.Sprintf(internal.INGRESS_AUTH_SIGNIN_VAL, tenancy.CloudInstanceAlias, rootDNSConfig.Host),
internal.INGRESS_AUTH_URL_KEY: fmt.Sprintf(internal.INGRESS_AUTH_URL_VAL, tenancy.CloudInstance, rootDNSConfig.Host),
internal.INGRESS_AUTH_SIGNIN_KEY: fmt.Sprintf(internal.INGRESS_AUTH_SIGNIN_VAL, tenancy.CloudInstance, rootDNSConfig.Host),
internal.INGRESS_AUTH_RESPONSE_HEADERS_KEY: internal.INGRESS_AUTH_RESPONSE_HEADERS_VAL,
internal.INGRESS_CONFIGURATION_SNIPPET_KEY: internal.INGRESS_IDE_CONFIGURATION_SNIPPET_VAL,
internal.INGRESS_CERT_MANAGER_KEY: internal.INGRESS_CERT_MANAGER_VAL,
Expand All @@ -122,14 +122,14 @@ func GetBridgeIngress(rosBridge *robotv1alpha1.ROSBridge, ingressNamespacedName
TLS: []networkingv1.IngressTLS{
{
Hosts: []string{
tenancy.CloudInstanceAlias + "." + rootDNSConfig.Host,
tenancy.CloudInstance + "." + rootDNSConfig.Host,
},
SecretName: secretName,
},
},
Rules: []networkingv1.IngressRule{
{
Host: tenancy.CloudInstanceAlias + "." + rootDNSConfig.Host,
Host: tenancy.CloudInstance + "." + rootDNSConfig.Host,
IngressRuleValue: networkingv1.IngressRuleValue{
HTTP: &networkingv1.HTTPIngressRuleValue{
Paths: []networkingv1.HTTPIngressPath{
Expand Down
8 changes: 4 additions & 4 deletions pkg/api/roboscale.io/v1alpha1/shared_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ type StepStatus struct {

func GetRobotServiceDNSWithNodePort(robot Robot, prefix, port string) string {
tenancy := label.GetTenancy(&robot)
connectionStr := tenancy.CloudInstanceAlias + "." + robot.Spec.RootDNSConfig.Host + ":" + port
connectionStr := tenancy.CloudInstance + "." + robot.Spec.RootDNSConfig.Host + ":" + port

if prefix != "" {
connectionStr = prefix + connectionStr
Expand All @@ -86,7 +86,7 @@ func GetRobotServiceDNSWithNodePort(robot Robot, prefix, port string) string {

func GetRobotServiceDNS(robot Robot, prefix, postfix string) string {
tenancy := label.GetTenancy(&robot)
connectionStr := tenancy.CloudInstanceAlias + "." + robot.Spec.RootDNSConfig.Host + GetRobotServicePath(robot, postfix)
connectionStr := tenancy.CloudInstance + "." + robot.Spec.RootDNSConfig.Host + GetRobotServicePath(robot, postfix)

if prefix != "" {
connectionStr = prefix + connectionStr
Expand All @@ -97,7 +97,7 @@ func GetRobotServiceDNS(robot Robot, prefix, postfix string) string {

func GetRelayServerServiceDNS(rs RelayServer, prefix, postfix string) string {
tenancy := label.GetTenancy(&rs)
connectionStr := tenancy.CloudInstanceAlias + "." + rs.Spec.RootDNSConfig.Host + GetRelayServerServicePath(rs, postfix)
connectionStr := tenancy.CloudInstance + "." + rs.Spec.RootDNSConfig.Host + GetRelayServerServicePath(rs, postfix)

if prefix != "" {
connectionStr = prefix + connectionStr
Expand All @@ -110,7 +110,7 @@ func GetRobotServicePath(robot Robot, postfix string) string {
tenancy := label.GetTenancy(&robot)
connectionStr := "/" + tenancy.Team +
"/" + tenancy.Region +
"/" + tenancy.CloudInstance +
"/" + tenancy.CloudInstanceAlias +
"/" + robot.Namespace +
"/" + robot.Name

Expand Down

0 comments on commit 63b9c0c

Please sign in to comment.