@@ -111,44 +111,35 @@ func (s *ImageSpecStage) PrepareImage(ctx context.Context, _ Conveyor, _ contain
111
111
return nil
112
112
}
113
113
114
- const imageSpecStageCacheVersion = "2"
115
114
116
115
func (s * ImageSpecStage ) GetDependencies (_ context.Context , _ Conveyor , _ container_backend.ContainerBackend , _ , _ * StageImage , _ container_backend.BuildContextArchiver ) (string , error ) {
117
116
var args []string
118
117
119
- args = append ( args , imageSpecStageCacheVersion )
118
+ // imageSpec
120
119
args = append (args , s .imageSpec .Author )
121
120
args = append (args , fmt .Sprint (s .imageSpec .ClearHistory ))
122
121
123
- args = append (args , fmt .Sprint (s .imageSpec .ClearWerfLabels ))
124
- args = append (args , sortSliceWithNewSlice (s .imageSpec .RemoveLabels )... )
125
- args = append (args , sortSliceWithNewSlice (s .imageSpec .RemoveVolumes )... )
126
- args = append (args , sortSliceWithNewSlice (s .imageSpec .RemoveEnv )... )
127
-
128
- args = append (args , sortSliceWithNewSlice (s .imageSpec .Volumes )... )
129
- args = append (args , mapToSortedArgs (s .imageSpec .Labels )... )
122
+ // imageSpec.config
123
+ args = append (args , strings .Join (s .imageSpec .Cmd , " " ))
124
+ args = append (args , strings .Join (s .imageSpec .Entrypoint , " " ))
130
125
args = append (args , mapToSortedArgs (s .imageSpec .Env )... )
131
126
args = append (args , sortSliceWithNewSlice (s .imageSpec .Expose )... )
127
+ args = append (args , fmt .Sprint (s .imageSpec .Healthcheck ))
128
+ args = append (args , mapToSortedArgs (s .imageSpec .Labels )... )
129
+ args = append (args , s .imageSpec .StopSignal )
132
130
args = append (args , s .imageSpec .User )
133
- args = append (args , strings .Join (s .imageSpec .Cmd , " " ))
134
- args = append (args , fmt .Sprint (s .imageSpec .ClearCmd ))
135
- args = append (args , strings .Join (s .imageSpec .Entrypoint , " " ))
136
- args = append (args , fmt .Sprint (s .imageSpec .ClearEntrypoint ))
131
+ args = append (args , sortSliceWithNewSlice (s .imageSpec .Volumes )... )
137
132
args = append (args , s .imageSpec .WorkingDir )
138
- args = append (args , s .imageSpec .StopSignal )
139
- args = append (args , fmt .Sprint (s .imageSpec .Healthcheck ))
140
133
141
- if s .imageSpec .ClearUser {
142
- args = append (args , fmt .Sprint (s .imageSpec .ClearUser ))
143
- }
144
-
145
- if s .imageSpec .ClearWorkingDir {
146
- args = append (args , fmt .Sprint (s .imageSpec .ClearWorkingDir ))
147
- }
134
+ args = append (args , sortSliceWithNewSlice (s .imageSpec .RemoveLabels )... )
135
+ args = append (args , sortSliceWithNewSlice (s .imageSpec .RemoveVolumes )... )
136
+ args = append (args , sortSliceWithNewSlice (s .imageSpec .RemoveEnv )... )
137
+ args = append (args , fmt .Sprint (s .imageSpec .KeepEssentialWerfLabels ))
148
138
149
- if s .imageSpec .KeepEssentialWerfLabels {
150
- args = append (args , fmt .Sprint (s .imageSpec .KeepEssentialWerfLabels ))
151
- }
139
+ args = append (args , fmt .Sprint (s .imageSpec .ClearCmd ))
140
+ args = append (args , fmt .Sprint (s .imageSpec .ClearEntrypoint ))
141
+ args = append (args , fmt .Sprint (s .imageSpec .ClearUser ))
142
+ args = append (args , fmt .Sprint (s .imageSpec .ClearWorkingDir ))
152
143
153
144
return util .Sha256Hash (args ... ), nil
154
145
}
0 commit comments