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 1
1
using K8sOperator . NET . Builder ;
2
2
using K8sOperator . NET . Metadata ;
3
- using System . Reflection ;
4
3
5
4
namespace K8sOperator . NET . Commands ;
6
5
@@ -9,7 +8,7 @@ internal class VersionCommand(IOperatorApplication app) : IOperatorCommand
9
8
{
10
9
public Task RunAsync ( string [ ] args )
11
10
{
12
- Console . WriteLine ( $ "{ app . Name } version { Assembly . GetEntryAssembly ( ) ? . GetName ( ) . Version } ") ;
11
+ Console . WriteLine ( $ "{ app . Name } version { app . Version } . ") ;
13
12
14
13
return Task . CompletedTask ;
15
14
}
Original file line number Diff line number Diff line change @@ -17,6 +17,11 @@ public interface IOperatorApplication
17
17
/// </summary>
18
18
string Name { get ; }
19
19
20
+ /// <summary>
21
+ /// The version number of the operator
22
+ /// </summary>
23
+ public string Version { get ; }
24
+
20
25
/// <summary>
21
26
/// Gets the service provider that is used to resolve dependencies within the application.
22
27
/// </summary>
@@ -96,6 +101,7 @@ string[] args
96
101
public ILoggerFactory Logger { get ; }
97
102
98
103
public string Name => DataSource . Metadata . OfType < IOperatorNameMetadata > ( ) . First ( ) . OperatorName ;
104
+ public string Version => DataSource . Metadata . OfType < IImageMetadata > ( ) . First ( ) . Tag ;
99
105
100
106
public async Task RunAsync ( )
101
107
{
You can’t perform that action at this time.
0 commit comments