Skip to content

Conversation

Fedosin
Copy link
Contributor

@Fedosin Fedosin commented Jan 17, 2024

What this PR does / why we need it:

To prevent customization of non-manager deployments, we introduce a check that first verifies if there are several deployments. If there are several deployments available, we customize only those with names like "ca*-controller-manager" and skip the others.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jan 17, 2024
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jan 17, 2024
}

if o.GetKind() == deploymentKind {
// We need to skip the deployment customization if there are several deployments available
Copy link
Member

Choose a reason for hiding this comment

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

Does this mean we don’t customize CAPZ provider deployment with this logic in place?

Copy link
Member

Choose a reason for hiding this comment

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

Ah, I see, we are skipping everything which does not follow ca*-controller-manager and has multiple replicas. We’d need to watch out for non-regular providers, if they follow the naming pattern.

/lgtm

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 simplified that check, now it looks like if isMultipleDeployments && !isProviderManagerDeploymentName(o.GetName()) and isProviderManagerDeploymentName is strings.HasPrefix(name, "ca") && strings.HasSuffix(name, "-controller-manager")

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 17, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 5dbba6ba3abc73a310422efd17f9bade97696fea

@Fedosin
Copy link
Contributor Author

Fedosin commented Jan 17, 2024

/hold

going to add more tests

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 17, 2024
@Fedosin Fedosin force-pushed the fix-multiple-deployments branch from cac3fea to 04f9613 Compare January 17, 2024 17:11
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 17, 2024
To prevent customiztion of non-manager deployments, we introduce a
check that first verifies that there are several deployments.
If there are several deployments available, we customize only those
with names like "ca*-controller-manager" and skip others.
@Fedosin Fedosin force-pushed the fix-multiple-deployments branch from 04f9613 to 195da27 Compare January 17, 2024 17:13
@Fedosin
Copy link
Contributor Author

Fedosin commented Jan 17, 2024

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 17, 2024
Copy link
Member

@Danil-Grigorev Danil-Grigorev left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 17, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: c78dbd8747fbfce761aced1035753f9b14ad9f7d

Copy link
Contributor

@alexander-demicev alexander-demicev left a comment

Choose a reason for hiding this comment

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

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alexander-demicev

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 18, 2024
@k8s-ci-robot k8s-ci-robot merged commit d6e5f4f into kubernetes-sigs:main Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants