File tree Expand file tree Collapse file tree 2 files changed +4
-12
lines changed
pkg/handlers/generic/lifecycle/registry Expand file tree Collapse file tree 2 files changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,9 @@ func New(
64
64
}
65
65
}
66
66
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.
67
70
func (n * CNCFDistribution ) Setup (
68
71
ctx context.Context ,
69
72
_ v1alpha1.RegistryAddon ,
@@ -82,23 +85,13 @@ func (n *CNCFDistribution) Setup(
82
85
return nil
83
86
}
84
87
88
+ // Apply applies the CNCF Distribution registry addon to the cluster.
85
89
func (n * CNCFDistribution ) Apply (
86
90
ctx context.Context ,
87
91
_ v1alpha1.RegistryAddon ,
88
92
cluster * clusterv1.Cluster ,
89
93
log logr.Logger ,
90
94
) error {
91
- log .Info ("Copying TLS Certificate for CNCF Distribution registry to remote cluster" )
92
- // Ensure the CA secret exists and is up to date in the cluster's namespace before trying to use it.
93
- err := utils .EnsureCASecretForCluster (
94
- ctx ,
95
- n .client ,
96
- cluster ,
97
- )
98
- if err != nil {
99
- return fmt .Errorf ("failed to ensure CA secret for CNCF Distribution registry addon: %w" , err )
100
- }
101
-
102
95
// Copy the TLS secret to the remote cluster.
103
96
serviceIP , err := utils .ServiceIPForCluster (cluster )
104
97
if err != nil {
Original file line number Diff line number Diff line change @@ -92,7 +92,6 @@ func (r *RegistryHandler) BeforeClusterUpgrade(
92
92
resp * runtimehooksv1.BeforeClusterUpgradeResponse ,
93
93
) {
94
94
commonResponse := & runtimehooksv1.CommonResponse {}
95
- r .setup (ctx , & req .Cluster , commonResponse )
96
95
r .apply (ctx , & req .Cluster , commonResponse )
97
96
resp .Status = commonResponse .GetStatus ()
98
97
resp .Message = commonResponse .GetMessage ()
You can’t perform that action at this time.
0 commit comments