Skip to content

Commit

Permalink
Fix dry-run label (#105)
Browse files Browse the repository at this point in the history
<!-- Thank you for your contribution. Before you submit the pull
request:
1. Follow contributing guidelines, templates, the recommended Git
workflow, and any related documentation.
2. Read and submit the required Contributor Licence Agreements
(https://github.com/kyma-project/community/blob/main/CONTRIBUTING.md#agreements-and-licenses).
3. Test your changes and attach their results to the pull request.
4. Update the relevant documentation.

If the pull request requires a decision, follow the [decision-making
process](https://github.com/kyma-project/community/blob/main/governance.md)
and replace the PR template with the [decision record
template](https://github.com/kyma-project/community/blob/main/.github/ISSUE_TEMPLATE/decision-record.md).
-->

**Description**

Changes proposed in this pull request:

Dry-run label was added unconditionally. This PR adds the condition

**Related issue(s)**
<!-- If you refer to a particular issue, provide its number. For
example, `Resolves #123`, `Fixes #43`, or `See also #33`. -->
  • Loading branch information
kyma-bot authored Jan 23, 2024
2 parents 93b4627 + 3c44163 commit 190b2e7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions controllers/compassmanager_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,9 @@ func (c *ControlPlaneInterface) UpsertCompassMapping(name types.NamespacedName,
labels[LabelGlobalAccountID] = kymaCR.Labels[LabelGlobalAccountID]
labels[LabelSubaccountID] = kymaCR.Labels[LabelSubaccountID]
labels[LabelManagedBy] = ManagedBy
labels[LabelDryRun] = "Yes"
if c.dry {
labels[LabelDryRun] = "Yes"
}

existingMapping, err := c.GetCompassMapping(name)

Expand Down Expand Up @@ -597,7 +599,9 @@ func (c *ControlPlaneInterface) CreateCompassMapping(name types.NamespacedName,
labels[LabelGlobalAccountID] = kymaCR.Labels[LabelGlobalAccountID]
labels[LabelSubaccountID] = kymaCR.Labels[LabelSubaccountID]
labels[LabelManagedBy] = ManagedBy
labels[LabelDryRun] = "Yes"
if c.dry {
labels[LabelDryRun] = "Yes"
}

newMapping := v1beta1.CompassManagerMapping{}
newMapping.Name = name.Name
Expand Down

0 comments on commit 190b2e7

Please sign in to comment.