File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,7 @@ const Env = z.object({
7676 KUBERNETES_IMAGE_PULL_SECRETS : z . string ( ) . optional ( ) , // csv
7777 KUBERNETES_EPHEMERAL_STORAGE_SIZE_LIMIT : z . string ( ) . default ( "10Gi" ) ,
7878 KUBERNETES_EPHEMERAL_STORAGE_SIZE_REQUEST : z . string ( ) . default ( "2Gi" ) ,
79+ KUBERNETES_STRIP_IMAGE_DIGEST : BoolEnv . default ( false ) ,
7980
8081 // Placement tags settings
8182 PLACEMENT_TAGS_ENABLED : BoolEnv . default ( false ) ,
Original file line number Diff line number Diff line change @@ -49,6 +49,20 @@ export class KubernetesWorkloadManager implements WorkloadManager {
4949 } ;
5050 }
5151
52+ private stripImageDigest ( imageRef : string ) : string {
53+ if ( ! env . KUBERNETES_STRIP_IMAGE_DIGEST ) {
54+ return imageRef ;
55+ }
56+
57+ const atIndex = imageRef . lastIndexOf ( "@" ) ;
58+
59+ if ( atIndex === - 1 ) {
60+ return imageRef ;
61+ }
62+
63+ return imageRef . substring ( 0 , atIndex ) ;
64+ }
65+
5266 async create ( opts : WorkloadManagerCreateOptions ) {
5367 this . logger . log ( "[KubernetesWorkloadManager] Creating container" , { opts } ) ;
5468
@@ -74,7 +88,7 @@ export class KubernetesWorkloadManager implements WorkloadManager {
7488 containers : [
7589 {
7690 name : "run-controller" ,
77- image : opts . image ,
91+ image : this . stripImageDigest ( opts . image ) ,
7892 ports : [
7993 {
8094 containerPort : 8000 ,
You can’t perform that action at this time.
0 commit comments