-
Notifications
You must be signed in to change notification settings - Fork 243
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat (dns) : Add
host.crc.testing
to /etc/hosts (#4410)
+ Add another method `GetFQDN()` to CrcBundleInfo struct in order to provide host domain + Use abovementioned method in `dns.addOpenShiftHosts` in order to add another dns entry for `host.crc.testing` Signed-off-by: Rohan Kumar <[email protected]>
- Loading branch information
1 parent
107c55c
commit 504c055
Showing
4 changed files
with
75 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package dns | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/Masterminds/semver/v3" | ||
"github.com/crc-org/crc/v2/pkg/crc/machine/bundle" | ||
"github.com/crc-org/crc/v2/pkg/crc/services" | ||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestGetApplicableHostnames(t *testing.T) { | ||
// Given | ||
bundleMetadata := services.ServicePostStartConfig{ | ||
BundleMetadata: bundle.CrcBundleInfo{ | ||
ClusterInfo: bundle.ClusterInfo{ | ||
OpenShiftVersion: semver.MustParse("4.6.1"), | ||
ClusterName: "crc", | ||
BaseDomain: "testing", | ||
AppsDomain: "apps.crc.testing", | ||
SSHPrivateKeyFile: "id_ecdsa_crc", | ||
KubeConfig: "kubeconfig", | ||
}, | ||
}, | ||
} | ||
// When | ||
hostnames := getApplicableHostnames(bundleMetadata) | ||
// Then | ||
assert.Equal(t, []string{ | ||
"api.crc.testing", | ||
"host.crc.testing", | ||
"oauth-openshift.apps.crc.testing", | ||
"console-openshift-console.apps.crc.testing", | ||
"downloads-openshift-console.apps.crc.testing", | ||
"canary-openshift-ingress-canary.apps.crc.testing", | ||
"default-route-openshift-image-registry.apps.crc.testing", | ||
}, hostnames) | ||
} |