Skip to content

Commit

Permalink
Deploy router controller resource from bundle
Browse files Browse the repository at this point in the history
As part of crc-org/snc#738, we put
router-controller resource as part of bundle and from crc side
we don't need to generate this resource. In this PR we check if
the resource is part of the bundle then use that otherwise go with
current flow to support older 4.13.x bundle.
  • Loading branch information
praveenkumar committed Jun 22, 2023
1 parent e330d87 commit 7cf9765
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/crc/machine/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,13 @@ func logBundleDate(crcBundleMetadata *bundle.CrcBundleInfo) {
}

func ensureRoutesControllerIsRunning(sshRunner *crcssh.Runner, ocConfig oc.Config, preset crcPreset.Preset, bundleInfo *bundle.CrcBundleInfo) error {
// Check if the bundle have `/opt/crc/route_controller.yaml` file and if it has
// then use it to create the resource for router controller.
if _, _, err := sshRunner.Run("ls", "/opt/crc/route_controller.yaml"); err == nil {
_, _, err := ocConfig.RunOcCommand("apply", "-f", "/opt/crc/route_controller.yaml")
return err
}
// TODO: Remove this resource creation after crc 2.24 release
bin, err := json.Marshal(v1.Pod{
TypeMeta: metav1.TypeMeta{
Kind: "Pod",
Expand Down

0 comments on commit 7cf9765

Please sign in to comment.