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

fix(k8s): correctly set image pull secret on sync pod #6533

Merged
merged 2 commits into from
Oct 15, 2024

Conversation

eysi09
Copy link
Collaborator

@eysi09 eysi09 commented Oct 11, 2024

Before this fix, we'd add image pull secrets with name and namespace to the Pod spec but the namespace field isn't allowed so applying the manifest fails. Now we only add the name.

This isn't caught by the TS compiler because it doesn't check for excess properties (except when using object literals).

That is:

interface Foo {
  foo: string
}

const foo1: Foo = {
  foo: "foo",
  bar: "bar"
} // Doesn't compile, 'bar' does not exist on 'Foo'

const someVar = {
  foo: "foo",
  bar: "bar"
}

const foo2: Foo = someVar // Compiles

TODO:

  • Add tests

@eysi09 eysi09 enabled auto-merge October 11, 2024 19:49
@eysi09 eysi09 disabled auto-merge October 12, 2024 08:21
@eysi09 eysi09 marked this pull request as draft October 12, 2024 08:21
@eysi09 eysi09 force-pushed the fix-sync-util-secrets-spec branch from ba9d3d6 to 678ea4a Compare October 12, 2024 09:07
@eysi09 eysi09 marked this pull request as ready for review October 12, 2024 09:07
@eysi09 eysi09 enabled auto-merge October 12, 2024 09:07
@eysi09 eysi09 marked this pull request as draft October 13, 2024 10:51
auto-merge was automatically disabled October 13, 2024 10:51

Pull request was converted to draft

@eysi09 eysi09 changed the title fix(k8s): correctly set image pull secret on sync pod fix(k8s): correctly set image pull secret on sync pod (WIP) Oct 13, 2024
@twelvemo
Copy link
Collaborator

Oh, good catch 👍 I oversaw that.

@eysi09
Copy link
Collaborator Author

eysi09 commented Oct 14, 2024

Just adding some tests before I flag as ready for review

@eysi09 eysi09 force-pushed the fix-sync-util-secrets-spec branch from 678ea4a to 26481cf Compare October 14, 2024 14:48
Before this fix, we'd add image pull secrets with name and namespace to
the Pod spec but the namespace field isn't allowed so applying the
manifest fails.

Now we only add the name. Also added test for the 'configureSyncMode'
function.

The compiler didn't catch this because it allows excess properties
(except for object literals).
@eysi09 eysi09 force-pushed the fix-sync-util-secrets-spec branch from 26481cf to a89f2e0 Compare October 15, 2024 07:35
@eysi09 eysi09 marked this pull request as ready for review October 15, 2024 08:25
@eysi09 eysi09 requested a review from twelvemo October 15, 2024 08:26
@eysi09
Copy link
Collaborator Author

eysi09 commented Oct 15, 2024

FYI: Added tests and also re-enabled the tests that were being skipped. Not quite sure what the original issue was but I refactored the code a bit and now they seem to pass.

@eysi09 eysi09 changed the title fix(k8s): correctly set image pull secret on sync pod (WIP) fix(k8s): correctly set image pull secret on sync pod Oct 15, 2024
Copy link
Collaborator

@twelvemo twelvemo left a comment

Choose a reason for hiding this comment

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

Great job on the tests! Super nice to have all of these in place now!

@twelvemo twelvemo added this pull request to the merge queue Oct 15, 2024
Merged via the queue into main with commit a2826a9 Oct 15, 2024
40 checks passed
@twelvemo twelvemo deleted the fix-sync-util-secrets-spec branch October 15, 2024 11:21
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