Skip to content

Commit

Permalink
Allow to configure the command for the sync image (#1322)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andres Martinez Gotor authored Nov 27, 2019
1 parent d904fdf commit 7bab7f1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/apprepository-controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ func syncJobSpec(apprepo *apprepov1alpha1.AppRepository) batchv1.JobSpec {
}
podTemplateSpec.Spec.Containers[0].Name = "sync"
podTemplateSpec.Spec.Containers[0].Image = repoSyncImage
podTemplateSpec.Spec.Containers[0].Command = []string{"/chart-repo"}
podTemplateSpec.Spec.Containers[0].Command = []string{repoSyncCommand}
podTemplateSpec.Spec.Containers[0].Args = apprepoSyncJobArgs(apprepo)
podTemplateSpec.Spec.Containers[0].Env = append(podTemplateSpec.Spec.Containers[0].Env, apprepoSyncJobEnvVars(apprepo)...)
podTemplateSpec.Spec.Containers[0].VolumeMounts = append(podTemplateSpec.Spec.Containers[0].VolumeMounts, volumeMounts...)
Expand Down Expand Up @@ -496,7 +496,7 @@ func cleanupJobSpec(repoName string) batchv1.JobSpec {
{
Name: "delete",
Image: repoSyncImage,
Command: []string{"/chart-repo"},
Command: []string{repoSyncCommand},
Args: apprepoCleanupJobArgs(repoName),
Env: []corev1.EnvVar{
{
Expand Down
2 changes: 2 additions & 0 deletions cmd/apprepository-controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ var (
masterURL string
kubeconfig string
repoSyncImage string
repoSyncCommand string
namespace string
mongoURL string
mongoSecretName string
Expand Down Expand Up @@ -78,6 +79,7 @@ func init() {
flag.StringVar(&kubeconfig, "kubeconfig", "", "Path to a kubeconfig. Only required if out-of-cluster.")
flag.StringVar(&masterURL, "master", "", "The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster.")
flag.StringVar(&repoSyncImage, "repo-sync-image", "quay.io/helmpack/chart-repo:latest", "container repo/image to use in CronJobs")
flag.StringVar(&repoSyncCommand, "repo-sync-cmd", "/chart-repo", "command used to sync/delete repos for repo-sync-image")
flag.StringVar(&namespace, "namespace", "kubeapps", "Namespace to discover AppRepository resources")
flag.StringVar(&mongoURL, "mongo-url", "localhost", "MongoDB URL (see https://godoc.org/labix.org/v2/mgo#Dial for format)")
flag.StringVar(&mongoSecretName, "mongo-secret-name", "mongodb", "Kubernetes secret name for MongoDB credentials")
Expand Down

0 comments on commit 7bab7f1

Please sign in to comment.