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

sqlite: complete Pod methods #17615

Merged
merged 14 commits into from
Feb 23, 2023
Merged

Conversation

vrothberg
Copy link
Member

@mheon @baude PTAL

This PRs completes the Pod methods and adds a number of fixes. I was chasing the failure in test/system/220-healthcheck.bats but ran out of time. Many system and e2e tests are passing, so it's now in a state where we can play on the CLI.

Does this PR introduce a user-facing change?

None

[NO NEW TESTS NEEDED] - the sqlite backend is still in development and
is not enabled by default.

Signed-off-by: Valentin Rothberg <[email protected]>
Otherwise we'll fail immediately as the schema version is returned as 0.

Signed-off-by: Valentin Rothberg <[email protected]>
The base table was missing, so we caused a syntax error.

Signed-off-by: Valentin Rothberg <[email protected]>
The value of -1 is used when we do not _yet_ know the exit code of the
container.  Otherwise, the DB checks would error.  There's probably a
smarter than allowing -1 but for now, that will do the trick and let the
tests progress.

Signed-off-by: Valentin Rothberg <[email protected]>
"TABLE" should refer to the actual table.

Signed-off-by: Valentin Rothberg <[email protected]>
The state has been unmarshalled into the config which surfaced in wrong
states.

Signed-off-by: Valentin Rothberg <[email protected]>
Allow to replace existing exit codes.  A container may be started and
stopped multiple times etc.

Signed-off-by: Valentin Rothberg <[email protected]>
As expected by the system tests.

Signed-off-by: Valentin Rothberg <[email protected]>
A number of fixes for pod creation and removal.

The important part is that matching partial IDs requires a trailing `%`
for SQL to interpret it as a wildcard.  More information at
	https://www.sqlitetutorial.net/sqlite-like/

Signed-off-by: Valentin Rothberg <[email protected]>
To return the error message expected by the system tests.

Signed-off-by: Valentin Rothberg <[email protected]>
Requires the trailing `%` to work correctly, see
	https://www.sqlitetutorial.net/sqlite-like/

Signed-off-by: Valentin Rothberg <[email protected]>
Requires the trailing `%` to work correctly, see
        https://www.sqlitetutorial.net/sqlite-like/

Signed-off-by: Valentin Rothberg <[email protected]>
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 23, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vrothberg

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 23, 2023
@vrothberg
Copy link
Member Author

Note that I'll be buried in meetings until the end of the day. Feel free to take over this PR if needed.

// Set up tables
if err := sqliteInitTables(state.conn); err != nil {
return nil, fmt.Errorf("creating tables: %w", err)
}

if err := state.migrateSchemaIfNecessary(); err != nil {
Copy link
Member Author

Choose a reason for hiding this comment

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

@mheon there's probably a better way but this change unblocked me.

Copy link
Member

Choose a reason for hiding this comment

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

Hm. It needs to happen before table init to be safe, so we'll probably have to figure out how to ignore the table-does-not-exist error.

Copy link
Member

Choose a reason for hiding this comment

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

Can do that later though

@baude
Copy link
Member

baude commented Feb 23, 2023

code lgtm, couple of nits

@mheon
Copy link
Member

mheon commented Feb 23, 2023

Code LGTM

@vrothberg
Copy link
Member Author

@mheon feel free to merge and take over the comments. I won't find time today.

@mheon
Copy link
Member

mheon commented Feb 23, 2023

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Feb 23, 2023
@openshift-merge-robot openshift-merge-robot merged commit a3af0f6 into containers:main Feb 23, 2023
@vrothberg vrothberg deleted the RUN-1788 branch February 23, 2023 15:33
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 8, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. release-note-none
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants