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

feat(controller): don't hardcode experiment ports; always create service #2397

Merged
merged 37 commits into from
Nov 8, 2022

Conversation

alexef
Copy link
Member

@alexef alexef commented Nov 4, 2022

superseeds: #2357

fixes: #2233

also relates to: #2396

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this is a chore.
  • The title of the PR is (a) conventional with a list of types and scopes found here, (b) states what changed, and (c) suffixes the related issues number. E.g. "fix(controller): Updates such and such. Fixes #1234".
  • I've signed my commits with DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My builds are green. Try syncing with master if they are not.
  • My organization is added to USERS.md.

Create a service even though a weight is not set (when the name is provided)

Signed-off-by: Alex Eftimie <[email protected]>
Signed-off-by: Alex Eftimie <[email protected]>
Signed-off-by: Alex Eftimie <[email protected]>
Signed-off-by: Alex Eftimie <[email protected]>
Signed-off-by: Alex Eftimie <[email protected]>
Signed-off-by: Alex Eftimie <[email protected]>
Signed-off-by: Alex Eftimie <[email protected]>
disable service where service is not needed or expected
set ports where service must be created

Signed-off-by: Alex Eftimie <[email protected]>
Signed-off-by: Alex Eftimie <[email protected]>
@github-actions
Copy link
Contributor

github-actions bot commented Nov 4, 2022

E2E Tests Published Test Results

    2 files      2 suites   1h 30m 30s ⏱️
  89 tests   84 ✔️ 3 💤 2
180 runs  172 ✔️ 6 💤 2

For more details on these failures, see this check.

Results for commit 31cf3d5.

♻️ This comment has been updated with latest results.

@alexef alexef requested a review from zachaller November 4, 2022 20:07
@zachaller
Copy link
Collaborator

zachaller commented Nov 5, 2022

In regards to the e2e tests, can you confirm for me that if we modify the code to not create the service if there is no ports defined on the pod spec. I think that should fix all the e2e tests and not require a port on the container which I think we should support

@alexef
Copy link
Member Author

alexef commented Nov 5, 2022

if we modify the code to not create the service if there is no ports defined on the pod spec

correct, I forgot about that. let me do this change

@sonarcloud
Copy link

sonarcloud bot commented Nov 5, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@zachaller zachaller merged commit 40e0166 into argoproj:master Nov 8, 2022
jandersen-plaid pushed a commit to jandersen-plaid/argo-rollouts that referenced this pull request Nov 8, 2022
…ice (argoproj#2397)

* Copy ports from replicaset rather than hardcoding them
    Fixes: argoproj#2233

Signed-off-by: Alex Eftimie <[email protected]>

* Allow user to set the experiment service name.
Create a service even though a weight is not set (when the name is provided)

Signed-off-by: Alex Eftimie <[email protected]>

* Run codegen

Signed-off-by: Alex Eftimie <[email protected]>

* Run codegen again, service name is optional

Signed-off-by: Alex Eftimie <[email protected]>

* Fix conversion and tests

Signed-off-by: Alex Eftimie <[email protected]>

* Fix codegen

Signed-off-by: Alex Eftimie <[email protected]>

* Fix codegen again

Signed-off-by: Alex Eftimie <[email protected]>

* white space

Signed-off-by: Alex Eftimie <[email protected]>

* Extend from corev1.ServiceSpec

Signed-off-by: Alex Eftimie <[email protected]>

* make lint

Signed-off-by: Alex Eftimie <[email protected]>

* infer ports from ReplicaSet. this should fix e2e tests

Signed-off-by: Alex Eftimie <[email protected]>

* fix e2e
disable service where service is not needed or expected
set ports where service must be created

Signed-off-by: Alex Eftimie <[email protected]>

* use json inline so that crd reflects ports

Signed-off-by: Alex Eftimie <[email protected]>

* Add codegen openapi_generated.go

Signed-off-by: Alex Eftimie <[email protected]>

* fix codegen, protobuf is needed

Signed-off-by: Alex Eftimie <[email protected]>

* Add unit test

Signed-off-by: Alex Eftimie <[email protected]>

* Add unit test to new not tested code - copy pods from RS

Signed-off-by: Alex Eftimie <[email protected]>

* Address PR comment: set entire spec

Signed-off-by: Alex Eftimie <[email protected]>

* docs: update experiment and rollout spec

Signed-off-by: Alex Eftimie <[email protected]>

* redo pr. drop spec changes. only inherit ports and always create the service. update docs

Signed-off-by: Alex Eftimie <[email protected]>

* Ran go fmt

Signed-off-by: Alex Eftimie <[email protected]>

* revert changes. only enable service if weighted or template service not nil

Signed-off-by: Alex Eftimie <[email protected]>

* typo in types

Signed-off-by: Alex Eftimie <[email protected]>

* go fmt. need pre-commit hook

Signed-off-by: Alex Eftimie <[email protected]>

* no more spec changes

Signed-off-by: Alex Eftimie <[email protected]>

* drop test which is not relevant any more

Signed-off-by: Alex Eftimie <[email protected]>

* fix e2e - only generate service if RS has ports

Signed-off-by: Alex Eftimie <[email protected]>

* fix e2e

Signed-off-by: Alex Eftimie <[email protected]>

Signed-off-by: Alex Eftimie <[email protected]>
@alexef alexef deleted the experiment-ports branch November 21, 2022 11:39
jandersen-plaid pushed a commit to jandersen-plaid/argo-rollouts that referenced this pull request Nov 26, 2022
…ice (argoproj#2397)

* Copy ports from replicaset rather than hardcoding them
    Fixes: argoproj#2233

Signed-off-by: Alex Eftimie <[email protected]>

* Allow user to set the experiment service name.
Create a service even though a weight is not set (when the name is provided)

Signed-off-by: Alex Eftimie <[email protected]>

* Run codegen

Signed-off-by: Alex Eftimie <[email protected]>

* Run codegen again, service name is optional

Signed-off-by: Alex Eftimie <[email protected]>

* Fix conversion and tests

Signed-off-by: Alex Eftimie <[email protected]>

* Fix codegen

Signed-off-by: Alex Eftimie <[email protected]>

* Fix codegen again

Signed-off-by: Alex Eftimie <[email protected]>

* white space

Signed-off-by: Alex Eftimie <[email protected]>

* Extend from corev1.ServiceSpec

Signed-off-by: Alex Eftimie <[email protected]>

* make lint

Signed-off-by: Alex Eftimie <[email protected]>

* infer ports from ReplicaSet. this should fix e2e tests

Signed-off-by: Alex Eftimie <[email protected]>

* fix e2e
disable service where service is not needed or expected
set ports where service must be created

Signed-off-by: Alex Eftimie <[email protected]>

* use json inline so that crd reflects ports

Signed-off-by: Alex Eftimie <[email protected]>

* Add codegen openapi_generated.go

Signed-off-by: Alex Eftimie <[email protected]>

* fix codegen, protobuf is needed

Signed-off-by: Alex Eftimie <[email protected]>

* Add unit test

Signed-off-by: Alex Eftimie <[email protected]>

* Add unit test to new not tested code - copy pods from RS

Signed-off-by: Alex Eftimie <[email protected]>

* Address PR comment: set entire spec

Signed-off-by: Alex Eftimie <[email protected]>

* docs: update experiment and rollout spec

Signed-off-by: Alex Eftimie <[email protected]>

* redo pr. drop spec changes. only inherit ports and always create the service. update docs

Signed-off-by: Alex Eftimie <[email protected]>

* Ran go fmt

Signed-off-by: Alex Eftimie <[email protected]>

* revert changes. only enable service if weighted or template service not nil

Signed-off-by: Alex Eftimie <[email protected]>

* typo in types

Signed-off-by: Alex Eftimie <[email protected]>

* go fmt. need pre-commit hook

Signed-off-by: Alex Eftimie <[email protected]>

* no more spec changes

Signed-off-by: Alex Eftimie <[email protected]>

* drop test which is not relevant any more

Signed-off-by: Alex Eftimie <[email protected]>

* fix e2e - only generate service if RS has ports

Signed-off-by: Alex Eftimie <[email protected]>

* fix e2e

Signed-off-by: Alex Eftimie <[email protected]>

Signed-off-by: Alex Eftimie <[email protected]>
@@ -64,9 +64,7 @@ func GetExperimentFromTemplate(r *v1alpha1.Rollout, stableRS, newRS *appsv1.Repl
Name: templateStep.Name,
Replicas: templateStep.Replicas,
}
if templateStep.Weight != nil {
Copy link
Member Author

Choose a reason for hiding this comment

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

Feels like we can use weight: 0 to keep creating the service, if automated creation is rolled back

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.

Experiment create service with hardcoded port.
2 participants