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(develop): outbound-only new service flow #1050

Draft
wants to merge 87 commits into
base: master
Choose a base branch
from

Conversation

bartoszmajsak
Copy link
Contributor

@bartoszmajsak bartoszmajsak commented Jul 22, 2022

Short description of what this resolves:

Enables working on newly created service through ike develop new --name new-service -n namespace which takes care of creating all required k8s resources and then delegates the rest of the work to parent ike develop command. This work supports (and tests) service with outbound-only calls.

For the actual test of this new feature see fundamental_use_cases_test.go

Changes proposed in this pull request:

  • ike develop new subcommand
  • brings back the dynamic client to create necessary k8s resources on the fly
  • test services moved from strings to actual files which are then //go:embeded for easy on-the-fly manipulation
  • not passing argument to scenario generator results in listing all available options instead of just failing
  • restructures and rewords e2e test cases
    • brakes down test files by areas
    • moves verification funcs to new verify package
  • creates Printer func to abstract away how runtime.Objects are printed
    • based on the "diagram work"
    • enables dynamic client call when generating objects
  • minor cleanups
    • rewords some godoc
    • renames alphanumeric string generation func
    • adds missing error handling
    • removes unneeded if statement
    • disables ginkgo verbose output - slightly faster test execution
    • moves generator code to main pkg/

Fixes #1022

TODO

  • enable defining service image in generator
  • address admission webhook when creating new objects (this does not block the test from succeeding)
  • write tests for k8s dynamic client (part of feat: checks if operator exists for server-related cmds #1081)
  • mute cmd output in tests
  • give test scenarios better names (instead of scenario-1.1 for example)
  • update docs
    • cli-get
    • feature overview
  • test when gw does not exist

Open questions

  • when --name is not passed should it be autogenerated or is it required?
  • should we support "the very first service" scenario?

Carry-overs

  • do not create 2 deployments for new service - use --swap-deployment strategy instead

@bartoszmajsak bartoszmajsak added kind/enhancement Kind: New feature or improvement component/cli Component: CLI tooling labels Jul 22, 2022
@bartoszmajsak bartoszmajsak changed the title new service feat(develop): outbound-only new service flow Jul 22, 2022
Makefile Show resolved Hide resolved

When("deploying new version of the service to the cluster", func() {

It("should deploy new instance of the service and make it reachable through special route", func() {
Copy link
Member

Choose a reason for hiding this comment

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

Should we reword these to "deploy updated instance/version" instead of using "new" to not confuse with "new service" ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My thinking here was that I'm deploying new service, but I agree it should be reworded. I'll take care of it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Does it sound better now? bf7471e

Copy link
Member

Choose a reason for hiding this comment

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

Not seeing the relevance? :)

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 think that should be more relevant: f31d18c

pkg/cmd/develop/cmd.go Outdated Show resolved Hide resolved
@aslakknutsen
Copy link
Member

aslakknutsen commented Jul 22, 2022

Happy Season 9 GIF by The Office

true is anyway default value to return so no need to evaluate this condition
Tests are poluting logs too much anyway. Default mode logs details on failures.

In order to use verbose mode you can use `make  test  -v`
Opens Service entry creation to pass ports

.PHONY: test-e2e
test-e2e: compile ## Runs end-to-end tests
$(call header,"Running end-to-end tests")
ginkgo e2e/ -r -v -progress -vet=off -trace --junit-report=ginkgo-test-results.xml ${args}
ginkgo e2e/ -r -progress -vet=off -trace --junit-report=ginkgo-test-results.xml ${args}
Copy link
Member

Choose a reason for hiding this comment

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

Didn't we add the -v to avoid the circle job to timeout with no output? Don't remember if that was successful or not

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That was verbose mode and it resulted in very noisy output. For seeing what's going on -progress is enough. See latest build https://app.circleci.com/pipelines/github/maistra/istio-workspace/3476/workflows/9bd1b0db-2859-45d0-9cb5-bdc1975663b2/jobs/8767?invite=true#step-108-820

@bartoszmajsak bartoszmajsak marked this pull request as ready for review September 14, 2022 15:19
@bartoszmajsak bartoszmajsak marked this pull request as draft September 14, 2022 15:21
@bartoszmajsak
Copy link
Contributor Author

/help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/cli Component: CLI tooling kind/enhancement Kind: New feature or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Outbound-only new service
2 participants