Skip to content

Commit caa92e3

Browse files
authored
refactor: Split Operator in several packages (#605)
BREAKING CHANGE: This removes several features from the 7.x version. Required / missing features will be added to the v8 again. As for the first pre release, only the simple watcher and reconciliation loop is present. No finalizer, events, leadership, whatsoever is present in the library. The initial pre.0 release is meant to be the base for further implementations. V8 will - hopefully - contain all required features again. BREAKING CHANGE: The operator does not have commands and command line executions packaged into the library. A new dotnet tool is required for CRD generation and other generators. BREAKING CHANGE: All abstractions are extracted into a KubeOps.Abstractions package. BREAKING CHANGE: The operator is not required to have ASP.net as default, it works with a normal console host application as well. BREAKING CHANGE: `master` is renamed to `main` and maintenance and release branches are added.
1 parent 1602b1c commit caa92e3

File tree

346 files changed

+2628
-258
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

346 files changed

+2628
-258
lines changed

.config/dotnet-tools.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"version": 1,
3+
"isRoot": true,
4+
"tools": {
5+
"docfx": {
6+
"version": "2.70.4",
7+
"commands": [
8+
"docfx"
9+
]
10+
}
11+
}
12+
}

.editorconfig

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ root = true
33
# All files
44
[*]
55
indent_style = space
6+
max_line_length = 120
67

78
# Xml files
89
[*.xml]
@@ -19,7 +20,7 @@ tab_width = 4
1920

2021
# New line preferences
2122
end_of_line = crlf
22-
insert_final_newline = false
23+
insert_final_newline = true
2324

2425
#### Custom Analyzer Rules ####
2526

@@ -45,6 +46,16 @@ dotnet_diagnostic.SA1649.severity = none
4546
dotnet_diagnostic.RCS1029.severity = none
4647
dotnet_diagnostic.RCS1090.severity = none
4748

49+
#### Custom Coding Conventions ####
50+
resharper_csharp_space_in_singleline_accessorholder = true
51+
resharper_csharp_space_between_accessors_in_singleline_property = true
52+
resharper_csharp_space_in_singleline_method = true
53+
resharper_csharp_space_in_singleline_anonymous_method = true
54+
resharper_csharp_space_within_single_line_array_initializer_braces = true
55+
resharper_csharp_trailing_comma_in_multiline_lists = true
56+
resharper_csharp_place_type_attribute_on_same_line = false
57+
resharper_csharp_place_attribute_on_same_line = false
58+
4859
#### .NET Coding Conventions ####
4960
[*.{cs,vb}]
5061

.github/workflows/dotnet-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ name: .NET Release
33
on:
44
push:
55
branches:
6-
- master
7-
- next
6+
- main
7+
- release
88

99
jobs:
1010
semantic-release:

.github/workflows/dotnet-test.yml

Lines changed: 6 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,14 @@ on:
55
branches:
66
- "**"
77

8+
concurrency:
9+
group: testing
10+
cancel-in-progress: true
11+
812
jobs:
913
test:
10-
name: Execute Test ${{ matrix.project }}
14+
name: Testing
1115
runs-on: ubuntu-latest
12-
strategy:
13-
fail-fast: true
14-
matrix:
15-
include:
16-
- project: KubeOps.KubernetesClient.Test
17-
kubernetes: true
18-
- project: KubeOps.Test
19-
kubernetes: false
20-
- project: KubeOps.Templates.Test
21-
kubernetes: false
22-
- project: KubeOps.TestOperator.Test
23-
kubernetes: false
2416
steps:
2517
- uses: actions/checkout@v3
2618

@@ -31,21 +23,6 @@ jobs:
3123

3224
- name: Create Kubernetes Cluster
3325
uses: helm/[email protected]
34-
if: ${{ matrix.kubernetes == true }}
3526

3627
- name: Execute Tests
37-
run: dotnet test --configuration Release tests/${{ matrix.project }}
38-
39-
result:
40-
if: ${{ always() }}
41-
runs-on: ubuntu-latest
42-
name: Final Results
43-
needs: [test]
44-
steps:
45-
- run: |
46-
result="${{ needs.test.result }}"
47-
if [[ $result == "success" || $result == "skipped" ]]; then
48-
exit 0
49-
else
50-
exit 1
51-
fi
28+
run: dotnet test --configuration Release

.github/workflows/gh-pages.yml

Lines changed: 7 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Deploy GitHub Pages
33
on:
44
push:
55
branches:
6-
- master
6+
- main
77

88
workflow_dispatch:
99

@@ -21,55 +21,18 @@ jobs:
2121
runs-on: ubuntu-latest
2222
steps:
2323
- uses: actions/checkout@v3
24-
with:
25-
fetch-depth: 1
26-
27-
- run: mkdir public
28-
29-
- name: Build Index
30-
uses: jaywcjlove/markdown-to-html-cli@main
31-
with:
32-
source: res/docs_index.md
33-
output: public/index.html
34-
github-corners: https://github.com/buehler/dotnet-operator-sdk
35-
36-
- name: Build Contribution
37-
uses: jaywcjlove/markdown-to-html-cli@main
38-
with:
39-
source: CONTRIBUTING.md
40-
output: public/contribution.html
41-
github-corners: https://github.com/buehler/dotnet-operator-sdk
4224

