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

fix npe when inventory object is nil #3903

Merged
merged 4 commits into from
Aug 22, 2023
Merged

fix npe when inventory object is nil #3903

merged 4 commits into from
Aug 22, 2023

Conversation

chanwit
Copy link
Member

@chanwit chanwit commented Jul 31, 2023

Fixes #3902

@chanwit chanwit requested a review from enekofb July 31, 2023 16:51
Copy link
Contributor

@enekofb enekofb left a comment

Choose a reason for hiding this comment

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

we could add a test case here for the scenario we are trying to handle

apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
  creationTimestamp: "2023-07-31T15:05:53Z"
  finalizers:
  - finalizers.fluxcd.io
  generation: 1
  labels:
    kustomize.toolkit.fluxcd.io/name: flux-system
    kustomize.toolkit.fluxcd.io/namespace: flux-system
  name: rbac-secrets-good-practices
  namespace: flux-system
  resourceVersion: "9437086"
  uid: f3780853-bf47-4a3b-b5e3-f029623e8595
spec:
  force: false
  interval: 1m0s
  path: ./goodpractices/kubernetes/rbac/secrets
  prune: true
  sourceRef:
    kind: GitRepository
    name: policy-library
status:
  conditions:
  - lastTransitionTime: "2023-07-31T15:05:54Z"
    message: Source is not ready, artifact not found
    observedGeneration: 1
    reason: ArtifactFailed
    status: "False"
    type: Ready
  observedGeneration: -1

added the example also to the ticket

@chanwit chanwit force-pushed the fix-kust-inventory-npe branch 2 times, most recently from 94ffd18 to 722588d Compare August 1, 2023 14:27
core/server/inventory_test.go Show resolved Hide resolved
core/server/inventory.go Show resolved Hide resolved
@bigkevmcd
Copy link
Contributor

@chanwit are you going to address these issues? if not, I'll happily close this and open a new PR to do it.

@chanwit
Copy link
Member Author

chanwit commented Aug 9, 2023

I'll continue this week. Sorry I am currently having a technical issue with my box.

@chanwit chanwit force-pushed the fix-kust-inventory-npe branch from 0a55e7f to 9272e69 Compare August 16, 2023 12:34
@chanwit chanwit requested a review from bigkevmcd August 16, 2023 12:35
Chanwit Kaewkasi added 4 commits August 22, 2023 20:13
Signed-off-by: Chanwit Kaewkasi <chanwit@weave.works>
Signed-off-by: Chanwit Kaewkasi <chanwit@weave.works>
Signed-off-by: Chanwit Kaewkasi <chanwit@weave.works>
Signed-off-by: Chanwit Kaewkasi <chanwit@weave.works>
@chanwit chanwit force-pushed the fix-kust-inventory-npe branch from 2a69344 to fbd0974 Compare August 22, 2023 13:13
@chanwit chanwit merged commit 2687831 into main Aug 22, 2023
@chanwit chanwit deleted the fix-kust-inventory-npe branch August 22, 2023 13:48
This was referenced Aug 30, 2023
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

Successfully merging this pull request may close these issues.

NPE while getting Kustomization inventory
3 participants