-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add the --rebuild option to the k8s-env command #3480
Conversation
Yeah, there will be cases for both. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved, most of my comments are either general advice or stream of conscious comments.
e2e/test/teraslice-harness.js
Outdated
@@ -22,12 +22,15 @@ const { cleanupIndex } = ElasticsearchTestHelpers; | |||
|
|||
const generateOnly = GENERATE_ONLY ? parseInt(GENERATE_ONLY, 10) : null; | |||
|
|||
const TERASLICE_PORT = 45678; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this is accessible in this scope, but here's another place this port is defined:
let TS_PORT = '45678'; |
In the scripts package, so maybe it does't make sense to have this dependency, or maybe it should go the other way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- The teraslice port was a magic number in
e2e/test/teraslice-harness.js
ande2e/test/global.setup.js
, so I just made it a constant so things were more explicit. I should be able to pass the value from one to the other. - In my first attempt to declare the teraslice port, I placed it in
helpers/scripts.ts
, then modified it if we were in k8s-env mode, not testing mode. I then removed the declaration in favor of passing the port in from either theglobal.setup.js
constant or thek8s-env
command options. - Ports are also hard coded into some yaml files. It would be nice to set a variable once and pass it everywhere needed!
e2e/test/global.setup.js
Outdated
@@ -16,6 +16,8 @@ const { | |||
CONFIG_PATH, ASSETS_PATH, TEST_PLATFORM | |||
} = require('./config'); | |||
|
|||
const TERASLICE_PORT = 45678; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have this variable set elsewhere too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is is a problem if it gets updated in one place but not the other? If so, you have a problem.
} | ||
|
||
async deleteTerasliceNamespace() { | ||
async confirmDeletion(terasliceNamespace: string, coreV1Api: k8sClient.CoreV1Api) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a pretty vague function name, if it means confirmNamespaceDeletetion
you might name it that.
@@ -21,7 +21,6 @@ import { getE2eK8sDir } from '../helpers/packages'; | |||
import { yamlDeploymentResource, yamlServiceResource } from './k8s-env/interfaces'; | |||
|
|||
const logger = debugLogger('ts-scripts:cmd'); | |||
let TS_PORT = '45678'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now I'm confused about this TS_PORT thing.
This PR includes the following changes:
--rebuild
option tots-scripts k8s-env
yarn k8s:rebuild
script from root of terasliceyarn k8s
. Now services and the cluster do not need to be rebuilt.