Skip to content

Commit b45dfb7

Browse files
authored
fix: Only validate version when Cloudquery Registry is used (#20459)
#### Summary ⚠️ **If you're contributing to a plugin please read this section of the [contribution guidelines](https://github.com/cloudquery/cloudquery/blob/main/CONTRIBUTING.md#open-core-vs-open-source) 🧑‍🎓 before submitting this PR** ⚠️
1 parent 30f2ce8 commit b45dfb7

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

cli/internal/specs/v0/version.go

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ func WarnOnOutdatedVersions(ctx context.Context, p *managedplugin.PluginVersionW
2323
continue
2424
}
2525
// N.B.: warning is best-effort; we ignore errors, but the function still logs errors with Debug logs
26-
_, _ = p.WarnIfOutdated(ctx, org, name, managedplugin.PluginSource.String(), source.Version)
26+
// We only check for outdated plugins if the registry is cloudquery or github and the org is cloudquery
27+
if source.Registry == RegistryCloudQuery || (source.Registry == RegistryGitHub && org == "cloudquery") {
28+
_, _ = p.WarnIfOutdated(ctx, org, name, managedplugin.PluginSource.String(), source.Version)
29+
}
2730
}
2831
for _, destination := range destinations {
2932
org, name, err := pluginPathToOrgName(destination.Path)
@@ -32,7 +35,10 @@ func WarnOnOutdatedVersions(ctx context.Context, p *managedplugin.PluginVersionW
3235
continue
3336
}
3437
// N.B.: warning is best-effort; we ignore errors, but the function still logs errors with Debug logs
35-
_, _ = p.WarnIfOutdated(ctx, org, name, managedplugin.PluginDestination.String(), destination.Version)
38+
// We only check for outdated plugins if the registry is cloudquery or github and the org is cloudquery
39+
if destination.Registry == RegistryCloudQuery || (destination.Registry == RegistryGitHub && org == "cloudquery") {
40+
_, _ = p.WarnIfOutdated(ctx, org, name, managedplugin.PluginDestination.String(), destination.Version)
41+
}
3642
}
3743
for _, transformer := range transformers {
3844
org, name, err := pluginPathToOrgName(transformer.Path)
@@ -41,7 +47,10 @@ func WarnOnOutdatedVersions(ctx context.Context, p *managedplugin.PluginVersionW
4147
continue
4248
}
4349
// N.B.: warning is best-effort; we ignore errors, but the function still logs errors with Debug logs
44-
_, _ = p.WarnIfOutdated(ctx, org, name, managedplugin.PluginTransformer.String(), transformer.Version)
50+
// We only check for outdated plugins if the registry is cloudquery or github and the org is cloudquery
51+
if transformer.Registry == RegistryCloudQuery || (transformer.Registry == RegistryGitHub && org == "cloudquery") {
52+
_, _ = p.WarnIfOutdated(ctx, org, name, managedplugin.PluginTransformer.String(), transformer.Version)
53+
}
4554
}
4655
}
4756

0 commit comments

Comments
 (0)