@@ -64,6 +64,18 @@ func TestLoadYamlConfig(t *testing.T) {
64
64
t .Errorf ("expected https://oidc.eks.fantasy-land.amazonaws.com/id/CLUSTERIDENTIFIER, got %s" , got .IssuerURL )
65
65
}
66
66
67
+ // Checking that the ci provider meta issuer has been set correctly
68
+ got , ok = cfg .GetIssuer ("https://oidc.foo.foobar.bar.com/id/CLUSTERIDENTIFIER" )
69
+ if ! ok {
70
+ t .Error ("expected true, got false" )
71
+ }
72
+ if got .Type != "ci-provider" {
73
+ t .Errorf ("expected ci-provider, got %s" , got .Type )
74
+ }
75
+ if got .CIProvider != "github-workflow" {
76
+ t .Errorf ("expected github-workflow, got %s" , got .CIProvider )
77
+ }
78
+
67
79
if _ , ok := cfg .GetIssuer ("not_an_issuer" ); ok {
68
80
t .Error ("no error returned from an unconfigured issuer" )
69
81
}
@@ -105,6 +117,18 @@ func TestLoadJsonConfig(t *testing.T) {
105
117
t .Errorf ("expected https://oidc.eks.fantasy-land.amazonaws.com/id/CLUSTERIDENTIFIER, got %s" , got .IssuerURL )
106
118
}
107
119
120
+ // Checking that the ci provider meta issuer has been set correctly
121
+ got , ok = cfg .GetIssuer ("https://oidc.foo.foobar.bar.com/id/CLUSTERIDENTIFIER" )
122
+ if ! ok {
123
+ t .Error ("expected true, got false" )
124
+ }
125
+ if got .Type != "ci-provider" {
126
+ t .Errorf ("expected ci-provider, got %s" , got .Type )
127
+ }
128
+ if got .CIProvider != "github-workflow" {
129
+ t .Errorf ("expected github-workflow, got %s" , got .CIProvider )
130
+ }
131
+
108
132
if _ , ok := cfg .GetIssuer ("not_an_issuer" ); ok {
109
133
t .Error ("no error returned from an unconfigured issuer" )
110
134
}
0 commit comments