File tree Expand file tree Collapse file tree 5 files changed +15
-14
lines changed
src/KubeOps/Operator/Commands/Generators Expand file tree Collapse file tree 5 files changed +15
-14
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ public async Task<int> OnExecuteAsync(CommandLineApplication app)
58
58
} ,
59
59
} , Format ) ) ;
60
60
await using var kustomizationFile =
61
- File . OpenWrite ( Path . Join ( OutputPath , $ "kustomization.{ Format . ToString ( ) . ToLower ( ) } ") ) ;
61
+ File . Open ( Path . Join ( OutputPath , $ "kustomization.{ Format . ToString ( ) . ToLower ( ) } ") , FileMode . Create ) ;
62
62
await kustomizationFile . WriteAsync ( kustomizeOutput ) ;
63
63
}
64
64
@@ -70,8 +70,8 @@ public async Task<int> OnExecuteAsync(CommandLineApplication app)
70
70
71
71
if ( ! string . IsNullOrWhiteSpace ( OutputPath ) )
72
72
{
73
- await using var file = File . OpenWrite ( Path . Join ( OutputPath ,
74
- $ "{ crd . Metadata . Name . Replace ( '.' , '_' ) } .{ Format . ToString ( ) . ToLower ( ) } ") ) ;
73
+ await using var file = File . Open ( Path . Join ( OutputPath ,
74
+ $ "{ crd . Metadata . Name . Replace ( '.' , '_' ) } .{ Format . ToString ( ) . ToLower ( ) } ") , FileMode . Create ) ;
75
75
await file . WriteAsync ( Encoding . UTF8 . GetBytes ( output ) ) ;
76
76
}
77
77
else
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ public async Task<int> OnExecuteAsync(CommandLineApplication app)
29
29
var dockerfile = GenerateDockerfile ( ) ;
30
30
if ( ! string . IsNullOrWhiteSpace ( OutputPath ) )
31
31
{
32
- await using var file = File . OpenWrite ( OutputPath ) ;
32
+ await using var file = File . Open ( OutputPath , FileMode . Create ) ;
33
33
await file . WriteAsync ( Encoding . UTF8 . GetBytes ( dockerfile ) ) ;
34
34
}
35
35
else
Original file line number Diff line number Diff line change @@ -71,11 +71,11 @@ public async Task<int> OnExecuteAsync(CommandLineApplication app)
71
71
if ( ! string . IsNullOrWhiteSpace ( OutputPath ) )
72
72
{
73
73
Directory . CreateDirectory ( OutputPath ) ;
74
- await using var nsFile = File . OpenWrite ( Path . Join ( OutputPath ,
75
- $ "namespace.{ Format . ToString ( ) . ToLower ( ) } ") ) ;
74
+ await using var nsFile = File . Open ( Path . Join ( OutputPath ,
75
+ $ "namespace.{ Format . ToString ( ) . ToLower ( ) } ") , FileMode . Create ) ;
76
76
await nsFile . WriteAsync ( Encoding . UTF8 . GetBytes ( ns ) ) ;
77
- await using var kustomizeFile = File . OpenWrite ( Path . Join ( OutputPath ,
78
- $ "kustomization.{ Format . ToString ( ) . ToLower ( ) } ") ) ;
77
+ await using var kustomizeFile = File . Open ( Path . Join ( OutputPath ,
78
+ $ "kustomization.{ Format . ToString ( ) . ToLower ( ) } ") , FileMode . Create ) ;
79
79
await kustomizeFile . WriteAsync ( Encoding . UTF8 . GetBytes ( kustomize ) ) ;
80
80
}
81
81
else
Original file line number Diff line number Diff line change @@ -62,8 +62,9 @@ public async Task<int> OnExecuteAsync(CommandLineApplication app)
62
62
if ( ! string . IsNullOrWhiteSpace ( OutputPath ) )
63
63
{
64
64
Directory . CreateDirectory ( OutputPath ) ;
65
- await using var file = File . OpenWrite ( Path . Join ( OutputPath ,
66
- $ "deployment.{ Format . ToString ( ) . ToLower ( ) } ") ) ;
65
+ await using var file = File . Open ( Path . Join ( OutputPath ,
66
+ $ "deployment.{ Format . ToString ( ) . ToLower ( ) } ") , FileMode . Create ) ;
67
+
67
68
await file . WriteAsync ( Encoding . UTF8 . GetBytes ( output ) ) ;
68
69
69
70
var kustomize = new KustomizationConfig
@@ -76,7 +77,7 @@ public async Task<int> OnExecuteAsync(CommandLineApplication app)
76
77
} ;
77
78
var kustomizeOutput = Encoding . UTF8 . GetBytes ( _serializer . Serialize ( kustomize , Format ) ) ;
78
79
await using var kustomizationFile =
79
- File . OpenWrite ( Path . Join ( OutputPath , $ "kustomization.{ Format . ToString ( ) . ToLower ( ) } ") ) ;
80
+ File . Open ( Path . Join ( OutputPath , $ "kustomization.{ Format . ToString ( ) . ToLower ( ) } ") , FileMode . Create ) ;
80
81
await kustomizationFile . WriteAsync ( kustomizeOutput ) ;
81
82
}
82
83
else
Original file line number Diff line number Diff line change @@ -30,8 +30,8 @@ public async Task<int> OnExecuteAsync(CommandLineApplication app)
30
30
if ( ! string . IsNullOrWhiteSpace ( OutputPath ) )
31
31
{
32
32
Directory . CreateDirectory ( OutputPath ) ;
33
- await using var file = File . OpenWrite ( Path . Join ( OutputPath ,
34
- $ "operator.{ Format . ToString ( ) . ToLower ( ) } ") ) ;
33
+ await using var file = File . Open ( Path . Join ( OutputPath ,
34
+ $ "operator.{ Format . ToString ( ) . ToLower ( ) } ") , FileMode . Create ) ;
35
35
await file . WriteAsync ( Encoding . UTF8 . GetBytes ( output ) ) ;
36
36
37
37
var kustomize = new KustomizationConfig
@@ -44,7 +44,7 @@ public async Task<int> OnExecuteAsync(CommandLineApplication app)
44
44
} ;
45
45
var kustomizeOutput = Encoding . UTF8 . GetBytes ( _serializer . Serialize ( kustomize , Format ) ) ;
46
46
await using var kustomizationFile =
47
- File . OpenWrite ( Path . Join ( OutputPath , $ "kustomization.{ Format . ToString ( ) . ToLower ( ) } ") ) ;
47
+ File . Open ( Path . Join ( OutputPath , $ "kustomization.{ Format . ToString ( ) . ToLower ( ) } ") , FileMode . Create ) ;
48
48
await kustomizationFile . WriteAsync ( kustomizeOutput ) ;
49
49
}
50
50
else
You can’t perform that action at this time.
0 commit comments