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

fixed a bug in cleaning up sidecar containers #17

Merged
merged 1 commit into from
Dec 14, 2023
Merged

Conversation

sinamna
Copy link
Collaborator

@sinamna sinamna commented Dec 14, 2023

Summary by CodeRabbit

  • Refactor
    • Improved cleanup process by ensuring specific annotations and labels are removed from deployments when necessary.

Copy link

coderabbitai bot commented Dec 14, 2023

Walkthrough

The recent update involves a modification to the cleanup.go file within the basic authenticator controller. This change enhances the removeInjectedResources function, enabling it to strip an ExternallyManaged annotation and a basicAuthenticatorNameLabel label from a deployment when certain conditions are met. No public or exported declarations have been altered in this process.

Changes

File Summary
.../basic_authenticator/cleanup.go Added logic to remove ExternallyManaged annotation and basicAuthenticatorNameLabel label from deployments.

🐇✨
A hop, a skip, in the code we dip,
Cleaning up with a snip and a clip.
Annotations away, labels adieu,
CodeRabbit's work is never through. 🌟🌱

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on X ?


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • You can reply to a review comment made by CodeRabbit.
  • You can tag CodeRabbit on specific lines of code or files in the PR by tagging @coderabbitai in a comment.
  • You can tag @coderabbitai in a PR comment and ask one-off questions about the PR and the codebase. Use quoted replies to pass the context for follow-up questions.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 1f39bd7 and 500f052.
Files selected for processing (1)
  • internal/controller/basic_authenticator/cleanup.go (1 hunks)
Additional comments: 1
internal/controller/basic_authenticator/cleanup.go (1)
  • 166-171: The code correctly implements the removal of the ExternallyManaged annotation and the basicAuthenticatorNameLabel label from deployments. Ensure that these constants are properly declared and accessible within the scope of this file.
Verification successful

The script output shows the usage of ExternallyManaged and basicAuthenticatorNameLabel in the cleanup.go file, but it does not confirm their declarations. To ensure that these identifiers are properly declared and accessible, I will expand the search to the entire codebase.


Given that the strict search for the constants did not produce any results, I will now perform a broader search to locate the declarations or references to ExternallyManaged and basicAuthenticatorNameLabel without assuming they are constants. Additionally, I will check for import statements that might include these identifiers in cleanup.go.


The constants ExternallyManaged and basicAuthenticatorNameLabel are properly declared in the internal/controller/basic_authenticator/const.go file. This confirms that they are accessible within the cleanup.go file, and the changes in the pull request are correctly using these constants.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify that the constants `ExternallyManaged` and `basicAuthenticatorNameLabel` are declared and accessible.
rg 'ExternallyManaged|basicAuthenticatorNameLabel' -- 'internal/controller/basic_authenticator/cleanup.go'

Length of output: 265



Script:

#!/bin/bash
# Search for the declaration of the constants `ExternallyManaged` and `basicAuthenticatorNameLabel` across the entire codebase.
rg 'const\s+ExternallyManaged\s+='
rg 'const\s+basicAuthenticatorNameLabel\s+='

Length of output: 83



Script:

#!/bin/bash
# Broad search for any declarations or references to `ExternallyManaged` and `basicAuthenticatorNameLabel`
rg 'ExternallyManaged'
rg 'basicAuthenticatorNameLabel'

# Check for import statements in `cleanup.go` that might include these identifiers
rg '^import ' 'internal/controller/basic_authenticator/cleanup.go'

Length of output: 1939

@sinamna sinamna merged commit b78a50b into main Dec 14, 2023
1 check passed
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.

1 participant