Skip to content

Commit

Permalink
Fixes registry re-attachment with minikube (#186)
Browse files Browse the repository at this point in the history
- Fixes re-attachment of existing ctlptl-registry containers when
  deleting and then creating minikube clusters.
  • Loading branch information
ahamilton55 authored Feb 2, 2022
1 parent 8fd1387 commit 0f3b2e4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/cluster/admin_minikube.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,16 @@ func (a *minikubeAdmin) ensureRegistryDisconnected(ctx context.Context, registry
if err != nil {
return errors.Wrap(err, "disconnecting registry")
}

// Remove the network from the current set of networks attached to the registry. This allows the registry to be reconnected after
// a cluster delete and create operation without removing the registry
networks := []string{}
for _, n := range registry.Status.Networks {
if n != networkMode.UserDefined() {
networks = append(networks, n)
}
}
registry.Status.Networks = networks
}
return nil
}
Expand Down

0 comments on commit 0f3b2e4

Please sign in to comment.