Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing magic strings on operator flags #3327

Merged
merged 56 commits into from
Jan 4, 2024

Conversation

azoppiserpa
Copy link
Contributor

@azoppiserpa azoppiserpa commented Dec 15, 2023

Which issue this PR addresses:

There isn't a work item to be referenced for this change. The issue was found searching for // TODO in the code. It's a small refactor.

What this PR does / why we need it:

  • Fixes magic strings related to operator flags, and places them in a new flags.go file that can be reused instead of us having a bunch of magic strings that could be wrongly changed easily everywhere.

Test plan for issue:

  • Unit tests: done, passed.
  • Integration tests: manually tested on INT through the following steps:
  1. Deployed this PR on INT pipeline.
  2. Created a test cluster.
  3. Checked that operator flags on the test cluster were set as expected, comparing them to the flags on the PR.
  4. Also checked that operator flags matched the expected on CosmosDB.
  5. On both cases the flags were set as expected.

Is there any documentation that needs to be updated for this PR?

No documentation changes needed.

@niontive
Copy link
Collaborator

Let's revert all changes to the Python code. That code already has the licenses stuff.

test/e2e/cluster.go Outdated Show resolved Hide resolved
test/e2e/cluster.go Outdated Show resolved Hide resolved
test/e2e/operator.go Outdated Show resolved Hide resolved
@niontive
Copy link
Collaborator

We can get rid of controllerEnabled consts now since we have a central place where these are defined.

Copy link
Collaborator

@dem4gus dem4gus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this change, it was very needed.

AzureSubnetsServiceEndpointManaged = "aro.azuresubnets.serviceendpoint.managed"
BannerEnabled = "aro.banner.enabled"
CheckerEnabled = "aro.checker.enabled"
DnsMasqEnabled = "aro.dnsmasq.enabled"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Dnsmasq isn't camelCase. It's technically dnsmasq but Go wants exported things to start with a capital letter.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've changed it both for DnsmasqEnabled and RestardDnsmasqEnabled, thanks for pointing out :)

dem4gus
dem4gus previously approved these changes Dec 20, 2023
Copy link
Collaborator

@hawkowl hawkowl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm working on making pkg/api/ independent of the rest of the codebase so that it can be imported in the Installer Wrapper, MIMO, etc without dragging in potentially all the RP's dependencies. Is there a way we can do this without pkg/api/ having a hard dependency on pkg/operator/?

@hawkowl
Copy link
Collaborator

hawkowl commented Jan 2, 2024

/azp run ci

Copy link

Azure Pipelines failed to run 1 pipeline(s).

@hawkowl
Copy link
Collaborator

hawkowl commented Jan 3, 2024

/azp run ci

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@github-actions github-actions bot added the needs-rebase branch needs a rebase label Jan 3, 2024
Copy link

github-actions bot commented Jan 3, 2024

Please rebase pull request.

@github-actions github-actions bot removed the needs-rebase branch needs a rebase label Jan 4, 2024
@hawkowl
Copy link
Collaborator

hawkowl commented Jan 4, 2024

/azp run ci

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@dofinn dofinn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm nice clean up

@hawkowl hawkowl merged commit 40e7987 into Azure:master Jan 4, 2024
17 checks passed
LiniSusan pushed a commit to LiniSusan/ARO-RP that referenced this pull request Jan 25, 2024
* replacing usages of magic strings with flags from the subpackage

* removing the //todo comment regarding the magic strings

* replacing magic strings with operator constants

* move DefaultOperatorFlags to operator package, inject when needed
ventifus pushed a commit to ventifus/ARO-RP that referenced this pull request Feb 7, 2024
* replacing usages of magic strings with flags from the subpackage

* removing the //todo comment regarding the magic strings

* replacing magic strings with operator constants

* move DefaultOperatorFlags to operator package, inject when needed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants