This repository has been archived by the owner on Apr 8, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add logic to load ingress-config ConfigMap on startup
- Loading branch information
Showing
4 changed files
with
58 additions
and
4 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,29 @@ | ||
package controller | ||
|
||
import ( | ||
"fmt" | ||
"github.com/stretchr/testify/assert" | ||
"testing" | ||
) | ||
|
||
func TestMapToConfig(t *testing.T) { | ||
expectedExposer := "Ingress" | ||
expectedDomain := "35.233.48.48.nip.io" | ||
|
||
data := map[string]string{ | ||
"domain": expectedDomain, | ||
"exposer": expectedExposer, | ||
"tls": "false", | ||
} | ||
config, err := MapToConfig(data) | ||
if err != nil { | ||
t.Errorf("Failed to create Config %s\n", err) | ||
} else if config == nil { | ||
t.Error("No Config created!\n", err) | ||
} else { | ||
assert.Equal(t, expectedExposer, config.Exposer, "Exposer") | ||
assert.Equal(t, expectedDomain, config.Domain, "Domain") | ||
|
||
fmt.Printf("Config is %#v\n", config) | ||
} | ||
} |
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