Skip to content

Commit

Permalink
provider update
Browse files Browse the repository at this point in the history
  • Loading branch information
anil-sarodh committed Dec 9, 2023
1 parent 426fb70 commit 3a92645
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions capten/agent/internal/crossplane/package_providers.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,16 +146,17 @@ func (h *ProvidersSyncHandler) updateCrossplaneProvider(k8sProviders []model.Pro
continue
}

status := model.CrossPlaneProviderNotReady
dbProvider, ok := dbProviderMap[k8sProvider.Name]
if !ok {
h.log.Infof("Provider name %s is not found in the db, skipping the update", k8sProvider.Name)
continue
h.log.Infof("Provider name %s is not found in the db, uptaing its status to out of sync", k8sProvider.Name)
status = model.CrossPlaneProviderOutofSynch
} else {
if strings.EqualFold(string(providerStatus.Status), "true") {
status = model.CrossPlaneProviderReady
}
}

status := model.CrossPlaneProviderNotReady
if strings.EqualFold(string(providerStatus.Status), "true") {
status = model.CrossPlaneProviderReady
}
provider := model.CrossplaneProvider{
Id: dbProvider.Id,
Status: string(status),
Expand Down Expand Up @@ -190,7 +191,6 @@ func (h *ProvidersSyncHandler) updateCrossplaneProviderToOutOfSync(k8sProvider *
dbProvider, ok := dbProviderMap[k8sProvider.Name]
if !ok {
return fmt.Errorf("provider name %s is not found in the db, skipping the update", k8sProvider.Name)

}

provider := model.CrossplaneProvider{
Expand Down

0 comments on commit 3a92645

Please sign in to comment.