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

display error messages when dev-ks fails #2472

Merged
merged 1 commit into from
Jul 27, 2022
Merged

display error messages when dev-ks fails #2472

merged 1 commit into from
Jul 27, 2022

Conversation

chanwit
Copy link
Member

@chanwit chanwit commented Jul 21, 2022

Fixes #2462

Signed-off-by: Chanwit Kaewkasi chanwit@weave.works

@chanwit chanwit requested review from ozamosi and opudrovs July 21, 2022 12:11
@chanwit chanwit self-assigned this Jul 21, 2022
@chanwit chanwit added the type/enhancement New feature or request label Jul 21, 2022
@chanwit chanwit force-pushed the err-msg-for-dev-ks branch 9 times, most recently from 41bd3c2 to 4933931 Compare July 26, 2022 07:14
Copy link
Contributor

@ozamosi ozamosi left a comment

Choose a reason for hiding this comment

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

I tried running it in a way that breaks, and the output looked like:

► Request reconciliation of dev-bucket, and dev-ks (timeout 30s) ... 
✗ Kustomization flux-system/flux-system: Source 'GitRepository/flux-system' not found
✗ HelmRelease flux-system/ww-gitops: install retries exhausted
✗ HelmRelease flux-system/ww-gitops: Helm install failed: rendered manifests contain a resource that already exists. Unable to continue with install: Secret "cluster-user-auth" in namespace "flux-system" exists and cannot be imported into the current release: invalid ownership metadata; label validation error: key "app.kubernetes.io/managed-by" must equal "Helm": current value is "tilt"; annotation validation error: missing key "meta.helm.sh/release-name": must be set to "ww-gitops"; annotation validation error: missing key "meta.helm.sh/release-namespace": must be set to "flux-system"

Last Helm logs:


✗ GitRepository flux-system/flux-system: failed to get secret 'flux-system/flux-system': Secret "flux-system" not found
✗ Error requesting reconciliation: timed out waiting for the condition
✔ Reconciliation is done.

So it's definitely discovering the sub-object's logs and showing them. There's some odd whitespace around Last Helm Logs but I don't think that comes from us?

@@ -164,3 +172,66 @@ func CleanupBucketSourceAndKS(log logger.Logger, kubeClient *kube.KubeHTTP, name

return nil
}

// FindConditionMessages finds the messages in the condition of objects in the inventory.
func FindConditionMessages(kubeClient *kube.KubeHTTP, ks *kustomizev1.Kustomization) ([]string, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it would be easier to understand this function with some tests serving as examples - could we add some?

Copy link
Member Author

Choose a reason for hiding this comment

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

sure.

Signed-off-by: Chanwit Kaewkasi <chanwit@weave.works>
@chanwit chanwit merged commit 01dea4f into main Jul 27, 2022
@chanwit chanwit deleted the err-msg-for-dev-ks branch July 27, 2022 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GitOps Run - display error message when the reconciliation is failed
2 participants