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

Adding a hint when the APP CR installation fails due to ca cert error #1348

Merged
merged 1 commit into from
Oct 12, 2023

Conversation

rohitagg2020
Copy link
Contributor

@rohitagg2020 rohitagg2020 commented Oct 11, 2023

What this PR does / why we need it:

Adding a hint when the APP CR installation fails due to ca certificate not present in kapp controller

Which issue(s) this PR fixes:

With this change, app status will look like this whenever there is an error because kapp controller not able to fetch because of ca cert error:

$ kubectl get app/test-https -oyaml -n kapp-controller
apiVersion: kappctrl.k14s.io/v1alpha1
kind: App
metadata:
  annotations:
    kapp.k14s.io/change-group: kappctrl-e2e.k14s.io/apps
    kapp.k14s.io/identity: v1;kapp-controller/kappctrl.k14s.io/App/test-https;kappctrl.k14s.io/v1alpha1
    creationTimestamp: "2023-10-10T17:54:17Z"
  generation: 1
  labels:
    kapp.k14s.io/app: "1696960456655542000"
    kapp.k14s.io/association: v1.6c8820c760920aa56c616f481c6e3a4f
  name: test-https
  namespace: kapp-controller
  resourceVersion: "151557"
  uid: 941ac597-2379-4be5-ba88-e2afe9d0fa7b
spec:
  deploy:
  - kapp:
      inspect: {}
      intoNs: kapp-controller
  fetch:
  - http:
      url: https://https-svc.https-server.svc.cluster.local:443/deployment.yml
  serviceAccountName: kappctrl-e2e-ns-sa
  template:
  - ytt: {}
status:
  conditions:
  - message: 'Fetching resources: Error (see .status.usefulErrorMessage for details)'
    status: "True"
    type: ReconcileFailed
  consecutiveReconcileFailures: 5
  fetch:
    error: 'Fetching resources: Error (see .status.usefulErrorMessage for details)'
    exitCode: 1
    startedAt: "2023-10-10T17:54:49Z"
    stderr: |-
      vendir: Error: Syncing directory '0':
        Syncing directory '.' with HTTP contents:
          Downloading URL:
            Initiating URL download:
              Get "https://https-svc.https-server.svc.cluster.local:443/deployment.yml": tls: failed to verify certificate: x509: certificate signed by unknown authority
      (hint: The CA Certificate from URL is unknown/invalid. Add valid CA certificate to the kapp-controller configuration to reconcile successfully)
    updatedAt: "2023-10-10T17:54:49Z"
  friendlyDescription: 'Reconcile failed: Fetching resources: Error (see .status.usefulErrorMessage
    for details)'
  observedGeneration: 1
  usefulErrorMessage: |-
    vendir: Error: Syncing directory '0':
      Syncing directory '.' with HTTP contents:
        Downloading URL:
          Initiating URL download:
            Get "https://https-svc.https-server.svc.cluster.local:443/deployment.yml": tls: failed to verify certificate: x509: certificate signed by unknown authority
    (hint: The CA Certificate from URL is unknown/invalid. Add valid CA certificate to the kapp-controller configuration to reconcile successfully)

Fixes #

Does this PR introduce a user-facing change?


Additional Notes for your reviewer:

Review Checklist:
  • Follows the developer guidelines
  • Relevant tests are added or updated
  • Relevant docs in this repo added or updated
  • Relevant carvel.dev docs added or updated in a separate PR and there's
    a link to that PR
  • Code is at least as readable and maintainable as it was before this
    change

Additional documentation e.g., Proposal, usage docs, etc.:


@rohitagg2020 rohitagg2020 force-pushed the ra-add-hint-on-cert-error branch from 89d51fe to aaf7a40 Compare October 11, 2023 14:11
@rohitagg2020 rohitagg2020 marked this pull request as ready for review October 11, 2023 14:55
…e not present in kapp controller

Signed-off-by: rohitagg2020 <[email protected]>
@rohitagg2020 rohitagg2020 force-pushed the ra-add-hint-on-cert-error branch from aaf7a40 to bb08d40 Compare October 11, 2023 15:19
Copy link
Contributor

@neil-hickey neil-hickey left a comment

Choose a reason for hiding this comment

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

LGTM

pkg/app/app_fetch.go Show resolved Hide resolved
@rohitagg2020 rohitagg2020 merged commit c3f692b into develop Oct 12, 2023
10 checks passed
@praveenrewar praveenrewar deleted the ra-add-hint-on-cert-error branch April 29, 2024 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants