Skip to content

Commit 00101b7

Browse files
fix linter issues
1 parent be387e2 commit 00101b7

File tree

3 files changed

+9
-58
lines changed

3 files changed

+9
-58
lines changed

.github/workflows/ci-build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ jobs:
252252
- name: Setup NodeJS
253253
uses: actions/setup-node@f1f314fca9dfce2769ece7d933488f076716723e # v1.4.6
254254
with:
255-
node-version: "12.18.4"
255+
node-version: "12.22.0"
256256
- name: Restore node dependency cache
257257
id: cache-dependencies
258258
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1

reposerver/repository/repository.go

Lines changed: 8 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,15 +1053,6 @@ func sanitizeRepoName(repoName string) string {
10531053
return strings.ReplaceAll(repoName, "/", "-")
10541054
}
10551055

1056-
func repoExists(repo string, repos []*v1alpha1.Repository) bool {
1057-
for _, r := range repos {
1058-
if strings.TrimPrefix(repo, ociPrefix) == strings.TrimPrefix(r.Repo, ociPrefix) {
1059-
return true
1060-
}
1061-
}
1062-
return false
1063-
}
1064-
10651056
func isConcurrencyAllowed(appPath string) bool {
10661057
if _, err := os.Stat(path.Join(appPath, allowConcurrencyFile)); err == nil {
10671058
return true
@@ -1097,32 +1088,6 @@ func runHelmBuild(appPath string, h helm.Helm) error {
10971088
return os.WriteFile(markerFile, []byte("marker"), 0644)
10981089
}
10991090

1100-
func populateRequestRepos(appPath string, q *apiclient.ManifestRequest) error {
1101-
repos, err := getHelmDependencyRepos(appPath)
1102-
if err != nil {
1103-
return err
1104-
}
1105-
1106-
for _, r := range repos {
1107-
if !repoExists(r.Repo, q.Repos) {
1108-
repositoryCredential := getRepoCredential(q.HelmRepoCreds, r.Repo)
1109-
if repositoryCredential != nil {
1110-
if repositoryCredential.EnableOCI {
1111-
r.Repo = strings.TrimPrefix(r.Repo, ociPrefix)
1112-
}
1113-
r.EnableOCI = repositoryCredential.EnableOCI
1114-
r.Password = repositoryCredential.Password
1115-
r.Username = repositoryCredential.Username
1116-
r.SSHPrivateKey = repositoryCredential.SSHPrivateKey
1117-
r.TLSClientCertData = repositoryCredential.TLSClientCertData
1118-
r.TLSClientCertKey = repositoryCredential.TLSClientCertKey
1119-
}
1120-
q.Repos = append(q.Repos, r)
1121-
}
1122-
}
1123-
return nil
1124-
}
1125-
11261091
func helmTemplate(appPath string, repoRoot string, env *v1alpha1.Env, q *apiclient.ManifestRequest, isLocal bool, gitRepoPaths io.TempPaths) ([]manifest, error) {
11271092
concurrencyAllowed := isConcurrencyAllowed(appPath)
11281093
if !concurrencyAllowed {
@@ -1402,28 +1367,15 @@ func GenerateManifests(ctx context.Context, appPath, repoRoot, revision string,
14021367
case v1alpha1.ApplicationSourceTypeKustomize:
14031368
manifests, err = kustomizeBuild(repoURL, repoRoot, appPath, q.Repo.GetGitCreds(gitCredsStore), q.ApplicationSource.Kustomize, q.KustomizeOptions, env, q.Namespace)
14041369
case v1alpha1.ApplicationSourceTypePlugin:
1405-
var plugin *v1alpha1.ConfigManagementPlugin
1406-
if q.ApplicationSource.Plugin != nil && q.ApplicationSource.Plugin.Name != "" {
1407-
plugin = findPlugin(q.Plugins, q.ApplicationSource.Plugin.Name)
1370+
// if the named plugin was not found in argocd-cm try sidecar plugin
1371+
pluginName := ""
1372+
if q.ApplicationSource.Plugin != nil {
1373+
pluginName = q.ApplicationSource.Plugin.Name
14081374
}
1409-
if plugin != nil {
1410-
// argocd-cm deprecated plugin is being used
1411-
manifests, err = runConfigManagementPlugin(appPath, repoRoot, env, q, q.Repo.GetGitCreds(gitCredsStore), plugin)
1412-
log.WithFields(map[string]interface{}{
1413-
"application": q.AppName,
1414-
"plugin": q.ApplicationSource.Plugin.Name,
1415-
}).Warnf(common.ConfigMapPluginDeprecationWarning)
1416-
} else {
1417-
// if the named plugin was not found in argocd-cm try sidecar plugin
1418-
pluginName := ""
1419-
if q.ApplicationSource.Plugin != nil {
1420-
pluginName = q.ApplicationSource.Plugin.Name
1421-
}
1422-
// if pluginName is provided it has to be `<metadata.name>-<spec.version>` or just `<metadata.name>` if plugin version is empty
1423-
manifests, err = runConfigManagementPluginSidecars(ctx, appPath, repoRoot, pluginName, env, q, q.Repo.GetGitCreds(gitCredsStore), opt.cmpTarDoneCh, opt.cmpTarExcludedGlobs)
1424-
if err != nil {
1425-
err = fmt.Errorf("plugin sidecar failed. %s", err.Error())
1426-
}
1375+
// if pluginName is provided it has to be `<metadata.name>-<spec.version>` or just `<metadata.name>` if plugin version is empty
1376+
manifests, err = runConfigManagementPluginSidecars(ctx, appPath, repoRoot, pluginName, env, q, q.Repo.GetGitCreds(gitCredsStore), opt.cmpTarDoneCh, opt.cmpTarExcludedGlobs)
1377+
if err != nil {
1378+
err = fmt.Errorf("plugin sidecar failed. %s", err.Error())
14271379
}
14281380
case v1alpha1.ApplicationSourceTypeDirectory:
14291381
var directory *v1alpha1.ApplicationSourceDirectory

util/lua/lua.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import (
2222

2323
const (
2424
incorrectReturnType = "expect %s output from Lua script, not %s"
25-
incorrectInnerType = "expect %s inner type from Lua script, not %s"
2625
invalidHealthStatus = "Lua returned an invalid health status"
2726
healthScriptFile = "health.lua"
2827
actionScriptFile = "action.lua"

0 commit comments

Comments
 (0)