Skip to content

Commit

Permalink
Fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
Jont828 committed Jul 17, 2023
1 parent d351197 commit e69997b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
11 changes: 4 additions & 7 deletions azure/services/scalesets/scalesets.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,22 +87,19 @@ func (s *Service) Reconcile(ctx context.Context) (retErr error) {
return err
}

var err error
var resultErr error

spec := s.Scope.ScaleSetSpec(ctx)
scaleSetSpec, ok := spec.(*ScaleSetSpec)
if !ok {
return errors.Errorf("%T is not of type ScaleSetSpec", spec)
}

_, err = s.Client.Get(ctx, spec)
_, err := s.Client.Get(ctx, spec)
if err == nil {
scaleSetSpec.VMSSInstances, err = s.Client.ListInstances(ctx, spec.ResourceGroupName(), spec.ResourceName())
if err != nil {
resultErr = errors.Wrapf(err, "failed to get existing instances")
s.Scope.UpdatePutStatus(infrav1.BootstrapSucceededCondition, serviceName, resultErr)
return resultErr
err = errors.Wrapf(err, "failed to get existing instances")
s.Scope.UpdatePutStatus(infrav1.BootstrapSucceededCondition, serviceName, err)
return err
}
} else if !azure.ResourceNotFound(err) {
return errors.Wrapf(err, "failed to get existing VMSS")
Expand Down
2 changes: 1 addition & 1 deletion config/capz/manager_image_patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ spec:
spec:
containers:
# Change the value of image field below to your controller image URL
- image: gcr.io/k8s-staging-cluster-api-azure/cluster-api-azure-controller:latest
- image: docker.io/jont828/cluster-api-azure-controller-amd64:20230717220814
name: manager
2 changes: 1 addition & 1 deletion config/capz/manager_pull_policy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ spec:
spec:
containers:
- name: manager
imagePullPolicy: Always
imagePullPolicy: IfNotPresent

0 comments on commit e69997b

Please sign in to comment.