43-
- name: Build KubeOps
44-
uses: jaywcjlove/markdown-to-html-cli@main
25+
- name: Setup .NET
26+
uses: actions/setup-dotnet@v3
4527
with:
46-
source: src/KubeOps/README.md
47-
output: public/kubeops.html
48-
github-corners: https://github.com/buehler/dotnet-operator-sdk/tree/master/src/KubeOps
28+
dotnet-version: 7.x
4929

50-
- name: Build KubeOps.KubernetesClient
51-
uses: jaywcjlove/markdown-to-html-cli@main
52-
with:
53-
source: src/KubeOps.KubernetesClient/README.md
54-
output: public/kubeops-kubernetesclient.html
55-
github-corners: https://github.com/buehler/dotnet-operator-sdk/tree/master/src/KubeOps.KubernetesClient
30+
- run: dotnet tool restore
5631

57-
- name: Build KubeOps.Templates
58-
uses: jaywcjlove/markdown-to-html-cli@main
59-
with:
60-
source: src/KubeOps.Templates/README.md
61-
output: public/kubeops-templates.html
62-
github-corners: https://github.com/buehler/dotnet-operator-sdk/tree/master/src/KubeOps.Templates
63-
64-
- name: Build KubeOps.Testing
65-
uses: jaywcjlove/markdown-to-html-cli@main
66-
with:
67-
source: src/KubeOps.Testing/README.md
68-
output: public/kubeops-testing.html
69-
github-corners: https://github.com/buehler/dotnet-operator-sdk/tree/master/src/KubeOps.Testing
32+
- run: dotnet docfx
7033

7134
- uses: actions/upload-pages-artifact@v1
7235
with:
73-
path: public
36+
path: _site
7437

7538
- uses: actions/deploy-pages@v1

.github/workflows/security-analysis.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@ name: Code Security Testing
33
on:
44
pull_request:
55
branches:
6-
- master
6+
- main
77
schedule:
88
- cron: "0 20 * * 5"
99

10+
concurrency:
11+
group: security
12+
cancel-in-progress: true
13+
1014
jobs:
1115
codeQL:
1216
name: Analyze

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,6 @@ bld/
3030
coverage.json
3131
coverage.info
3232
.vs
33+
34+
# Docs
35+
_site

.releaserc.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
{
22
"debug": true,
33
"branches": [
4-
"master",
54
{
6-
"name": "next",
7-
"prerelease": "prerelease"
8-
}
5+
"name": "maintenance/7.x",
6+
"range": "7.x"
7+
},
8+
{
9+
"name": "main",
10+
"prerelease": "pre"
11+
},
12+
"release"
913
],
1014
"plugins": [
1115
"@semantic-release/commit-analyzer",

Directory.Build.props

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<Project>
2+
<PropertyGroup>
3+
<ImplicitUsings>enable</ImplicitUsings>
4+
<Nullable>enable</Nullable>
5+
<LangVersion>11</LangVersion>
6+
<Authors>Christoph Bühler</Authors>
7+
<Owner>cbuehler</Owner>
8+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
9+
</PropertyGroup>
10+
11+
<PropertyGroup>
12+
<PackageProjectUrl>https://github.com/buehler/dotnet-operator-sdk.git</PackageProjectUrl>
13+
<RepositoryUrl>https://github.com/buehler/dotnet-operator-sdk.git</RepositoryUrl>
14+
<RepositoryType>git</RepositoryType>
15+
<PackageLicense>Apache-2.0</PackageLicense>
16+
<PackageIcon>icon.png</PackageIcon>
17+
<PackageReadmeFile>README.md</PackageReadmeFile>
18+
<PackageLicenseFile>LICENSE</PackageLicenseFile>
19+
</PropertyGroup>
20+
21+
<PropertyGroup>
22+
<TreatWarningsAsErrors Condition="'$(Configuration)' == 'Release'">true</TreatWarningsAsErrors>
23+
</PropertyGroup>
24+
25+
<ItemGroup>
26+
<None Include="README.md" Pack="true" PackagePath="\"/>
27+
<None Include="$(MSBuildThisFileDirectory)\LICENSE" Pack="true" PackagePath="\"/>
28+
<None Include="$(MSBuildThisFileDirectory)\res\icon.png">
29+
<Pack>true</Pack>
30+
<PackagePath>\</PackagePath>
31+
<Visible>false</Visible>
32+
</None>
33+
</ItemGroup>
34+
35+
<ItemGroup>
36+
<PackageReference
37+
Include="StyleCop.Analyzers"
38+
Version="1.2.0-beta.507"
39+
PrivateAssets="all"
40+
Condition="$(MSBuildProjectExtension) == '.csproj'"/>
41+
<PackageReference
42+
Include="SonarAnalyzer.CSharp"
43+
Version="9.10.0.77988"
44+
PrivateAssets="all"
45+
Condition="$(MSBuildProjectExtension) == '.csproj'"/>
46+
<PackageReference Include="Roslynator.Analyzers" Version="4.5.0" PrivateAssets="All"/>
47+
</ItemGroup>
48+
49+
<ItemGroup>
50+
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
51+
<_Parameter1>$(MSBuildProjectName).Test</_Parameter1>
52+
</AssemblyAttribute>
53+
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
54+
<!--So that internals are visible to the Moq library-->
55+
<_Parameter1>DynamicProxyGenAssembly2</_Parameter1>
56+
</AssemblyAttribute>
57+
</ItemGroup>
58+
</Project>

DotnetOperatorSdk.sln

Lines changed: 0 additions & 104 deletions
This file was deleted.

0 commit comments

Comments
 (0)