File tree Expand file tree Collapse file tree
src/Microsoft.ComponentDetection.Detectors/kubernetes Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -149,27 +149,27 @@ private static bool LooksLikeKubernetesManifest(string contents)
149149 continue ;
150150 }
151151
152- var afterKind = trimmed . Slice ( 4 ) . TrimStart ( ) ;
152+ var afterKind = trimmed [ 4 .. ] . TrimStart ( ) ;
153153 if ( afterKind . IsEmpty || afterKind [ 0 ] != ':' )
154154 {
155155 continue ;
156156 }
157157
158- var value = afterKind . Slice ( 1 ) . Trim ( ) ;
158+ var value = afterKind [ 1 .. ] . Trim ( ) ;
159159
160160 // Strip inline YAML comments (K8s kind values never contain '#').
161161 var commentIdx = value . IndexOf ( '#' ) ;
162162 if ( commentIdx >= 0 )
163163 {
164- value = value . Slice ( 0 , commentIdx ) . TrimEnd ( ) ;
164+ value = value [ .. commentIdx ] . TrimEnd ( ) ;
165165 }
166166
167167 // Strip optional surrounding quotes (e.g. kind: "Deployment").
168168 if ( value . Length >= 2 &&
169169 ( ( value [ 0 ] == '"' && value [ ^ 1 ] == '"' ) ||
170170 ( value [ 0 ] == '\' ' && value [ ^ 1 ] == '\' ' ) ) )
171171 {
172- value = value . Slice ( 1 , value . Length - 2 ) . Trim ( ) ;
172+ value = value [ 1 .. ^ 1 ] . Trim ( ) ;
173173 }
174174
175175 if ( ! value . IsEmpty && KubernetesKinds . Contains ( value . ToString ( ) ) )
You can’t perform that action at this time.
0 commit comments