Drop string cast from SSA action comparisons

As this is no longer required given the action is now typed.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
This commit is contained in:
Hidde Beydals 2023-03-07 17:55:10 +01:00
parent ec34ae36ce
commit f9878cfd1b
No known key found for this signature in database
GPG Key ID: 979F380FC2341744
2 changed files with 4 additions and 4 deletions

View File

@ -732,7 +732,7 @@ func (r *KustomizationReconciler) apply(ctx context.Context,
if changeSet != nil && len(changeSet.Entries) > 0 {
log.Info("server-side apply for cluster definitions completed", "output", changeSet.ToMap())
for _, change := range changeSet.Entries {
if change.Action != string(ssa.UnchangedAction) {
if change.Action != ssa.UnchangedAction {
changeSetLog.WriteString(change.String() + "\n")
}
}
@ -757,7 +757,7 @@ func (r *KustomizationReconciler) apply(ctx context.Context,
if changeSet != nil && len(changeSet.Entries) > 0 {
log.Info("server-side apply for cluster class types completed", "output", changeSet.ToMap())
for _, change := range changeSet.Entries {
if change.Action != string(ssa.UnchangedAction) {
if change.Action != ssa.UnchangedAction {
changeSetLog.WriteString(change.String() + "\n")
}
}
@ -783,7 +783,7 @@ func (r *KustomizationReconciler) apply(ctx context.Context,
if changeSet != nil && len(changeSet.Entries) > 0 {
log.Info("server-side apply completed", "output", changeSet.ToMap(), "revision", revision)
for _, change := range changeSet.Entries {
if change.Action != string(ssa.UnchangedAction) {
if change.Action != ssa.UnchangedAction {
changeSetLog.WriteString(change.String() + "\n")
}
}

View File

@ -84,7 +84,7 @@ func readManifest(manifest string) (*ssa.ChangeSet, error) {
ObjMetadata: object.UnstructuredToObjMetadata(o),
GroupVersion: o.GroupVersionKind().Version,
Subject: ssa.FmtUnstructured(o),
Action: string(ssa.CreatedAction),
Action: ssa.CreatedAction,
}
cs.Add(cse)
}