-
Notifications
You must be signed in to change notification settings - Fork 21
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: delete the sync deployment after deploy complete #78
Conversation
Signed-off-by: lizonglingo <[email protected]>
Signed-off-by: lizonglingo <[email protected]>
Signed-off-by: DKCBBB <[email protected]>
pkg/controllers/client.go
Outdated
logger.Debugf("node count is %d", nodeCount) | ||
} | ||
|
||
checkTicker := time.NewTicker(30 * time.Second) |
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 for{} never stop if something wrong, you can add a timeout time or limit retry times.
pkg/controllers/client.go
Outdated
logger.Infof("cluster is deployed, deployment about \"curve-sync-config\" will be deleted") | ||
} | ||
|
||
func isAllReplicasReady(deployment apps.Deployment) bool { |
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 deployment operation and job operation code put the k8sutil dir is better.
pkg/controllers/client.go
Outdated
@@ -86,6 +98,10 @@ func createSyncDeployment(c *daemon.Cluster) error { | |||
return err | |||
} | |||
} | |||
|
|||
// delete the SyncConfigDeployment after the cluster is deployed. |
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.
using channel to get delete result (true or false) and log the reason if delete the deployment failed.
pkg/controllers/client.go
Outdated
} | ||
|
||
func isJobCompleted(job batch.Job) bool { | ||
if *job.Spec.Completions == job.Status.Succeeded { |
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 job status is failed or other status sometimes.
ok, I'll make some changes and additions @caoxianfei1 |
ok |
new code has been submitted @caoxianfei1 |
pkg/controllers/client.go
Outdated
@@ -154,3 +157,22 @@ func getReadConfigJobLabel(c *daemon.Cluster) map[string]string { | |||
labels["curve"] = c.Kind | |||
return labels | |||
} | |||
|
|||
// deleteSyncConfigDeployment delete the SyncConfigDeployment after the cluster is deployed. |
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 think that put the func in k8sutil fold and deployment file is better
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.
ok, I've adjusted its directory
for func DeleteSyncConfigDeployment()
lgtm |
This pr resolves #70 .
Closes #70 .