Skip to content
This repository has been archived by the owner on Dec 16, 2024. It is now read-only.

feat: add gitlab provider for bootstrapping #166

Merged
merged 3 commits into from
Dec 14, 2023
Merged

feat: add gitlab provider for bootstrapping #166

merged 3 commits into from
Dec 14, 2023

Conversation

Skarlso
Copy link
Contributor

@Skarlso Skarlso commented Dec 11, 2023

Description

Closes #62.

Looks like there is still a bug. If the repository doesn't exist, it will fail immediately because it creates the repository uninitialised. This means there is no main branch it can clone. This bug appears to be in Flux, though. So, I'm not sure what to do about it.

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 e2e-tests?

  • 👍 yes
  • 🙅 no, because they aren't needed
  • 🙋 no, because I need help
  • Separate ticket for e2e-tests

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
Copy link
Contributor Author

Skarlso commented Dec 11, 2023

Test output:

➜  mpas git:(gitlab) ✗ ./bin/mpas bootstrap gitlab --owner skarlso --repository=mpas-test-project --personal
Running mpas bootstrap ...
 ✓   Preparing Management repository mpas-test-project
 ✓   Fetching bootstrap component from ghcr.io/open-component-model/mpas-bootstrap-component
 ✓   Installing flux with version v2.1.2
 ✓   Installing cert-manager with version v1.13.2
 ✓   Reconciling bootstrap components
 ✓   Waiting for cert-manager to be available
 ✓   Generating external-secrets-operator manifest with version v0.9.9
 ✓   Generating git-controller manifest with version v0.11.0
 ✓   Generating mpas-product-controller manifest with version v0.10.0
 ✓   Generating mpas-project-controller manifest with version v0.5.0
 ✓   Generating ocm-controller manifest with version v0.18.1
 ✓   Generating replication-controller manifest with version v0.12.2
 ✓   Generating certificate manifests
 ✓   Reconciling component manifests
 ✓   Waiting for components to be ready

Bootstrap completed successfully!
Screenshot 2023-12-11 at 18 28 31

Copy link

github-actions bot commented Dec 11, 2023

Mend Scan Summary: ❌

Repository: open-component-model/MPAS

VIOLATION DESCRIPTION NUMBER OF VIOLATIONS
HIGH/CRITICAL SECURITY VULNERABILITIES 0
MAJOR UPDATES AVAILABLE 0
LICENSE REQUIRES REVIEW 0
LICENSE RISK HIGH 7
RESTRICTIED LICENSE FOR ON-PREMISE DELIVERY 1

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

@Skarlso
Copy link
Contributor Author

Skarlso commented Dec 11, 2023

Uh.

ERROR    Reconciler error    {"controller": "productdeployment", "controllerGroup": "mpas.ocm.software", "controllerKind": "ProductDeployment", "ProductDeployment": {"name":"podinfo","namespace":"mpas-test-001"}, "namespace": "mpas-test-001", "name": "podinfo", "reconcileID": "9813b386-8e70-45f1-8a29-706794ea3b30", "error": "failed to validate config: no config found"}                                                                                              

@Skarlso
Copy link
Contributor Author

Skarlso commented Dec 11, 2023

The GitRepositroy

Conditions:
    Last Transition Time:  2023-12-11T18:36:07Z
    Message:               building artifact
    Observed Generation:   1
    Reason:                ProgressingWithRetry
    Status:                True
    Type:                  Reconciling
    Last Transition Time:  2023-12-11T18:36:07Z
    Message:               failed to configure authentication options: failed to get secret 'mpas-test-001/gitea-credentials': secrets "gitea-credentials" not found
    Observed Generation:   1
    Reason:                AuthenticationFailed
    Status:                False
    Type:                  Ready
    Last Transition Time:  2023-12-11T18:34:32Z
    Message:               failed to configure authentication options: failed to get secret 'mpas-test-001/gitea-credentials': secrets "gitea-credentials" not found
    Observed Generation:   1
    Reason:                AuthenticationFailed
    Status:                True
    Type:                  FetchFailed
  Observed Generation:     -1
Events:
  Type     Reason                Age                  From               Message
  ----     ------                ----                 ----               -------
  Warning  AuthenticationFailed  77s (x7 over 2m52s)  source-controller  failed to configure authentication options: failed to get secret 'mpas-test-001/gitea-credentials': secrets "gitea-credentials" not found

What in tarnasion?

@Skarlso Skarlso requested review from phoban01 and souleb December 12, 2023 11:27
@Skarlso
Copy link
Contributor Author

Skarlso commented Dec 12, 2023

The above error is fixed by git-controller update. :)

cmd/mpas/bootstrap/bootstrap_gitlab.go Outdated Show resolved Hide resolved
internal/bootstrap/provider/provider.go Outdated Show resolved Hide resolved
@phoban01
Copy link
Contributor

Looks good, few small issues.

@Skarlso Skarlso merged commit e5f51b4 into main Dec 14, 2023
7 checks passed
@Skarlso Skarlso deleted the gitlab branch December 14, 2023 12:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Gitlab provider to MPAS cli
2 participants