Skip to content

Commit

Permalink
MGMT-19120: Use service net to connect to hosted API server
Browse files Browse the repository at this point in the history
There are several situations where assisted service needs to connect to
the API server of a spoke cluster. To do so it uses the kubeconfig
generated during the installation, and that usually contains the
external URL of the API server, and that means that the cluster where
assisted service runs needs to be configured with a proxy that allows
that. But for HyperShift clusters this can be avoided: assisted service
can instead connect via the service network, using the
`kube-apiserver.my-cluster.svc` host name, as the API server runs as a
pod in the same cluster. Doing that reduces the number of round trips
and the potential proxy configuration issues. In order to achive that
this patch changes the spoke client factory so that it checks if the
cluster is a HyperShift cluster, and then it replaces the API server URL
with `https://kube-apiserver.my-cluster.svc:6443`.

Related: https://issues.redhat.com/browse/MGMT-19120
Signed-off-by: Juan Hernandez <juan.hernandez@redhat.com>
  • Loading branch information
jhernand committed Dec 16, 2024
1 parent c594d22 commit 3e7178a
Show file tree
Hide file tree
Showing 21 changed files with 812 additions and 342 deletions.
12 changes: 9 additions & 3 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,12 @@ func main() {
InsecureIPXEURLs: generateInsecureIPXEURLs,
}).SetupWithManager(ctrlMgr), "unable to create controller InfraEnv")

spokeClientFactory, err := spoke_k8s_client.NewFactory().
SetLogger(log).
SetHubClient(c).
Build()
failOnError(err, "unable to create spoke client factory")

