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

dockerfile: Split dependencies stage #323

Closed
wants to merge 17 commits into from

Conversation

benwh
Copy link
Contributor

@benwh benwh commented Aug 29, 2023

Make the build slightly quicker, by having a stage which is cached if our dependencies haven't changed.

Make the build slightly quicker, by having a stage which is cached if
our dependencies haven't changed.
Currently, the workloads controller has a hard dependency on
`DirectoryRoleBinding`s, as provided by the RBAC controller, in order to
create consoles. If you try to do this, without having the RBAC
controller installed, then the reconcile loop gets stuck, as the
rolebinding to access the console can't be provisioned.

This is a bit presumptuous; it should be possible to run consoles
without DRBs, e.g. if you just want to reference plain `User` kinds in
`additionalAttachSubjects`.

This change adds a flag, which makes the usage of `DirectoryRoleBinding`
optional. The flag defaults to true, meaning that this isn't a breaking
change.

We intended to use this in conjunction with [Google Groups for RBAC][0]
as an alternative.

[0]: https://cloud.google.com/kubernetes-engine/docs/how-to/google-groups-rbac
Resolve this error:
```
panic: interface conversion: runtime.Object is *v1.Status, not *unstructured.Unstructured
```

There was an assumption of the object type that didn't hold true. If a
watch `ERROR` event type is received, then it should be cast to a `v1.Status`
instead.

To avoid this, skip the event if it's of this type. This is likely fine
for this case, as per the comment.

Also add some extra error handling.

https://github.com/kubernetes/apimachinery/blob/fd8daa85285e31da9771dbe372a66dfa20e78489/pkg/watch/watch.go#L43-L70
Make the package version match the tagged version.
This will include the large change mentioned here: https://github.com/kubernetes-sigs/controller-runtime/releases/tag/v0.15.0

While here, also change the module path, as this looks to be the proper
way of doing things.
Make this compile again, as some options have been moved around.
This brings in the new k8s 1.28.0 fields values.
We're using k8s v1.28 APIs, so let's go to the latest available Kind
image, to run a 1.27 cluster.
Our app was being deployed before `cert-manager` was fully up and
running, leading to theatre pods stuck in a `ContainerCreating` state,
due to a missing secret volume.
Bump the major version, as we've upgraded many things, and may have lost
compatibility with older clusters.
Fixup go.mod versioning issues.
@benwh
Copy link
Contributor Author

benwh commented Jan 30, 2024

Opened this with the wrong source branch, so it now looks quite broken. Can't change the branch so closing, will reopen.

@benwh benwh closed this Jan 30, 2024
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.

None yet

1 participant