File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 11using K8sOperator . NET . Builder ;
22using K8sOperator . NET . Metadata ;
3- using System . Reflection ;
43
54namespace K8sOperator . NET . Commands ;
65
@@ -9,7 +8,7 @@ internal class VersionCommand(IOperatorApplication app) : IOperatorCommand
98{
109 public Task RunAsync ( string [ ] args )
1110 {
12- Console . WriteLine ( $ "{ app . Name } version { Assembly . GetEntryAssembly ( ) ? . GetName ( ) . Version } ") ;
11+ Console . WriteLine ( $ "{ app . Name } version { app . Version } . ") ;
1312
1413 return Task . CompletedTask ;
1514 }
Original file line number Diff line number Diff line change @@ -17,6 +17,11 @@ public interface IOperatorApplication
1717 /// </summary>
1818 string Name { get ; }
1919
20+ /// <summary>
21+ /// The version number of the operator
22+ /// </summary>
23+ public string Version { get ; }
24+
2025 /// <summary>
2126 /// Gets the service provider that is used to resolve dependencies within the application.
2227 /// </summary>
@@ -96,6 +101,7 @@ string[] args
96101 public ILoggerFactory Logger { get ; }
97102
98103 public string Name => DataSource . Metadata . OfType < IOperatorNameMetadata > ( ) . First ( ) . OperatorName ;
104+ public string Version => DataSource . Metadata . OfType < IImageMetadata > ( ) . First ( ) . Tag ;
99105
100106 public async Task RunAsync ( )
101107 {
You can’t perform that action at this time.
0 commit comments