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({
76
76
KUBERNETES_IMAGE_PULL_SECRETS : z . string ( ) . optional ( ) , // csv
77
77
KUBERNETES_EPHEMERAL_STORAGE_SIZE_LIMIT : z . string ( ) . default ( "10Gi" ) ,
78
78
KUBERNETES_EPHEMERAL_STORAGE_SIZE_REQUEST : z . string ( ) . default ( "2Gi" ) ,
79
+ KUBERNETES_STRIP_IMAGE_DIGEST : BoolEnv . default ( false ) ,
79
80
80
81
// Placement tags settings
81
82
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 {
49
49
} ;
50
50
}
51
51
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
+
52
66
async create ( opts : WorkloadManagerCreateOptions ) {
53
67
this . logger . log ( "[KubernetesWorkloadManager] Creating container" , { opts } ) ;
54
68
@@ -74,7 +88,7 @@ export class KubernetesWorkloadManager implements WorkloadManager {
74
88
containers : [
75
89
{
76
90
name : "run-controller" ,
77
- image : opts . image ,
91
+ image : this . stripImageDigest ( opts . image ) ,
78
92
ports : [
79
93
{
80
94
containerPort : 8000 ,
You can’t perform that action at this time.
0 commit comments