Skip to content

Comments

fix: resourceRef should be a required property#411

Merged
Skarlso merged 2 commits intomainfrom
make-resource-ref-required
May 3, 2024
Merged

fix: resourceRef should be a required property#411
Skarlso merged 2 commits intomainfrom
make-resource-ref-required

Conversation

@Skarlso
Copy link
Contributor

@Skarlso Skarlso commented May 2, 2024

Description

Closes open-component-model/ocm-project#66

What type of PR is this? (check all applicable)

  • 🍕 Feature
  • 🐛 Bug Fix
  • 📝 Documentation Update
  • 🎨 Style
  • 🧑‍💻 Code Refactor
  • 🔥 Performance Improvements
  • ✅ Test
  • 🤖 Build
  • 🔁 CI
  • 📦 Chore (Release)
  • ⏩ Revert

Related Tickets & Documents

  • Related Issue # (issue)
  • Closes # (issue)
  • Fixes # (issue)

Remove if not applicable

Screenshots

Added tests?

  • 👍 yes
  • 🙅 no, because they aren't needed
  • 🙋 no, because I need help
  • Separate ticket for tests # (issue/pr)

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

Added to documentation?

  • 📜 README.md
  • 🙅 no documentation needed

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@Skarlso Skarlso requested review from morri-son and sk31337 May 2, 2024 12:50
morri-son
morri-son previously approved these changes May 2, 2024
@github-actions
Copy link

github-actions bot commented May 2, 2024

Mend Scan Summary: ❌

Repository: open-component-model/ocm-controller

VIOLATION DESCRIPTION NUMBER OF VIOLATIONS
HIGH/CRITICAL SECURITY VULNERABILITIES 0
MAJOR UPDATES AVAILABLE 0
LICENSE REQUIRES REVIEW 2
LICENSE RISK HIGH 10
RESTRICTED LICENSE FOR ON-PREMISE DELIVERY 0

Detailed Logs: mend-scan-> Generate Report
Mend UI

@Skarlso
Copy link
Contributor Author

Skarlso commented May 2, 2024

Investigating test failure... interesting.

@Skarlso
Copy link
Contributor Author

Skarlso commented May 2, 2024

hm, it passes locally

Events:                                                                                                                            │
│   Type     Reason                    Age                    From            Message                                                │
│   ----     ------                    ----                   ----            -------                                                │
│   Warning  Progressing               5m10s                  ocm-controller  Reconciliation did not succeed, retrying in 5s         │
│   Warning  ComponentVersionNotReady  5m10s                  ocm-controller  component version not ready yet                        │
│   Normal   Succeeded                 4m19s (x11 over 5m9s)  ocm-controller  Reconciliation finished, next run in 5s                │
│   Normal   Succeeded                 8s (x61 over 5m9s)     ocm-controller  Applied version: 1.0.0

@Skarlso
Copy link
Contributor Author

Skarlso commented May 2, 2024

ah, that's not the right one. Found it:

{"level":"error","ts":"2024-05-02T13:29:50.069Z","msg":"Reconciliation failed after 54.435559ms, next try in 5s","controller":"kustomization","controllerGroup":"kustomize.toolkit.fluxcd.io","controllerKind":"Kustomization","Kustomization":{"name":"ocm-controller-tes │
│ t","namespace":"flux-system"},"namespace":"flux-system","name":"ocm-controller-test","reconcileID":"999620eb-1f68-4fdb-b228-c78c78183307","revision":"main@sha1:dc8ce138e2ca2aef26674366285aace1150dc627","error":"Configuration/ocm-system/configuration-pipeline-backend │
│  dry-run failed (Invalid): Configuration.delivery.ocm.software \"configuration-pipeline-backend\" is invalid: spec.sourceRef.resourceRef: Required value\n"}                      

Of course there was something without the resource thing. :D And here I was wondering what the hell would create a resource without a resource ref. :D

@Skarlso
Copy link
Contributor Author

Skarlso commented May 2, 2024

ah, I see why it's optional... If it's a configuration or a localization it doesn't require a resource because it's using the Snapshot directly. Ah. :D

@Skarlso
Copy link
Contributor Author

Skarlso commented May 2, 2024

Ugh, I'm looking for a nicer way to do this. :D Because configRef also uses this. I wanted to create a Validation webhook, but all the scaffolding required seems overkill.

So I'm thinking of redesigning the API instead and using concrete values instead. I'll see what I can do tomorrow.

@Skarlso Skarlso force-pushed the make-resource-ref-required branch from 5759d5b to 1a4471b Compare May 3, 2024 06:38
@Skarlso Skarlso requested a review from morri-son May 3, 2024 06:40
@Skarlso Skarlso merged commit d6ff6a2 into main May 3, 2024
@Skarlso Skarlso deleted the make-resource-ref-required branch May 3, 2024 06:49
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.

missing optional .spec.sourceRef.resourceRef -> kind: Resource: ocm-controller throws an SIGSEGV:

2 participants