Skip to content

Commit

Permalink
Claiming namespace now sets default service account image pull secret.
Browse files Browse the repository at this point in the history
  • Loading branch information
stewartbutler committed Aug 17, 2022
1 parent a2a370e commit 96e3559
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/test/framework/components/namespace/kube.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,14 @@ func (n *kubeNamespace) createInCluster(c cluster.Cluster, cfg Config) error {
if err := c.ApplyYAMLFiles(n.name, s.Image.PullSecret); err != nil {
return err
}
_, err := c.Kube().CoreV1().ServiceAccounts(n.name).Patch(context.TODO(),
"default",
types.JSONPatchType,
[]byte(`[{"op": "add", "path": "/imagePullSecrets", "value": [{"name": "test-gcr-secret"}]}]`),
metav1.PatchOptions{})
if err != nil {
return err
}
}
return nil
}
Expand Down
10 changes: 10 additions & 0 deletions tests/integration/pilot/gateway_conformance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,16 @@ func TestGatewayConformance(t *testing.T) {
Run(func(ctx framework.TestContext) {
DeployGatewayAPICRD(ctx)

// Precreate the GatewayConformance namespaces, and apply the Image Pull Secret to them.
if ctx.Settings().Image.PullSecret != "" {
for _, ns := range conformanceNamespaces {
namespace.Claim(ctx, namespace.Config{
Prefix: ns,
Inject: false,
})
}
}

mapper, _ := gatewayConformanceInputs.Client.UtilFactory().ToRESTMapper()
c, err := client.New(gatewayConformanceInputs.Client.RESTConfig(), client.Options{
Scheme: kube.IstioScheme,
Expand Down

0 comments on commit 96e3559

Please sign in to comment.