Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Commit

Permalink
Cluster operator master (#1570)
Browse files Browse the repository at this point in the history
* Support for master version of cluster operator

* Support for master version of cluster operator

* When looking for the encryption secret, search on all namespaces (to support latest cluster-operator).
  • Loading branch information
Christian Bianchi authored Dec 1, 2021
1 parent d9b244c commit c07f92b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 18 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- When looking for the encryption secret, search on all namespaces (to support latest cluster-operator).

## [5.10.0] - 2021-11-08

### Changed
Expand Down
19 changes: 1 addition & 18 deletions service/controller/cloudconfig/cloud_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,10 @@ func New(config Config) (*CloudConfig, error) {
func (c CloudConfig) getEncryptionkey(ctx context.Context, customObject providerv1alpha1.AzureConfig) (string, error) {
secretList := &corev1.SecretList{}
{
c.logger.Debugf(ctx, "try to find encryption secret in namespace %#q", customObject.Namespace)
c.logger.Debugf(ctx, "try to find encryption secret")
err := c.ctrlClient.List(
ctx,
secretList,
ctrl.InNamespace(customObject.Namespace),
ctrl.MatchingLabels{
randomKeyLabel: randomKeyLabelValue,
apiextensionslabels.Cluster: key.ClusterID(&customObject),
Expand All @@ -117,22 +116,6 @@ func (c CloudConfig) getEncryptionkey(ctx context.Context, customObject provider
if err != nil {
return "", microerror.Mask(err)
}

if secretList.Size() < 1 {
c.logger.Debugf(ctx, "try to find encryption secret in namespace %#q", corev1.NamespaceDefault)
err := c.ctrlClient.List(
ctx,
secretList,
ctrl.InNamespace(corev1.NamespaceDefault),
ctrl.MatchingLabels{
randomKeyLabel: randomKeyLabelValue,
apiextensionslabels.Cluster: key.ClusterID(&customObject),
},
)
if err != nil {
return "", microerror.Mask(err)
}
}
}

if len(secretList.Items) > 0 {
Expand Down

0 comments on commit c07f92b

Please sign in to comment.