From e14c5a10f25fc94af518f4f6df0b0127a5f9f0b9 Mon Sep 17 00:00:00 2001 From: Patrick Evers Date: Wed, 26 Mar 2025 13:11:09 +0100 Subject: [PATCH 1/3] Update Getting Started --- README.md | 64 +++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 58 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 18306a0..0960bb3 100644 --- a/README.md +++ b/README.md @@ -31,12 +31,14 @@ To install the package, use the following command in your .NET Core project: ```bash dotnet add package K8sOperator.NET +dotnet add package K8sOperator.NET.Generators ``` Alternatively, you can add it manually to your `.csproj` file: ```xml + ``` ## Usage @@ -48,22 +50,72 @@ Here are some basic examples of how to use the library: ```csharp using K8sOperator.NET; -var builder = WebApplication.CreateBuilder(args); +var builder = OperatorHost.CreateOperatorApplicationBuilder(args); +builder.AddController() + .WithFinalizer("project.local.finalizer"); -``` +var app = builder.Build(); -### Use +app.AddInstall(); -```csharp +await app.RunAsync(); + +``` -var test = new string(); +### add custom launchSettings.json + +```json + +{ + "profiles": { + "Operator": { + "commandName": "Project", + "commandLineArgs": "operator", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "dotnetRunMessages": true + }, + "Install": { + "commandName": "Project", + "commandLineArgs": "install > ./install.yaml", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "dotnetRunMessages": true + }, + "Help": { + "commandName": "Project", + "commandLineArgs": "", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "dotnetRunMessages": true + }, + "Version": { + "commandName": "Project", + "commandLineArgs": "version", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "dotnetRunMessages": true + } + }, + "$schema": "http://json.schemastore.org/launchsettings.json" +} ``` ## Configuration -[TODO] +By running the `Install` profile will create the install.yaml file in the root of the project. This file can be used to install the operator in a Kubernetes cluster. + +Run the following command to install the operator: +```bash +kubectl apply -f install.yaml +``` + ## Contributing From 0740bfa5b4f854d9ed4e3419b105a9e304ce332b Mon Sep 17 00:00:00 2001 From: Patrick Evers Date: Wed, 26 Mar 2025 13:41:41 +0100 Subject: [PATCH 2/3] Update Packages --- README.md | 2 +- src/Directory.Packages.props | 8 ++++---- test/Directory.Build.props | 4 ++-- test/Directory.Packages.props | 16 ++++++++-------- .../K8sOperator.NET.Generators.Tests.csproj | 11 ++++++++++- test/K8sOperator.NET.Tests/ControllerTests.cs | 4 +++- .../K8sOperator.NET.Tests.csproj | 10 ++++++++++ 7 files changed, 38 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 0960bb3..23a6cae 100644 --- a/README.md +++ b/README.md @@ -129,4 +129,4 @@ Contributions are welcome! Please feel free to submit a pull request or open an ## License -This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. +This project is licensed under the MIT License - see the [LICENSE](LICENSE.md) file for details. diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index 65718ae..4bbab19 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -4,14 +4,14 @@ true - - + + - + - + \ No newline at end of file diff --git a/test/Directory.Build.props b/test/Directory.Build.props index 9c3e040..566dc3c 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -12,7 +12,7 @@ - + @@ -25,7 +25,7 @@ - + diff --git a/test/Directory.Packages.props b/test/Directory.Packages.props index 5f46d59..6fca3d4 100644 --- a/test/Directory.Packages.props +++ b/test/Directory.Packages.props @@ -4,16 +4,16 @@ true - - - - + + + + - - + + - - + + \ No newline at end of file diff --git a/test/K8sOperator.NET.Generators.Tests/K8sOperator.NET.Generators.Tests.csproj b/test/K8sOperator.NET.Generators.Tests/K8sOperator.NET.Generators.Tests.csproj index c632161..31f38bb 100644 --- a/test/K8sOperator.NET.Generators.Tests/K8sOperator.NET.Generators.Tests.csproj +++ b/test/K8sOperator.NET.Generators.Tests/K8sOperator.NET.Generators.Tests.csproj @@ -1,3 +1,12 @@  - + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + diff --git a/test/K8sOperator.NET.Tests/ControllerTests.cs b/test/K8sOperator.NET.Tests/ControllerTests.cs index e37dc09..5b7dbee 100644 --- a/test/K8sOperator.NET.Tests/ControllerTests.cs +++ b/test/K8sOperator.NET.Tests/ControllerTests.cs @@ -1,4 +1,6 @@ -namespace K8sOperator.NET.Tests; +using FluentAssertions; + +namespace K8sOperator.NET.Tests; public class ControllerTests { diff --git a/test/K8sOperator.NET.Tests/K8sOperator.NET.Tests.csproj b/test/K8sOperator.NET.Tests/K8sOperator.NET.Tests.csproj index 240c2ba..986073d 100644 --- a/test/K8sOperator.NET.Tests/K8sOperator.NET.Tests.csproj +++ b/test/K8sOperator.NET.Tests/K8sOperator.NET.Tests.csproj @@ -6,4 +6,14 @@ + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + From d17044f5390876ebf4f0279f56636f717ca123c2 Mon Sep 17 00:00:00 2001 From: Patrick Evers Date: Wed, 2 Apr 2025 13:16:23 +0200 Subject: [PATCH 3/3] AwsomeAssertions Usses FluentAssertions Namespace --- test/Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Directory.Build.props b/test/Directory.Build.props index 566dc3c..351ff22 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -25,7 +25,7 @@ - +