Skip to content
This repository was archived by the owner on Dec 2, 2025. It is now read-only.

feat: add conditions and release to replication controller#10

Merged
Skarlso merged 6 commits intomainfrom
conditions
Feb 21, 2023
Merged

feat: add conditions and release to replication controller#10
Skarlso merged 6 commits intomainfrom
conditions

Conversation

@Skarlso
Copy link
Copy Markdown
Contributor

@Skarlso Skarlso commented Feb 16, 2023

Adds the missing conditions and release jobs.

@Skarlso Skarlso requested a review from phoban01 February 16, 2023 15:55
@Skarlso
Copy link
Copy Markdown
Contributor Author

Skarlso commented Feb 16, 2023

@phoban01 so... the replication controller doesn't require a shouldReconcile, right? Because we should always reconcile. :)

@phoban01
Copy link
Copy Markdown
Contributor

Yes I agree @Skarlso

Copy link
Copy Markdown
Contributor

@phoban01 phoban01 left a comment

Choose a reason for hiding this comment

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

Looks good so far.

type OCIRepository struct {
URL string `json:"url"`
SecretRef Ref `json:"secretRef"`
SecretRef *Ref `json:"secretRef,omitempty"`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nice 👍🏻

ComponentDescriptorFetchFailedReason = "ComponentDescriptorFetchFailed"

// PipelineTemplateFetchFailedReason is used when we failed to retrieve the pipeline template.
PipelineTemplateFetchFailedReason = "PipelineTemplateFetchFailed"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

just copy/pasta here perhaps?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah I still have to clean these up and add fails and tests.

Adds the missing conditions and release jobs.
@Skarlso
Copy link
Copy Markdown
Contributor Author

Skarlso commented Feb 17, 2023

TODO:

  • Adding unit tests
  • Doing some manual runs

@Skarlso
Copy link
Copy Markdown
Contributor Author

Skarlso commented Feb 20, 2023

Looks like it's in working order:

time="2023-02-20T09:44:37Z" level=info msg="transferring version" history= logger=ocm version="\"github.com/skarlso/ocm-replication:0.0.1\""
time="2023-02-20T09:44:40Z" level=info msg="  transferring resources" history= logger=ocm version="\"github.com/skarlso/ocm-replication:0.0.1\""
time="2023-02-20T09:44:42Z" level=info msg="adding resource blob" logger=ocm resource=ocm-replication
time="2023-02-20T09:44:45Z" level=info msg="  transferring sources" history= logger=ocm version="\"github.com/skarlso/ocm-replication:0.0.1\""
time="2023-02-20T09:44:45Z" level=info msg="  transferring references" history= logger=ocm version="\"github.com/skarlso/ocm-replication:0.0.1\""
time="2023-02-20T09:44:45Z" level=info msg="  adding component version" history= logger=ocm version="\"github.com/skarlso/ocm-replication:0.0.1\""
2023-02-20T09:44:50Z    INFO    starting reconcile loop {"controller": "componentsubscription", "controllerGroup": "delivery.ocm.software", "controllerKind": "ComponentSubscription", "ComponentSubscription": {"name":"componentsubscription-sample","namespace":"ocm-system"}, "namespace": "ocm-system", "name": "componentsubscription-sample", "reconcileID": "db85bc2c-98df-4f3e-b099-2df4e9fcd5f6", "subscription": {"name":"componentsubscription-sample","namespace":"ocm-system"}}
2023-02-20T09:44:51Z    INFO    latest version and replicated version are a match and not empty {"controller": "componentsubscription", "controllerGroup": "delivery.ocm.software", "controllerKind": "ComponentSubscription", "ComponentSubscription": {"name":"componentsubscription-sample","namespace":"ocm-system"}, "namespace": "ocm-system", "name": "componentsubscription-sample", "reconcileID": "db85bc2c-98df-4f3e-b099-2df4e9fcd5f6"}

And the produced object:

Status:
  Conditions:
    Last Transition Time:  2023-02-20T09:44:51Z
    Message:               Reconciliation success
    Observed Generation:   1
    Reason:                Succeeded
    Status:                True
    Type:                  Ready
  Latest Version:          0.0.1
  Observed Generation:     1
  Replicated Version:      0.0.1
Events:                    <none>

Noice.

@Skarlso
Copy link
Copy Markdown
Contributor Author

Skarlso commented Feb 20, 2023

Okay, things are still working after this massive refactor.

time="2023-02-20T14:32:20Z" level=info msg="transferring version" history= logger=ocm version="\"github.com/skarlso/ocm-replication:0.0.1\""
time="2023-02-20T14:32:23Z" level=info msg="  transferring resources" history= logger=ocm version="\"github.com/skarlso/ocm-replication:0.0.1\""
time="2023-02-20T14:32:24Z" level=info msg="adding resource blob" logger=ocm resource=ocm-replication
time="2023-02-20T14:32:28Z" level=info msg="  transferring sources" history= logger=ocm version="\"github.com/skarlso/ocm-replication:0.0.1\""
time="2023-02-20T14:32:28Z" level=info msg="  transferring references" history= logger=ocm version="\"github.com/skarlso/ocm-replication:0.0.1\""
time="2023-02-20T14:32:28Z" level=info msg="  adding component version" history= logger=ocm version="\"github.com/skarlso/ocm-replication:0.0.1\""
2023-02-20T14:32:28Z    INFO    starting reconcile loop {"controller": "componentsubscription", "controllerGroup": "delivery.ocm.software", "controllerKind": "ComponentSubscription", "ComponentSubscription": {"name":"componentsubscription-sample","namespace":"ocm-system"}, "namespace": "ocm-system", "name": "componentsubscription-sample", "reconcileID": "925e6a80-fe63-4b44-aa66-24656ab3d5b8", "subscription": {"name":"componentsubscription-sample","namespace":"ocm-system"}}

Now... to the tests!

@Skarlso Skarlso marked this pull request as ready for review February 21, 2023 13:34
Copy link
Copy Markdown
Contributor

@phoban01 phoban01 left a comment

Choose a reason for hiding this comment

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

LGTM

@Skarlso Skarlso merged commit 97f613e into main Feb 21, 2023
@Skarlso Skarlso deleted the conditions branch February 21, 2023 14:05
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.

2 participants