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

including conditions when starting side cars docker containers #4815

Merged
merged 5 commits into from
Feb 6, 2024

Conversation

anilkeshav27
Copy link
Member

Changes

when adding side cars for a piper step, this PR allows to bring in conditions when selecting a side care from conditions

  • Tests
  • Documentation

@anilkeshav27 anilkeshav27 requested a review from a team as a code owner February 2, 2024 16:01
@anilkeshav27 anilkeshav27 changed the title including conditions for side cars and also default context including conditions when starting side cars docker containers Feb 2, 2024
putStringIfNotEmpty(root, "sidecarReadyCommand", m.Spec.Sidecars[0].ReadyCommand)
// if there one side car do not check conditions and consider the only side care as default . this is default behaviour
// if there are more than one side car then check conditions,
if len(m.Spec.Sidecars) == 1 {
Copy link
Member

Choose a reason for hiding this comment

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

merge with outer `if

Copy link
Member

Choose a reason for hiding this comment

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

That would slightly change the meaning, but looping over empty sidecars should be fine. But why do we need those ifs at all? Why shouldn't one sidecar have a condition? Taking always the else case (i.e. looping over all sidecars) should always working, for 0,1 and many.

putStringIfNotEmpty(root, "sidecarReadyCommand", m.Spec.Sidecars[0].ReadyCommand)
// if there one side car do not check conditions and consider the only side care as default . this is default behaviour
// if there are more than one side car then check conditions,
if len(m.Spec.Sidecars) == 1 {
Copy link
Member

Choose a reason for hiding this comment

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

That would slightly change the meaning, but looping over empty sidecars should be fine. But why do we need those ifs at all? Why shouldn't one sidecar have a condition? Taking always the else case (i.e. looping over all sidecars) should always working, for 0,1 and many.

Copy link

sonarqubecloud bot commented Feb 6, 2024

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@anilkeshav27
Copy link
Member Author

/it-go

@anilkeshav27 anilkeshav27 merged commit c2343b1 into master Feb 6, 2024
12 checks passed
@anilkeshav27 anilkeshav27 deleted the anil/anil/conditionalSideCar1 branch February 6, 2024 13:54
maxatsap pushed a commit to maxatsap/jenkins-library that referenced this pull request Jul 23, 2024
)

* including conditions for side cars and also default context

* docu typo error
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.

4 participants