Skip to content

Commit f04c904

Browse files
committed
fixup! only call setup function in BeforeClusterCreate
1 parent c644296 commit f04c904

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

pkg/handlers/generic/lifecycle/registry/cncfdistribution/handler.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ func New(
6464
}
6565
}
6666

67+
// Setup ensures any pre-requisites for the CNCF Distribution registry addon are met.
68+
// It is expected to be called before the cluster is created.
69+
// Specifically, it ensures that the CA secret for the registry is created in the cluster's namespace.
6770
func (n *CNCFDistribution) Setup(
6871
ctx context.Context,
6972
_ v1alpha1.RegistryAddon,
@@ -82,6 +85,7 @@ func (n *CNCFDistribution) Setup(
8285
return nil
8386
}
8487

88+
// Apply applies the CNCF Distribution registry addon to the cluster.
8589
func (n *CNCFDistribution) Apply(
8690
ctx context.Context,
8791
_ v1alpha1.RegistryAddon,

pkg/handlers/generic/lifecycle/registry/handler.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ func (r *RegistryHandler) BeforeClusterUpgrade(
9292
resp *runtimehooksv1.BeforeClusterUpgradeResponse,
9393
) {
9494
commonResponse := &runtimehooksv1.CommonResponse{}
95-
r.setup(ctx, &req.Cluster, commonResponse)
9695
r.apply(ctx, &req.Cluster, commonResponse)
9796
resp.Status = commonResponse.GetStatus()
9897
resp.Message = commonResponse.GetMessage()

0 commit comments

Comments
 (0)