Skip to content

Commit 5a82b55

Browse files
committed
Only look for the parts of the rollout spec we care about
1 parent 9f35d5e commit 5a82b55

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/Contrast.K8s.AgentOperator/Core/Reactions/Injecting/PodTemplateInjectionHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ private async ValueTask PatchToDesiredStateDeployment(DesiredState desiredState,
113113
private async ValueTask PatchToDesiredStateRollout(DesiredState desiredState, NamespacedResourceIdentity identity)
114114
{
115115
await _state.MarkAsDirty(identity);
116-
await _patcher.Patch<V1Alpha1Rollout>(identity.Name, identity.Namespace, o => { PatchAnnotations(desiredState, o.Spec.Template); });
116+
await _patcher.Patch<V1Alpha1Rollout>(identity.Name, identity.Namespace, o => { PatchAnnotations(desiredState, o.Spec.Template!); });
117117
}
118118

119119
private async ValueTask PatchToDesiredStateDeploymentConfig(DesiredState desiredState, NamespacedResourceIdentity identity)

src/Contrast.K8s.AgentOperator/Entities/Argo/V1Alpha1Rollout.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using KubeOps.Abstractions.Entities;
77
using KubeOps.Abstractions.Entities.Attributes;
88
using KubeOps.Abstractions.Rbac;
9+
using System.Text.Json.Serialization;
910

1011
namespace Contrast.K8s.AgentOperator.Entities.Argo;
1112

@@ -15,7 +16,12 @@ namespace Contrast.K8s.AgentOperator.Entities.Argo;
1516
public partial class V1Alpha1Rollout : CustomKubernetesEntity<V1Alpha1Rollout.RolloutSpec>
1617
{
1718
//Drop-in replacement for Deployment (with additional fields for the rollout info)
18-
public record RolloutSpec : V1DeploymentSpec
19+
public class RolloutSpec
1920
{
21+
[JsonPropertyName("selector")]
22+
public V1LabelSelector? Selector { get; set; }
23+
24+
[JsonPropertyName("template")]
25+
public V1PodTemplateSpec? Template { get; set; }
2026
}
2127
}

0 commit comments

Comments
 (0)