Skip to content

Commit

Permalink
sss
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Emms committed Apr 8, 2022
1 parent 423ab2d commit a3294b7
Show file tree
Hide file tree
Showing 28 changed files with 58 additions and 51 deletions.
2 changes: 1 addition & 1 deletion install/installer/pkg/components/agent-smith/daemonset.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func daemonset(ctx *common.RenderContext) ([]runtime.Object, error) {
TerminationGracePeriodSeconds: pointer.Int64(30),
Containers: []corev1.Container{{
Name: Component,
Image: common.ImageName(ctx.Config.Repository, Component, ctx.VersionManifest.Components.AgentSmith.Version),
Image: common.ImageName(ctx.Config.Repository, Component, ctx.VersionManifest.Components.AgentSmith.Version, &ctx.Config),
ImagePullPolicy: corev1.PullIfNotPresent,
Args: []string{"run", "--config", "/config/config.json"},
Resources: corev1.ResourceRequirements{
Expand Down
4 changes: 2 additions & 2 deletions install/installer/pkg/components/blobserve/configmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) {
Port: ContainerPort,
Timeout: util.Duration(time.Second * 5),
Repos: map[string]blobserve.Repo{
common.RepoName(ctx.Config.Repository, ide.CodeIDEImage): {
common.RepoName(ctx.Config.Repository, ide.CodeIDEImage, &ctx.Config): {
PrePull: []string{},
Workdir: "/ide",
Replacements: []blobserve.StringReplacement{{
Expand Down Expand Up @@ -88,7 +88,7 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) {
Replacement: "${supervisor}",
}},
},
common.RepoName(ctx.Config.Repository, workspace.SupervisorImage): {
common.RepoName(ctx.Config.Repository, workspace.SupervisorImage, &ctx.Config): {
PrePull: []string{},
Workdir: "/.supervisor/frontend",
},
Expand Down
2 changes: 1 addition & 1 deletion install/installer/pkg/components/blobserve/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func deployment(ctx *common.RenderContext) ([]runtime.Object, error) {
Containers: []corev1.Container{{
Name: Component,
Args: []string{"run", "/mnt/config/config.json"},
Image: common.ImageName(ctx.Config.Repository, Component, ctx.VersionManifest.Components.Blobserve.Version),
Image: common.ImageName(ctx.Config.Repository, Component, ctx.VersionManifest.Components.Blobserve.Version, &ctx.Config),
ImagePullPolicy: corev1.PullIfNotPresent,
Ports: []corev1.ContainerPort{{
Name: ServicePortName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func deployment(ctx *common.RenderContext) ([]runtime.Object, error) {
}},
Containers: []corev1.Container{{
Name: Component,
Image: common.ImageName(ctx.Config.Repository, Component, ctx.VersionManifest.Components.ContentService.Version),
Image: common.ImageName(ctx.Config.Repository, Component, ctx.VersionManifest.Components.ContentService.Version, &ctx.Config),
ImagePullPolicy: corev1.PullIfNotPresent,
Args: []string{
"run",
Expand Down
2 changes: 1 addition & 1 deletion install/installer/pkg/components/dashboard/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func deployment(ctx *common.RenderContext) ([]runtime.Object, error) {
TerminationGracePeriodSeconds: pointer.Int64(30),
Containers: []corev1.Container{{
Name: Component,
Image: common.ImageName(ctx.Config.Repository, Component, ctx.VersionManifest.Components.Dashboard.Version),
Image: common.ImageName(ctx.Config.Repository, Component, ctx.VersionManifest.Components.Dashboard.Version, &ctx.Config),
ImagePullPolicy: corev1.PullIfNotPresent,
Resources: corev1.ResourceRequirements{
Requests: corev1.ResourceList{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func deployment(ctx *common.RenderContext) ([]runtime.Object, error) {
Privileged: pointer.Bool(false),
RunAsNonRoot: pointer.Bool(false),
},
Image: common.ImageName(ImageRepo, ImageName, ImageVersion),
Image: common.ImageName(ImageRepo, ImageName, ImageVersion, &ctx.Config),
Command: []string{
"/cloud_sql_proxy",
"-dir=/cloudsql",
Expand Down
9 changes: 6 additions & 3 deletions install/installer/pkg/components/database/incluster/helm.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,15 @@ var Helm = common.CompositeHelmFunc(
helm.KeyValue("mysql.initdbScriptsConfigMap", SQLInitScripts),
helm.KeyValue("mysql.serviceAccount.name", Component),
helm.ImagePullSecrets("mysql.image.pullSecrets", cfg),
helm.KeyValue("mysql.image.registry", common.ThirdPartyContainerRepo(cfg.Config.Repository, common.DockerRegistryURL)),
helm.KeyValue("mysql.image.registry", ""),
helm.KeyValue("mysql.image.repository", common.RepoName(common.ThirdPartyContainerRepo(cfg.Config.Repository, common.DockerRegistryURL), "bitnami/mysql", &cfg.Config)),
helm.ImagePullSecrets("mysql.metrics.image.pullSecrets", cfg),
helm.KeyValue("mysql.metrics.image.registry", common.ThirdPartyContainerRepo(cfg.Config.Repository, common.DockerRegistryURL)),
helm.KeyValue("mysql.metrics.image.registry", ""),
helm.KeyValue("mysql.metrics.image.repository", common.RepoName(common.ThirdPartyContainerRepo(cfg.Config.Repository, common.DockerRegistryURL), "bitnami/mysqld-exporter", &cfg.Config)),
helm.ImagePullSecrets("mysql.volumePermissions.image.pullSecrets", cfg),
helm.KeyValue("mysql.volumePermissions.image.pullPolicy", "IfNotPresent"),
helm.KeyValue("mysql.volumePermissions.image.registry", common.ThirdPartyContainerRepo(cfg.Config.Repository, common.DockerRegistryURL)),
helm.KeyValue("mysql.volumePermissions.image.registry", ""),
helm.KeyValue("mysql.volumePermissions.image.repository", common.RepoName(common.ThirdPartyContainerRepo(cfg.Config.Repository, common.DockerRegistryURL), "bitnami/bitnami-shell", &cfg.Config)),

// improve start time
helm.KeyValue("mysql.primary.startupProbe.enabled", "false"),
Expand Down
2 changes: 1 addition & 1 deletion install/installer/pkg/components/database/init/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func job(ctx *common.RenderContext) ([]runtime.Object, error) {
InitContainers: []corev1.Container{*common.DatabaseWaiterContainer(ctx)},
Containers: []corev1.Container{{
Name: fmt.Sprintf("%s-session", Component),
Image: common.ImageName(common.ThirdPartyContainerRepo(ctx.Config.Repository, ""), dbSessionsImage, dbSessionsTag),
Image: common.ImageName(common.ThirdPartyContainerRepo(ctx.Config.Repository, ""), dbSessionsImage, dbSessionsTag, &ctx.Config),
ImagePullPolicy: corev1.PullIfNotPresent,
Env: common.MergeEnv(
common.DatabaseEnv(&ctx.Config),
Expand Down
2 changes: 1 addition & 1 deletion install/installer/pkg/components/docker-registry/helm.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var Helm = common.CompositeHelmFunc(
return nil, err
}

repository := fmt.Sprintf("%s/library/registry", common.ThirdPartyContainerRepo(cfg.Config.Repository, common.DockerRegistryURL))
repository := common.RepoName(common.ThirdPartyContainerRepo(cfg.Config.Repository, common.DockerRegistryURL), "library/registry", &cfg.Config)

registryValues := []string{
helm.KeyValue(fmt.Sprintf("docker-registry.podAnnotations.%s", strings.Replace(common.AnnotationConfigChecksum, ".", "\\.", -1)), secretHash),
Expand Down
2 changes: 1 addition & 1 deletion install/installer/pkg/components/gitpod/cronjob.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func cronjob(ctx *common.RenderContext) ([]runtime.Object, error) {
Containers: []v1.Container{
{
Name: installationTelemetryComponent,
Image: common.ImageName(ctx.Config.Repository, "installation-telemetry", ctx.VersionManifest.Components.InstallationTelemetry.Version),
Image: common.ImageName(ctx.Config.Repository, "installation-telemetry", ctx.VersionManifest.Components.InstallationTelemetry.Version, &ctx.Config),
ImagePullPolicy: v1.PullIfNotPresent,
Args: []string{
"send",
Expand Down
2 changes: 1 addition & 1 deletion install/installer/pkg/components/ide-proxy/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func deployment(ctx *common.RenderContext) ([]runtime.Object, error) {
TerminationGracePeriodSeconds: pointer.Int64(30),
Containers: []corev1.Container{{
Name: Component,
Image: common.ImageName(ctx.Config.Repository, Component, ctx.VersionManifest.Components.IDEProxy.Version),
Image: common.ImageName(ctx.Config.Repository, Component, ctx.VersionManifest.Components.IDEProxy.Version, &ctx.Config),
ImagePullPolicy: corev1.PullIfNotPresent,
Resources: corev1.ResourceRequirements{
Requests: corev1.ResourceList{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) {
PullSecret: secretName,
PullSecretFile: PullSecretFile,
BaseImageRepository: fmt.Sprintf("%s/base-images", registryName),
BuilderImage: common.ImageName(ctx.Config.Repository, BuilderImage, ctx.VersionManifest.Components.ImageBuilderMk3.BuilderImage.Version),
BuilderImage: common.ImageName(ctx.Config.Repository, BuilderImage, ctx.VersionManifest.Components.ImageBuilderMk3.BuilderImage.Version, &ctx.Config),
WorkspaceImageRepository: fmt.Sprintf("%s/workspace-images", registryName),
}

Expand All @@ -58,7 +58,7 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) {
RefCache: config.RefCacheConfig{
Interval: util.Duration(time.Hour * 6).String(),
Refs: []string{
common.ImageName(common.ThirdPartyContainerRepo(ctx.Config.Repository, ""), workspace.DefaultWorkspaceImage, workspace.DefaultWorkspaceImageVersion),
common.ImageName(common.ThirdPartyContainerRepo(ctx.Config.Repository, ""), workspace.DefaultWorkspaceImage, workspace.DefaultWorkspaceImageVersion, &ctx.Config),
},
},
Service: config.Service{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func deployment(ctx *common.RenderContext) ([]runtime.Object, error) {
},
Containers: []corev1.Container{{
Name: Component,
Image: common.ImageName(ctx.Config.Repository, Component, ctx.VersionManifest.Components.ImageBuilderMk3.Version),
Image: common.ImageName(ctx.Config.Repository, Component, ctx.VersionManifest.Components.ImageBuilderMk3.Version, &ctx.Config),
ImagePullPolicy: corev1.PullIfNotPresent,
Args: []string{
"run",
Expand Down
2 changes: 1 addition & 1 deletion install/installer/pkg/components/migrations/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func job(ctx *common.RenderContext) ([]runtime.Object, error) {
InitContainers: []corev1.Container{*common.DatabaseWaiterContainer(ctx)},
Containers: []corev1.Container{{
Name: Component,
Image: common.ImageName(ctx.Config.Repository, "db-migrations", ctx.VersionManifest.Components.DBMigrations.Version),
Image: common.ImageName(ctx.Config.Repository, "db-migrations", ctx.VersionManifest.Components.DBMigrations.Version, &ctx.Config),
ImagePullPolicy: corev1.PullIfNotPresent,
Env: common.MergeEnv(
common.DatabaseEnv(&ctx.Config),
Expand Down
6 changes: 4 additions & 2 deletions install/installer/pkg/components/minio/helm.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ var Helm = common.CompositeHelmFunc(
func(cfg *common.RenderContext) ([]string, error) {
commonHelmValues := []string{
helm.ImagePullSecrets("minio.image.pullSecrets", cfg),
helm.KeyValue("minio.image.registry", common.ThirdPartyContainerRepo(cfg.Config.Repository, common.DockerRegistryURL)),
helm.KeyValue("minio.image.registry", ""),
helm.KeyValue("minio.image.repository", common.RepoName(common.ThirdPartyContainerRepo(cfg.Config.Repository, common.DockerRegistryURL), "bitnami/minio", &cfg.Config)),
helm.ImagePullSecrets("minio.volumePermissions.image.pullSecrets", cfg),
helm.KeyValue("minio.volumePermissions.image.registry", common.ThirdPartyContainerRepo(cfg.Config.Repository, common.DockerRegistryURL)),
helm.KeyValue("minio.volumePermissions.image.registry", ""),
helm.KeyValue("minio.volumePermissions.image.repository", common.RepoName(common.ThirdPartyContainerRepo(cfg.Config.Repository, common.DockerRegistryURL), "bitnami/bitnami-shell", &cfg.Config)),
}

if pointer.BoolDeref(cfg.Config.ObjectStorage.InCluster, false) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func statefulset(ctx *common.RenderContext) ([]runtime.Object, error) {
}},
Containers: []v1.Container{{
Name: Component,
Image: common.ImageName(ctx.Config.Repository, Component, ctx.VersionManifest.Components.OpenVSXProxy.Version),
Image: common.ImageName(ctx.Config.Repository, Component, ctx.VersionManifest.Components.OpenVSXProxy.Version, &ctx.Config),
Args: []string{"/config/config.json"},
ReadinessProbe: &v1.Probe{
ProbeHandler: v1.ProbeHandler{
Expand Down
6 changes: 3 additions & 3 deletions install/installer/pkg/components/proxy/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func deployment(ctx *common.RenderContext) ([]runtime.Object, error) {
Volumes: volumes,
InitContainers: []corev1.Container{{
Name: "sysctl",
Image: common.ImageName(common.ThirdPartyContainerRepo(ctx.Config.Repository, common.DockerRegistryURL), InitContainerImage, InitContainerTag),
Image: common.ImageName(common.ThirdPartyContainerRepo(ctx.Config.Repository, common.DockerRegistryURL), InitContainerImage, InitContainerTag, &ctx.Config),
ImagePullPolicy: corev1.PullIfNotPresent,
SecurityContext: &corev1.SecurityContext{
Privileged: pointer.Bool(true),
Expand All @@ -143,7 +143,7 @@ func deployment(ctx *common.RenderContext) ([]runtime.Object, error) {
}},
Containers: []corev1.Container{{
Name: "kube-rbac-proxy",
Image: common.ImageName(common.ThirdPartyContainerRepo(ctx.Config.Repository, KubeRBACProxyRepo), KubeRBACProxyImage, KubeRBACProxyTag),
Image: common.ImageName(common.ThirdPartyContainerRepo(ctx.Config.Repository, KubeRBACProxyRepo), KubeRBACProxyImage, KubeRBACProxyTag, &ctx.Config),
ImagePullPolicy: corev1.PullIfNotPresent,
Args: []string{
"--v=10",
Expand Down Expand Up @@ -178,7 +178,7 @@ func deployment(ctx *common.RenderContext) ([]runtime.Object, error) {
},
}, {
Name: Component,
Image: common.ImageName(ctx.Config.Repository, Component, ctx.VersionManifest.Components.Proxy.Version),
Image: common.ImageName(ctx.Config.Repository, Component, ctx.VersionManifest.Components.Proxy.Version, &ctx.Config),
ImagePullPolicy: corev1.PullIfNotPresent,
Resources: corev1.ResourceRequirements{
Requests: corev1.ResourceList{
Expand Down
6 changes: 4 additions & 2 deletions install/installer/pkg/components/rabbitmq/helm.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,11 @@ var Helm = common.CompositeHelmFunc(
helm.KeyValue(fmt.Sprintf("rabbitmq.extraSecrets.%s.username", InClusterDbSecret), username),
helm.KeyValue(fmt.Sprintf("rabbitmq.extraSecrets.%s.password", InClusterDbSecret), password),
helm.ImagePullSecrets("rabbitmq.image.pullSecrets", cfg),
helm.KeyValue("rabbitmq.image.registry", common.ThirdPartyContainerRepo(cfg.Config.Repository, common.DockerRegistryURL)),
helm.KeyValue("rabbitmq.image.registry", ""),
helm.KeyValue("rabbitmq.image.repository", common.RepoName(common.ThirdPartyContainerRepo(cfg.Config.Repository, common.DockerRegistryURL), "bitnami/rabbitmq", &cfg.Config)),
helm.ImagePullSecrets("volumePermissions.image.pullSecrets", cfg),
helm.KeyValue("rabbitmq.volumePermissions.image.registry", common.ThirdPartyContainerRepo(cfg.Config.Repository, common.DockerRegistryURL)),
helm.KeyValue("rabbitmq.volumePermissions.image.registry", ""),
helm.KeyValue("rabbitmq.volumePermissions.image.repository", common.RepoName(common.ThirdPartyContainerRepo(cfg.Config.Repository, common.DockerRegistryURL), "bitnami/bitnami-shell", &cfg.Config)),

helm.KeyValue("rabbitmq.livenessProbe.initialDelaySeconds", "30"),
},
Expand Down
6 changes: 3 additions & 3 deletions install/installer/pkg/components/registry-facade/configmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,15 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) {
RequireAuth: false,
StaticLayer: []regfac.StaticLayerCfg{
{
Ref: common.ImageName(ctx.Config.Repository, SupervisorImage, ctx.VersionManifest.Components.Workspace.Supervisor.Version),
Ref: common.ImageName(ctx.Config.Repository, SupervisorImage, ctx.VersionManifest.Components.Workspace.Supervisor.Version, &ctx.Config),
Type: "image",
},
{
Ref: common.ImageName(ctx.Config.Repository, WorkspacekitImage, ctx.VersionManifest.Components.Workspace.Workspacekit.Version),
Ref: common.ImageName(ctx.Config.Repository, WorkspacekitImage, ctx.VersionManifest.Components.Workspace.Workspacekit.Version, &ctx.Config),
Type: "image",
},
{
Ref: common.ImageName(ctx.Config.Repository, DockerUpImage, ctx.VersionManifest.Components.Workspace.DockerUp.Version),
Ref: common.ImageName(ctx.Config.Repository, DockerUpImage, ctx.VersionManifest.Components.Workspace.DockerUp.Version, &ctx.Config),
Type: "image",
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ func daemonset(ctx *common.RenderContext) ([]runtime.Object, error) {
},
Containers: []corev1.Container{{
Name: Component,
Image: common.ImageName(ctx.Config.Repository, Component, ctx.VersionManifest.Components.RegistryFacade.Version),
Image: common.ImageName(ctx.Config.Repository, Component, ctx.VersionManifest.Components.RegistryFacade.Version, &ctx.Config),
ImagePullPolicy: corev1.PullIfNotPresent,
Args: []string{"run", "/mnt/config/config.json"},
Resources: corev1.ResourceRequirements{
Expand Down
2 changes: 1 addition & 1 deletion install/installer/pkg/components/server/configmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) {
TimeoutSeconds: 300,
},
WorkspaceDefaults: WorkspaceDefaults{
WorkspaceImage: common.ImageName(common.ThirdPartyContainerRepo(ctx.Config.Repository, ""), workspace.DefaultWorkspaceImage, workspace.DefaultWorkspaceImageVersion),
WorkspaceImage: common.ImageName(common.ThirdPartyContainerRepo(ctx.Config.Repository, ""), workspace.DefaultWorkspaceImage, workspace.DefaultWorkspaceImageVersion, &ctx.Config),
PreviewFeatureFlags: []NamedWorkspaceFeatureFlag{},
DefaultFeatureFlags: []NamedWorkspaceFeatureFlag{},
TimeoutDefault: ctx.Config.Workspace.TimeoutDefault,
Expand Down
2 changes: 1 addition & 1 deletion install/installer/pkg/components/server/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func deployment(ctx *common.RenderContext) ([]runtime.Object, error) {
InitContainers: []corev1.Container{*common.DatabaseWaiterContainer(ctx), *common.MessageBusWaiterContainer(ctx)},
Containers: []corev1.Container{{
Name: Component,
Image: common.ImageName(ctx.Config.Repository, Component, ctx.VersionManifest.Components.Server.Version),
Image: common.ImageName(ctx.Config.Repository, Component, ctx.VersionManifest.Components.Server.Version, &ctx.Config),
ImagePullPolicy: corev1.PullIfNotPresent,
Resources: corev1.ResourceRequirements{
Requests: corev1.ResourceList{
Expand Down
Loading

0 comments on commit a3294b7

Please sign in to comment.