Skip to content

Commit

Permalink
fix img pull pw
Browse files Browse the repository at this point in the history
  • Loading branch information
fanny-jiang committed Mar 26, 2024
1 parent ff9ce33 commit aa0f95a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
3 changes: 0 additions & 3 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ spec:
args:
- --enable-leader-election
- --pprof
- --webhookEnabled
image: controller:latest
imagePullPolicy: IfNotPresent
name: manager
Expand Down Expand Up @@ -58,7 +57,5 @@ spec:
path: /healthz/
port: 8081
periodSeconds: 10
imagePullSecrets:
- name: registry-credentials
terminationGracePeriodSeconds: 10
serviceAccountName: controller-manager
2 changes: 1 addition & 1 deletion test/e2e/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func operatorTransformationFunc() func(state map[string]interface{}, opts ...pul
if imageTag != "" && state["kind"] == "Deployment" && name == "datadog-operator-manager" {
template := state["spec"].(map[string]interface{})["template"]
templateSpec := template.(map[string]interface{})["spec"]
//templateSpec.(map[string]interface{})["imagePullSecrets"] = []map[string]interface{}{{"name": imagePullSecretName}}
templateSpec.(map[string]interface{})["imagePullSecrets"] = []map[string]interface{}{{"name": imagePullSecretName}}
containers := templateSpec.(map[string]interface{})["containers"]
container := containers.([]interface{})[0]
container.(map[string]interface{})["image"] = imageTag
Expand Down
16 changes: 8 additions & 8 deletions test/e2e/kind_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ func TestKindSuite(t *testing.T) {
if !ok {
k8sVersion = "1.26"
}

imgPullPassword, _ = os.LookupEnv("IMAGE_PULL_PASSWORD")

e2eParams := []e2e.SuiteOption{e2e.WithProvisioner(kindProvisioner(k8sVersion, ddaConfig, namespace)), e2e.WithDevMode(), e2e.WithSkipDeleteOnFailure()}
e2e.Run[kindEnv](t, &kindSuite{}, e2eParams...)
}
Expand Down Expand Up @@ -127,7 +130,7 @@ func kindProvisioner(k8sVersion string, ddaConfig string, namespace string) e2e.
Transformations: []yaml.Transformation{
ddaTransformationFunc(kindClusterName, awsEnv.CommonEnvironment.AgentAPIKey()),
},
}, pulumi.Provider(kindKubeProvider))
}, pulumi.Provider(kindKubeProvider), pulumi.DependsOn([]pulumi.Resource{defaultDir}))
if err != nil {
return err
}
Expand All @@ -154,16 +157,13 @@ func (suite *kindSuite) SetupSuite() {
// Setup kind E2E test suite with CI environment variables
var ok bool
imageTag, ok = os.LookupEnv("TARGET_IMAGE")
if ok {
suite.T().Logf("TARGET_IMAGE: %s", imageTag)
} else {
suite.T().Logf("Couldn't get TARGET_IMAGE env var.")
if !ok {
suite.T().Logf("Couldn't get TARGET_IMAGE env var. Using default image `gcr.io/datadoghq/operator:latest`.")
imageTag = "gcr.io/datadoghq/operator:latest"
}

imgPullPassword, ok = os.LookupEnv("IMAGE_PULL_PASSWORD")
if ok {
suite.T().Logf("Got IMAGE_PULL_PASSWORD env var.")
} else {
if !ok {
suite.T().Logf("Couldn't get IMAGE_PULL_PASSWORD env var.")
}

Expand Down

0 comments on commit aa0f95a

Please sign in to comment.