@@ -12,16 +12,23 @@ pub fn extract_resource_specific_fields(
1212
1313 if let Some ( spec) = obj. get ( "spec" ) . and_then ( |s| s. as_object ( ) ) {
1414 match FluxResourceKind :: parse_optional ( resource_type) {
15- Some ( FluxResourceKind :: GitRepository )
16- | Some ( FluxResourceKind :: OCIRepository )
17- | Some ( FluxResourceKind :: HelmRepository ) => {
15+ Some ( FluxResourceKind :: GitRepository ) | Some ( FluxResourceKind :: HelmRepository ) => {
1816 if let Some ( url) = spec. get ( "url" ) . and_then ( |u| u. as_str ( ) ) {
1917 fields. insert ( "URL" . to_string ( ) , url. to_string ( ) ) ;
2018 }
2119 if let Some ( branch) = spec. get ( "branch" ) . and_then ( |b| b. as_str ( ) ) {
2220 fields. insert ( "BRANCH" . to_string ( ) , branch. to_string ( ) ) ;
2321 }
2422 }
23+ Some ( FluxResourceKind :: OCIRepository ) => {
24+ if let Some ( semver) = spec
25+ . get ( "ref" )
26+ . and_then ( |s| s. get ( "semver" ) )
27+ . and_then ( |se| se. as_str ( ) )
28+ {
29+ fields. insert ( "SEMVER" . to_string ( ) , semver. to_string ( ) ) ;
30+ }
31+ }
2532 Some ( FluxResourceKind :: Kustomization ) => {
2633 if let Some ( path) = spec. get ( "path" ) . and_then ( |p| p. as_str ( ) ) {
2734 fields. insert ( "PATH" . to_string ( ) , path. to_string ( ) ) ;
@@ -119,6 +126,23 @@ pub fn extract_resource_specific_fields(
119126 fields. insert ( "STATUS" . to_string ( ) , release_status. to_string ( ) ) ;
120127 }
121128 }
129+ if FluxResourceKind :: parse_optional ( resource_type) == Some ( FluxResourceKind :: OCIRepository )
130+ {
131+ if let Some ( digest) = status
132+ . get ( "artifact" )
133+ . and_then ( |a| a. get ( "digest" ) )
134+ . and_then ( |d| d. as_str ( ) )
135+ {
136+ fields. insert ( "DIGEST" . to_string ( ) , digest. to_string ( ) ) ;
137+ }
138+ if let Some ( revision) = status
139+ . get ( "artifact" )
140+ . and_then ( |a| a. get ( "revision" ) )
141+ . and_then ( |r| r. as_str ( ) )
142+ {
143+ fields. insert ( "REVISION" . to_string ( ) , revision. to_string ( ) ) ;
144+ }
145+ }
122146 }
123147
124148 fields
@@ -127,7 +151,7 @@ pub fn extract_resource_specific_fields(
127151/// Get column headers for a resource type
128152pub fn get_resource_type_columns ( resource_type : & str ) -> Vec < & ' static str > {
129153 match FluxResourceKind :: parse_optional ( resource_type) {
130- Some ( FluxResourceKind :: GitRepository ) | Some ( FluxResourceKind :: OCIRepository ) => vec ! [
154+ Some ( FluxResourceKind :: GitRepository ) => vec ! [
131155 "STATUS" ,
132156 "NAMESPACE" ,
133157 "NAME" ,
@@ -137,6 +161,16 @@ pub fn get_resource_type_columns(resource_type: &str) -> Vec<&'static str> {
137161 "SUSPENDED" ,
138162 "READY" ,
139163 ] ,
164+ Some ( FluxResourceKind :: OCIRepository ) => {
165+ vec ! [
166+ "STATUS" ,
167+ "NAMESPACE" ,
168+ "NAME" ,
169+ "SEMVER" ,
170+ "DIGEST" ,
171+ "REVISION" ,
172+ ]
173+ }
140174 Some ( FluxResourceKind :: HelmRepository ) => vec ! [
141175 "STATUS" ,
142176 "NAMESPACE" ,
0 commit comments