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

UI unusable after creating a new suspended Kustomization #109

Open
metawave opened this issue Jul 1, 2024 · 1 comment
Open

UI unusable after creating a new suspended Kustomization #109

metawave opened this issue Jul 1, 2024 · 1 comment

Comments

@metawave
Copy link

metawave commented Jul 1, 2024

Version: 0.4.2
Flux 2.3
K8: v1.29.5

After adding a new Kustomization like

apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
  name: my-app
  namespace: flux-system
spec:
  suspend: true
  interval: 60m0s
  retryInterval: 2m0s
  timeout: 3m0s
  wait: true
  prune: true
  force: false
  targetNamespace: my-app
  sourceRef:
    kind: GitRepository
    name: git-my-app
  path: "."

which is suspended at start, causes problems in the UI:

RangeError: Invalid time value
    at sr (index.js:349:11)
    at Sr (ReadyWidget.jsx:20:21)
    at ko (react-dom.production.min.js:167:137)
    at ks (react-dom.production.min.js:290:337)
    at xu (react-dom.production.min.js:280:389)
    at gu (react-dom.production.min.js:280:320)
    at yu (react-dom.production.min.js:280:180)
    at ou (react-dom.production.min.js:271:88)
    at iu (react-dom.production.min.js:268:429)
    at S (scheduler.production.min.js:13:203)

and it goes directly to a white page error and I can't use the UI anymore. I think it has to do with the fact the Kustomization has no ready state yet. In the ReadyWidget when no Ready status has been reached yet:

  const readyConditions = jp.query(resource.status, '$..conditions[?(@.type=="Ready")]');
  const readyCondition = readyConditions.length === 1 ? readyConditions[0] : undefined
  const ready = readyCondition && readyConditions[0].status === "True"

  const dependencyNotReady = readyCondition && readyCondition.reason === "DependencyNotReady"

  const readyTransitionTime = readyCondition ? readyCondition.lastTransitionTime : undefined
  const parsed = Date.parse(readyTransitionTime, "yyyy-MM-dd'T'HH:mm:ss");
  const exactDate = format(parsed, 'MMMM do yyyy, h:mm:ss a O')

parsed evaluates to NaN, because readyTransitionTime is undefined. The format function does report it then as invalid date of course.

@0xStarcat
Copy link

I get the same error clicking on "Helm Releases" and the page goes blank

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants