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

Add empty controller and API for VerticaRestorePoints #643

Merged
merged 8 commits into from
Dec 20, 2023

Conversation

chinhtranvan
Copy link
Collaborator

@chinhtranvan chinhtranvan commented Dec 19, 2023

This PR build out the stub for an empty controller to handle the VerticaRestorePointsQuery API. It does not include a webhook, as there are no defined rules for transitioning the Custom Resource (CR), given that the spec portion contains only two fields. The operator can observe the new API, initiate a reconciliation iteration, and take no action, as we have set nil for the actors during this implementation phase

@chinhtranvan chinhtranvan changed the title WIP Add empty controller and API for VerticaRestorePoints Dec 19, 2023
@spilchen spilchen changed the base branch from main to vnext December 19, 2023 12:12
@spilchen
Copy link
Collaborator

This has to merge into vnext. I changed the base of the PR, but I see a bunch of changes in there that you probably didn't do. I would suggest that you rebase with vnext and force push the changes up to GitHub.

PROJECT Outdated Show resolved Hide resolved
api/v1/verticarestorepointsquery_types.go Outdated Show resolved Hide resolved
api/v1/verticarestorepointsquery_types.go Outdated Show resolved Hide resolved
api/v1/verticarestorepointsquery_types.go Outdated Show resolved Hide resolved
cmd/operator/main.go Outdated Show resolved Hide resolved
config/samples/v1_verticarestorepointsquery.yaml Outdated Show resolved Hide resolved
@chinhtranvan chinhtranvan force-pushed the chinh/add-empty-controller-and-API branch from 682325d to 50142f0 Compare December 19, 2023 15:41
@chinhtranvan chinhtranvan force-pushed the chinh/add-empty-controller-and-API branch from 50142f0 to c226abe Compare December 19, 2023 15:58
@chinhtranvan
Copy link
Collaborator Author

chinhtranvan commented Dec 19, 2023

I'm not sure about the scorecard tests; I have run them successfully on my local machine using the command operator-sdk scorecard bundle

--------------------------------------------------------------------------------
Image:      quay.io/operator-framework/scorecard-test:v1.5.0
Entrypoint: [scorecard-test olm-crds-have-resources]
Labels:
        "suite":"olm"
        "test":"olm-crds-have-resources-test"
Results:
        Name: olm-crds-have-resources
        State: pass

        Log:
                Loaded ClusterServiceVersion: verticadb-operator.v2.0.0


--------------------------------------------------------------------------------
Image:      quay.io/operator-framework/scorecard-test:v1.5.0
Entrypoint: [scorecard-test basic-check-spec]
Labels:
        "suite":"basic"
        "test":"basic-check-spec-test"
Results:
        Name: basic-check-spec
        State: pass



--------------------------------------------------------------------------------
Image:      quay.io/operator-framework/scorecard-test:v1.5.0
Entrypoint: [scorecard-test olm-status-descriptors]
Labels:
        "suite":"olm"
        "test":"olm-status-descriptors-test"
Results:
        Name: olm-status-descriptors
        State: pass

        Log:
                Loaded ClusterServiceVersion: verticadb-operator.v2.0.0
                Loaded 4 Custom Resources from alm-examples

but Github CI complains this https://github.com/vertica/vertica-kubernetes/actions/runs/7264951541/job/19793584148?pr=643

--------------------------------------------------------------------------------
Image:      quay.io/operator-framework/scorecard-test:v1.5.0
Entrypoint: [scorecard-test olm-status-descriptors]
Labels:
	"suite":"olm"
	"test":"olm-status-descriptors-test"
Results:
	Name: olm-status-descriptors
	State: fail

	Errors:
		verticarestorepointsqueries.vertica.com does not have a status descriptor
	Log:
		Loaded ClusterServiceVersion: verticadb-operator.v2.0.0
		Loaded 5 Custom Resources from alm-examples
--------------------------------------------------------------------------------
Image:      quay.io/operator-framework/scorecard-test:v1.5.0
Entrypoint: [scorecard-test olm-crds-have-resources]
Labels:
	"suite":"olm"
	"test":"olm-crds-have-resources-test"
Results:
	Name: olm-crds-have-resources
	State: fail

	Errors:
		Owned CRDs do not have resources specified
	Log:
		Loaded ClusterServiceVersion: verticadb-operator.v2.0.0

That happens because VerticaRestorePointsQueryStatus has no fields you can addCSV markers too. But normally in the recent version of operator-sdk we should just get a warning. @spilchen is there already a field for VerticaRestorePointsQueryStatus ?
Also we are using quay.io/operator-framework/scorecard-test:v1.5.0, any reason why we are using a more recent version?

@chinhtranvan
Copy link
Collaborator Author

chinhtranvan commented Dec 19, 2023

Update, I added 'RestorePoints' to the status and changed the resource to address the issue. However, please feel free to let me know if there is a bettern name for status field

pkg/opcfg/config.go Outdated Show resolved Hide resolved
pkg/opcfg/config.go Outdated Show resolved Hide resolved
@spilchen
Copy link
Collaborator

Update, I added 'RestorePoints' to the status and changed the resource to address the issue. However, please feel free to let me know if there is a bettern name for status field

This is fine for now. I expect to fill in valid status fields later.

@spilchen spilchen merged commit 2abd8f1 into vnext Dec 20, 2023
27 checks passed
@spilchen spilchen deleted the chinh/add-empty-controller-and-API branch December 20, 2023 19:03
chinhtranvan added a commit that referenced this pull request Jan 27, 2024
This PR build out the stub for an empty controller to handle the
VerticaRestorePointsQuery API. It does not include a webhook, as there
are no defined rules for transitioning the Custom Resource (CR), given
that the spec portion contains only two fields. The operator can observe
the new API, initiate a reconciliation iteration, and take no action, as
we have set nil for the actors during this implementation phase

---------

Co-authored-by: Matt Spilchen <[email protected]>
chinhtranvan added a commit that referenced this pull request Jan 27, 2024
This PR build out the stub for an empty controller to handle the
VerticaRestorePointsQuery API. It does not include a webhook, as there
are no defined rules for transitioning the Custom Resource (CR), given
that the spec portion contains only two fields. The operator can observe
the new API, initiate a reconciliation iteration, and take no action, as
we have set nil for the actors during this implementation phase

---------

Co-authored-by: Matt Spilchen <[email protected]>
chinhtranvan added a commit that referenced this pull request Feb 17, 2024
This PR creates a webhook for the new VerticaRestorePointQuery CR to
catch the checks early. There is some webhook part that is added in
#643."
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.

2 participants