File tree Expand file tree Collapse file tree 3 files changed +11
-24
lines changed
components/buildless-serverless/internal/controller/resources Expand file tree Collapse file tree 3 files changed +11
-24
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,6 @@ const (
2121 istioConfigLabelKey = "proxy.istio.io/config"
2222 istioEnableHoldUntilProxyStartLabelValue = "{ \" holdApplicationUntilProxyStarts\" : true }"
2323 istioNativeSidecarLabelKey = "sidecar.istio.io/nativeSidecar"
24- istioInjectSidecarLabelKey = "sidecar.istio.io/inject"
2524)
2625
2726type Deployment struct {
@@ -110,13 +109,11 @@ func (d *Deployment) currentAnnotationsWithoutPreviousFunctionAnnotations() map[
110109 return result
111110}
112111
112+ // allow istio to inject native sidecar (istio-proxy as init container)
113+ // this is required for init container of git sourced functions to fetch source from git repository
113114func (d * Deployment ) annotationsRequiredByIstio () map [string ]string {
114115 result := make (map [string ]string )
115-
116- if d .function .HasGitSources () && d .function .HasLabel (istioInjectSidecarLabelKey , "true" ) {
117- result [istioNativeSidecarLabelKey ] = "true"
118- }
119-
116+ result [istioNativeSidecarLabelKey ] = "true"
120117 return result
121118}
122119
Original file line number Diff line number Diff line change @@ -137,26 +137,16 @@ func TestDeployment_construct(t *testing.T) {
137137
138138 require .NotNil (t , r )
139139 require .Equal (t , map [string ]string {
140- "proxy.istio.io/config" : "{ \" holdApplicationUntilProxyStarts\" : true }" ,
141- "leavitt" : "hopeful" ,
142- "pike" : "tender" ,
143- "thompson" : "exciting" ,
140+ "proxy.istio.io/config" : "{ \" holdApplicationUntilProxyStarts\" : true }" ,
141+ "leavitt" : "hopeful" ,
142+ "pike" : "tender" ,
143+ "thompson" : "exciting" ,
144+ "sidecar.istio.io/nativeSidecar" : "true" ,
144145 }, r .Spec .Template .ObjectMeta .Annotations )
145146 })
146- t .Run ("enable native sidecar when istio is enabled and function has git repo " , func (t * testing.T ) {
147+ t .Run ("enable native sidecar" , func (t * testing.T ) {
147148 d := minimalDeployment ()
148149
149- d .function .Spec .Source = serverlessv1alpha2.Source {
150- GitRepository : & serverlessv1alpha2.GitRepositorySource {
151- URL : "wonderful-germain" ,
152- Repository : serverlessv1alpha2.Repository {
153- BaseDir : "recursing-mcnulty" ,
154- Reference : "epic-mendel" }}}
155-
156- d .function .Spec .Labels = map [string ]string {
157- "sidecar.istio.io/inject" : "true" ,
158- }
159-
160150 r := d .construct ()
161151
162152 require .NotNil (t , r )
Original file line number Diff line number Diff line change 11images :
2- - source : " alpine@sha256:8a1f59ffb675680d47db6337b49d22281a139e9d709335b492be023728e11715 "
3- tag : " 3.22.0 "
2+ - source : " alpine@sha256:4bcff63911fcb4448bd4fdacec207030997caf25e9bea4045fa6c8c44de311d1 "
3+ tag : " 3.22.1 "
44 - source : " python@sha256:c610e4a94a0e8b888b4b225bfc0e6b59dee607b1e61fb63ff3926083ff617216"
55 tag : " 3.12.11-alpine3.22"
66 - source : " golang@sha256:ddf52008bce1be455fe2b22d780b6693259aaf97b16383b6372f4b22dd33ad66"
You can’t perform that action at this time.
0 commit comments