cluster_client := ctrlMgr.GetClient()
cluster_reader := ctrlMgr.GetAPIReader()
failOnError((&controllers.ClusterDeploymentsReconciler{
Expand All @@ -636,7 +642,7 @@ func main() {
PullSecretHandler: controllers.NewPullSecretHandler(cluster_client, cluster_reader, bm),
AuthType: Options.Auth.AuthType,
VersionsHandler: versionHandler,
SpokeK8sClientFactory: spoke_k8s_client.NewSpokeK8sClientFactory(log),
SpokeK8sClientFactory: spokeClientFactory,
MirrorRegistriesConfigBuilder: mirrorregistries.New(),
}).SetupWithManager(ctrlMgr), "unable to create controller ClusterDeployment")

Expand All @@ -649,7 +655,7 @@ func main() {
CRDEventsHandler: crdEventsHandler,
ServiceBaseURL: Options.BMConfig.ServiceBaseURL,
AuthType: Options.Auth.AuthType,
SpokeK8sClientFactory: spoke_k8s_client.NewSpokeK8sClientFactory(log),
SpokeK8sClientFactory: spokeClientFactory,
ApproveCsrsRequeueDuration: Options.ApproveCsrsRequeueDuration,
AgentContainerImage: Options.BMConfig.AgentDockerImg,
HostFSMountDir: hostFSMountDir,
Expand All @@ -661,7 +667,7 @@ func main() {
Log: log,
Scheme: ctrlMgr.GetScheme(),
Installer: bm,
SpokeK8sClientFactory: spoke_k8s_client.NewSpokeK8sClientFactory(log),
SpokeK8sClientFactory: spokeClientFactory,
ConvergedFlowEnabled: useConvergedFlow,
PauseProvisionedBMHs: Options.PauseProvisionedBMHs,
Drainer: &controllers.KubectlDrainer{},
Expand Down
9 changes: 8 additions & 1 deletion cmd/operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,14 @@ func main() {
}

log := logrus.New()
spokeClientFactory := spoke_k8s_client.NewSpokeK8sClientFactory(log)
spokeClientFactory, err := spoke_k8s_client.NewFactory().
SetLogger(log).
SetHubClient(mgr.GetClient()).
Build()
if err != nil {
log.WithError(err).Error("failed to create spoke client factory")
os.Exit(1)
}
spokeClientCache := controllers.NewSpokeClientCache(spokeClientFactory)

c, err := client.New(mgr.GetConfig(), client.Options{Scheme: mgr.GetScheme()})
Expand Down
7 changes: 7 additions & 0 deletions hack/start_db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,11 @@ mkdir -p /tmp/postgres/data
mkdir -p /tmp/postgres/sockets

initdb -D /tmp/postgres/data -U postgres

# We store the data files in the `/tmp` directory assuming that it will be a `tmpfs` and therefore
# very fast. But in some environments it may not be, as it may be mapped to a real persistent file
# system. Disabling `fsync` speeds things up in those environment, at the cost of risking data loss,
# but we don't really care about that, otherwise we woudn't be using `/tmp`.
echo "fsync=off" >> /tmp/postgres/data/postgresql.conf

pg_ctl -D /tmp/postgres/data -l /tmp/postgres/logfile -o'-k /tmp/postgres/sockets -p 5433' start
20 changes: 12 additions & 8 deletions internal/controller/controllers/agent_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ type AgentReconciler struct {
CRDEventsHandler CRDEventsHandler
ServiceBaseURL string
AuthType auth.AuthType
SpokeK8sClientFactory spoke_k8s_client.SpokeK8sClientFactory
SpokeK8sClientFactory spoke_k8s_client.Factory
ApproveCsrsRequeueDuration time.Duration
AgentContainerImage string
HostFSMountDir string
Expand Down Expand Up @@ -360,7 +360,7 @@ func deleteBMHForMachine(ctx context.Context, spokeClient client.Client, machine

// removeSpokeResources removes all relevant resources from the agent's spoke cluster
// This includes all or some of the node, machine, BMH, and scaling the machineset depending on what is present
func removeSpokeResources(ctx context.Context, log logrus.FieldLogger, spokeClient spoke_k8s_client.SpokeK8sClient, nodeName string) error {
func removeSpokeResources(ctx context.Context, log logrus.FieldLogger, spokeClient spoke_k8s_client.Client, nodeName string) error {
log = log.WithField("node", nodeName)

nodeKey := client.ObjectKey{Name: nodeName}
Expand Down Expand Up @@ -540,7 +540,7 @@ func (r *AgentReconciler) shouldApproveCSR(csr *certificatesv1.CertificateSignin
return validateNodeCsr(agent, csr, x509CSR)
}

func (r *AgentReconciler) approveAIHostsCSRs(ctx context.Context, clients spoke_k8s_client.SpokeK8sClient, agent *aiv1beta1.Agent, validateNodeCsr nodeCsrValidator) {
func (r *AgentReconciler) approveAIHostsCSRs(ctx context.Context, clients spoke_k8s_client.Client, agent *aiv1beta1.Agent, validateNodeCsr nodeCsrValidator) {
csrList, err := clients.ListCsrs(ctx)
if err != nil {
r.Log.WithError(err).Errorf("Failed to get CSRs for agent %s/%s", agent.Namespace, agent.Name)
Expand All @@ -565,18 +565,22 @@ func (r *AgentReconciler) approveAIHostsCSRs(ctx context.Context, clients spoke_
}
}

func (r *AgentReconciler) spokeKubeClient(ctx context.Context, clusterRef *aiv1beta1.ClusterReference) (spoke_k8s_client.SpokeK8sClient, error) {
func (r *AgentReconciler) spokeKubeClient(ctx context.Context, clusterRef *aiv1beta1.ClusterReference) (spoke_k8s_client.Client, error) {
secret, err := spokeKubeconfigSecret(ctx, r.Log, r.Client, r.APIReader, clusterRef)
if err != nil {
r.Log.WithError(err).Errorf("failed to get spoke secret for cluster %s/%s", clusterRef.Namespace, clusterRef.Name)
return nil, err
}
return r.SpokeK8sClientFactory.CreateFromSecret(secret)
clusterKey := types.NamespacedName{
Namespace: clusterRef.Namespace,
Name: clusterRef.Name,
}
return r.SpokeK8sClientFactory.CreateFromSecret(ctx, clusterKey, secret)
}

// Attempt to approve CSRs for agent. If already approved then the node will be marked as done
// requeue means that approval will be attempted again
func (r *AgentReconciler) tryApproveDay2CSRs(ctx context.Context, agent *aiv1beta1.Agent, node *corev1.Node, client spoke_k8s_client.SpokeK8sClient) {
func (r *AgentReconciler) tryApproveDay2CSRs(ctx context.Context, agent *aiv1beta1.Agent, node *corev1.Node, client spoke_k8s_client.Client) {
r.Log.Infof("Approving CSRs for agent %s/%s", agent.Namespace, agent.Name)
var validateNodeCsr nodeCsrValidator

Expand Down Expand Up @@ -771,7 +775,7 @@ func marshalNodeLabels(nodeLabels map[string]string) (string, error) {
return string(b), err
}

func (r *AgentReconciler) applyDay2NodeLabels(ctx context.Context, log logrus.FieldLogger, agent *aiv1beta1.Agent, node *corev1.Node, client spoke_k8s_client.SpokeK8sClient) error {
func (r *AgentReconciler) applyDay2NodeLabels(ctx context.Context, log logrus.FieldLogger, agent *aiv1beta1.Agent, node *corev1.Node, client spoke_k8s_client.Client) error {
if funk.IsEmpty(agent.Spec.NodeLabels) || !isNodeReady(node) {
return nil
}
Expand Down Expand Up @@ -805,7 +809,7 @@ func (r *AgentReconciler) updateStatus(ctx context.Context, log logrus.FieldLogg
var (
err error
shouldAutoApproveCSRs bool
spokeClient spoke_k8s_client.SpokeK8sClient
spokeClient spoke_k8s_client.Client
node *corev1.Node
)
ret := ctrl.Result{}
Expand Down
68 changes: 34 additions & 34 deletions internal/controller/controllers/agent_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ var _ = Describe("agent reconcile", func() {
sId strfmt.UUID
backEndCluster *common.Cluster
ignitionEndpointTokenSecretName = "ignition-endpoint-secret"
mockClientFactory *spoke_k8s_client.MockSpokeK8sClientFactory
mockClientFactory *spoke_k8s_client.MockFactory
agentImage = "registry.example.com/assisted-installer/agent:latest"
)

Expand All @@ -98,7 +98,7 @@ var _ = Describe("agent reconcile", func() {
WithStatusSubresource(&v1beta1.Agent{}).Build()
mockCtrl = gomock.NewController(GinkgoT())
mockInstallerInternal = bminventory.NewMockInstallerInternals(mockCtrl)
mockClientFactory = spoke_k8s_client.NewMockSpokeK8sClientFactory(mockCtrl)
mockClientFactory = spoke_k8s_client.NewMockFactory(mockCtrl)

hr = &AgentReconciler{
Client: c,
Expand Down Expand Up @@ -599,8 +599,8 @@ var _ = Describe("agent reconcile", func() {
allowGetInfraEnvInternal(mockInstallerInternal, infraEnvId, "infraEnvName")
Expect(c.Create(ctx, host)).To(BeNil())
createKubeconfigSecret(clusterDeployment.Name)
mockClient := spoke_k8s_client.NewMockSpokeK8sClient(mockCtrl)
mockClientFactory.EXPECT().CreateFromSecret(gomock.Any()).Return(mockClient, nil).AnyTimes()
mockClient := spoke_k8s_client.NewMockClient(mockCtrl)
mockClientFactory.EXPECT().CreateFromSecret(gomock.Any(), gomock.Any(), gomock.Any()).Return(mockClient, nil).AnyTimes()
mockClient.EXPECT().GetNode(gomock.Any(), gomock.Any()).Return(nil, k8serrors.NewNotFound(schema.GroupResource{Group: "v1", Resource: "Node"}, commonHost.RequestedHostname)).Times(1)

result, err := hr.Reconcile(ctx, newHostRequest(host))
Expand Down Expand Up @@ -629,8 +629,8 @@ var _ = Describe("agent reconcile", func() {
}
Expect(c.Create(ctx, host)).To(BeNil())
createKubeconfigSecret(clusterDeployment.Name)
mockClient := spoke_k8s_client.NewMockSpokeK8sClient(mockCtrl)
mockClientFactory.EXPECT().CreateFromSecret(gomock.Any()).Return(mockClient, nil).AnyTimes()
mockClient := spoke_k8s_client.NewMockClient(mockCtrl)
mockClientFactory.EXPECT().CreateFromSecret(gomock.Any(), gomock.Any(), gomock.Any()).Return(mockClient, nil).AnyTimes()
node := &corev1.Node{
TypeMeta: metav1.TypeMeta{},
ObjectMeta: metav1.ObjectMeta{
Expand Down Expand Up @@ -677,8 +677,8 @@ var _ = Describe("agent reconcile", func() {
}
Expect(c.Create(ctx, host)).To(BeNil())
createKubeconfigSecret(clusterDeployment.Name)
mockClient := spoke_k8s_client.NewMockSpokeK8sClient(mockCtrl)
mockClientFactory.EXPECT().CreateFromSecret(gomock.Any()).Return(mockClient, nil).AnyTimes()
mockClient := spoke_k8s_client.NewMockClient(mockCtrl)
mockClientFactory.EXPECT().CreateFromSecret(gomock.Any(), gomock.Any(), gomock.Any()).Return(mockClient, nil).AnyTimes()
node := &corev1.Node{
TypeMeta: metav1.TypeMeta{},
ObjectMeta: metav1.ObjectMeta{
Expand Down Expand Up @@ -976,8 +976,8 @@ var _ = Describe("agent reconcile", func() {
createKubeconfigSecret()
expectDBClusterWithKubeKeys()

mockClient := spoke_k8s_client.NewMockSpokeK8sClient(mockCtrl)
mockClientFactory.EXPECT().CreateFromSecret(gomock.Any()).Return(mockClient, nil).AnyTimes()
mockClient := spoke_k8s_client.NewMockClient(mockCtrl)
mockClientFactory.EXPECT().CreateFromSecret(gomock.Any(), gomock.Any(), gomock.Any()).Return(mockClient, nil).AnyTimes()
mockClient.EXPECT().Get(gomock.Any(), gomock.Any(), gomock.AssignableToTypeOf(&corev1.Namespace{})).Return(nil)
mockClient.EXPECT().Get(gomock.Any(), gomock.Any(), gomock.AssignableToTypeOf(&corev1.ServiceAccount{})).Return(nil)
mockClient.EXPECT().Get(gomock.Any(), gomock.Any(), gomock.AssignableToTypeOf(&authzv1.Role{})).Return(nil)
Expand Down Expand Up @@ -1008,7 +1008,7 @@ var _ = Describe("agent reconcile", func() {
createKubeconfigSecret()
expectDBClusterWithKubeKeys()

mockClientFactory.EXPECT().CreateFromSecret(gomock.Any()).Return(nil, errors.New("failed to create client"))
mockClientFactory.EXPECT().CreateFromSecret(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil, errors.New("failed to create client"))

mockInstallerInternal.EXPECT().UnbindHostInternal(gomock.Any(), gomock.Any(), false, bminventory.NonInteractive).Return(commonHost, nil)
result, err := hr.Reconcile(ctx, newHostRequest(host))
Expand All @@ -1021,8 +1021,8 @@ var _ = Describe("agent reconcile", func() {
createKubeconfigSecret()
expectDBClusterWithKubeKeys()

mockClient := spoke_k8s_client.NewMockSpokeK8sClient(mockCtrl)
mockClientFactory.EXPECT().CreateFromSecret(gomock.Any()).Return(mockClient, nil).AnyTimes()
mockClient := spoke_k8s_client.NewMockClient(mockCtrl)
mockClientFactory.EXPECT().CreateFromSecret(gomock.Any(), gomock.Any(), gomock.Any()).Return(mockClient, nil).AnyTimes()
mockClient.EXPECT().Get(gomock.Any(), gomock.Any(), gomock.AssignableToTypeOf(&corev1.Namespace{})).Return(nil)
mockClient.EXPECT().Get(gomock.Any(), gomock.Any(), gomock.AssignableToTypeOf(&corev1.ServiceAccount{})).Return(nil)
mockClient.EXPECT().Get(gomock.Any(), gomock.Any(), gomock.AssignableToTypeOf(&authzv1.Role{})).Return(nil)
Expand Down Expand Up @@ -1340,7 +1340,7 @@ var _ = Describe("agent reconcile", func() {
clusterDeploymentName = "test-cluster"
agent *v1beta1.Agent
agentHostname = "agent.example.com"
spokeClient spoke_k8s_client.SpokeK8sClient
spokeClient spoke_k8s_client.Client
host *common.Host
)

Expand Down Expand Up @@ -1404,7 +1404,7 @@ var _ = Describe("agent reconcile", func() {
schemes := GetKubeClientSchemes()
fakeClient := fakeclient.NewClientBuilder().WithScheme(schemes).Build()
spokeClient = fakeSpokeK8sClient{Client: fakeClient}
mockClientFactory.EXPECT().CreateFromSecret(gomock.Any()).Return(spokeClient, nil).AnyTimes()
mockClientFactory.EXPECT().CreateFromSecret(gomock.Any(), gomock.Any(), gomock.Any()).Return(spokeClient, nil).AnyTimes()
node := &corev1.Node{ObjectMeta: metav1.ObjectMeta{Name: agentHostname}}
Expect(spokeClient.Create(ctx, node)).To(Succeed())
}
Expand Down Expand Up @@ -1468,8 +1468,8 @@ var _ = Describe("agent reconcile", func() {
}
Expect(c.Create(ctx, agent)).To(Succeed())

mockSpokeClient := spoke_k8s_client.NewMockSpokeK8sClient(mockCtrl)
mockClientFactory.EXPECT().CreateFromSecret(gomock.Any()).Return(mockSpokeClient, nil).AnyTimes()
mockSpokeClient := spoke_k8s_client.NewMockClient(mockCtrl)
mockClientFactory.EXPECT().CreateFromSecret(gomock.Any(), gomock.Any(), gomock.Any()).Return(mockSpokeClient, nil).AnyTimes()
mockSpokeClient.EXPECT().Get(gomock.Any(), client.ObjectKey{Name: agentHostname}, gomock.Any()).Return(fmt.Errorf("get-failed"))

result, err := hr.Reconcile(ctx, newHostRequest(agent))
Expand Down Expand Up @@ -2300,7 +2300,7 @@ VU1eS0RiS/Lz6HwRs2mATNY5FrpZOgdM3cI=
agentKey types.NamespacedName
hostId strfmt.UUID
mockInstallerInternal *bminventory.MockInstallerInternals
mockClientFactory *spoke_k8s_client.MockSpokeK8sClientFactory
mockClientFactory *spoke_k8s_client.MockFactory
commonHost *common.Host
)
newAciWithUserManagedNetworkingNoSNO := func(name, namespace string) *hiveext.AgentClusterInstall {
Expand Down Expand Up @@ -2497,7 +2497,7 @@ VU1eS0RiS/Lz6HwRs2mATNY5FrpZOgdM3cI=
WithStatusSubresource(&v1beta1.Agent{}).Build()
mockCtrl = gomock.NewController(GinkgoT())
mockInstallerInternal = bminventory.NewMockInstallerInternals(mockCtrl)
mockClientFactory = spoke_k8s_client.NewMockSpokeK8sClientFactory(mockCtrl)
mockClientFactory = spoke_k8s_client.NewMockFactory(mockCtrl)
hr = &AgentReconciler{
Client: c,
Scheme: scheme.Scheme,
Expand Down Expand Up @@ -3084,8 +3084,8 @@ VU1eS0RiS/Lz6HwRs2mATNY5FrpZOgdM3cI=
}
Expect(c.Create(ctx, host)).To(BeNil())
if t.createClient {
mockClient := spoke_k8s_client.NewMockSpokeK8sClient(mockCtrl)
mockClientFactory.EXPECT().CreateFromSecret(gomock.Any()).Return(mockClient, nil)
mockClient := spoke_k8s_client.NewMockClient(mockCtrl)
mockClientFactory.EXPECT().CreateFromSecret(gomock.Any(), gomock.Any(), gomock.Any()).Return(mockClient, nil)
mockClient.EXPECT().GetNode(gomock.Any(), gomock.Any()).Return(t.node, t.nodeError).Times(t.getNodeCount)
if t.csrs != nil {
mockClient.EXPECT().ListCsrs(gomock.Any()).Return(t.csrs, nil)
Expand Down Expand Up @@ -3869,15 +3869,15 @@ var _ = Describe("spokeKubeClient", func() {
cdSpec hivev1.ClusterDeploymentSpec
hr *AgentReconciler
mockCtrl *gomock.Controller
mockClientFactory *spoke_k8s_client.MockSpokeK8sClientFactory
mockClientFactory *spoke_k8s_client.MockFactory
ref *v1beta1.ClusterReference
)

BeforeEach(func() {
c = fakeclient.NewClientBuilder().WithScheme(scheme.Scheme).
WithStatusSubresource(&v1beta1.Agent{}).Build()
mockCtrl = gomock.NewController(GinkgoT())
mockClientFactory = spoke_k8s_client.NewMockSpokeK8sClientFactory(mockCtrl)
mockClientFactory = spoke_k8s_client.NewMockFactory(mockCtrl)
hr = &AgentReconciler{
Client: c,
Log: common.GetTestLog(),
Expand Down Expand Up @@ -3915,8 +3915,8 @@ var _ = Describe("spokeKubeClient", func() {
}
Expect(c.Create(ctx, secret)).To(Succeed())

mockClientFactory.EXPECT().CreateFromSecret(gomock.Any()).Do(
func(s *corev1.Secret) (spoke_k8s_client.SpokeK8sClient, error) {
mockClientFactory.EXPECT().CreateFromSecret(gomock.Any(), gomock.Any(), gomock.Any()).Do(
func(_ context.Context, _ types.NamespacedName, s *corev1.Secret) (spoke_k8s_client.Client, error) {
Expect(s.Name).To(Equal(adminSecretName))
return nil, nil
},
Expand Down Expand Up @@ -3950,8 +3950,8 @@ var _ = Describe("spokeKubeClient", func() {
}
Expect(c.Create(ctx, secret)).To(Succeed())

mockClientFactory.EXPECT().CreateFromSecret(gomock.Any()).Do(
func(s *corev1.Secret) (spoke_k8s_client.SpokeK8sClient, error) {
mockClientFactory.EXPECT().CreateFromSecret(gomock.Any(), gomock.Any(), gomock.Any()).Do(
func(_ context.Context, _ types.NamespacedName, s *corev1.Secret) (spoke_k8s_client.Client, error) {
Expect(s.Name).To(Equal(secretName))
return nil, nil
},
Expand All @@ -3970,7 +3970,7 @@ var _ = Describe("handleAgentFinalizer", func() {
mockCtrl *gomock.Controller
mockClient *MockK8sClient
mockInstallerInternal *bminventory.MockInstallerInternals
mockClientFactory *spoke_k8s_client.MockSpokeK8sClientFactory
mockClientFactory *spoke_k8s_client.MockFactory
agent *v1beta1.Agent
agentHostname = "host.example.com"
)
Expand All @@ -3979,7 +3979,7 @@ var _ = Describe("handleAgentFinalizer", func() {
mockCtrl = gomock.NewController(GinkgoT())
mockClient = NewMockK8sClient(mockCtrl)
mockInstallerInternal = bminventory.NewMockInstallerInternals(mockCtrl)
mockClientFactory = spoke_k8s_client.NewMockSpokeK8sClientFactory(mockCtrl)
mockClientFactory = spoke_k8s_client.NewMockFactory(mockCtrl)

r = &AgentReconciler{
Client: mockClient,
Expand Down Expand Up @@ -4039,7 +4039,7 @@ var _ = Describe("handleAgentFinalizer", func() {

Context("agent is being deleted with the finalizer set", func() {
var (
fakeSpokeClient spoke_k8s_client.SpokeK8sClient
fakeSpokeClient spoke_k8s_client.Client
)

expectAgentFinalizerRemoved := func() {
Expand Down Expand Up @@ -4089,8 +4089,8 @@ var _ = Describe("handleAgentFinalizer", func() {
},
).AnyTimes()

mockClientFactory.EXPECT().CreateFromSecret(gomock.AssignableToTypeOf(&corev1.Secret{})).DoAndReturn(
func(secret *corev1.Secret) (spoke_k8s_client.SpokeK8sClient, error) {
mockClientFactory.EXPECT().CreateFromSecret(gomock.Any(), gomock.Any(), gomock.AssignableToTypeOf(&corev1.Secret{})).DoAndReturn(
func(_ context.Context, _ types.NamespacedName, secret *corev1.Secret) (spoke_k8s_client.Client, error) {
Expect(secret.Data["kubeconfig"]).To(Equal([]byte("definitely_a_kubeconfig")))
return fakeSpokeClient, nil
},
Expand Down Expand Up @@ -4298,7 +4298,7 @@ var _ = Describe("Restore Host - Reconcile an Agent with missing Host", func() {
mockInstallerInternal *bminventory.MockInstallerInternals
sId strfmt.UUID
backEndCluster *common.Cluster
mockClientFactory *spoke_k8s_client.MockSpokeK8sClientFactory
mockClientFactory *spoke_k8s_client.MockFactory
agentImage = "registry.example.com/assisted-installer/agent:latest"
)

Expand All @@ -4307,7 +4307,7 @@ var _ = Describe("Restore Host - Reconcile an Agent with missing Host", func() {
WithStatusSubresource(&v1beta1.Agent{}).Build()
mockCtrl = gomock.NewController(GinkgoT())
mockInstallerInternal = bminventory.NewMockInstallerInternals(mockCtrl)
mockClientFactory = spoke_k8s_client.NewMockSpokeK8sClientFactory(mockCtrl)
mockClientFactory = spoke_k8s_client.NewMockFactory(mockCtrl)

hr = &AgentReconciler{
Client: c,
Expand Down
Loading

0 comments on commit 3e7178a

Please sign in to comment.