Skip to content

Commit

Permalink
Merge branch 'master' into feat/sso-wi
Browse files Browse the repository at this point in the history
  • Loading branch information
jagpreetstamber authored Jan 22, 2025
2 parents 0d26352 + 27915da commit b47cab0
Show file tree
Hide file tree
Showing 97 changed files with 1,193 additions and 280 deletions.
5 changes: 3 additions & 2 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ linters:
- importas
- ineffassign
- misspell
- nolintlint
- perfsprint
- revive
- staticcheck
Expand All @@ -35,11 +36,9 @@ linters-settings:
- appendAssign
- assignOp # Keep it disabled for readability
- badCond
- commentFormatting
- exitAfterDefer
- ifElseChain
- mapKey
- singleCaseSwitch
- typeSwitchVar
goimports:
local-prefixes: github.com/argoproj/argo-cd/v3
Expand Down Expand Up @@ -74,6 +73,8 @@ linters-settings:
pkg: k8s.io/client-go/informers/core/v1
- alias: stderrors
pkg: errors
nolintlint:
require-specific: true
perfsprint:
# Optimizes even if it requires an int or uint type cast.
int-conversion: true
Expand Down
8 changes: 4 additions & 4 deletions applicationset/utils/clusterUtils.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ func getLocalCluster(clientset kubernetes.Interface) *appv1.Cluster {
initLocalCluster.Do(func() {
info, err := clientset.Discovery().ServerVersion()
if err == nil {
// nolint:staticcheck
//nolint:staticcheck
localCluster.ServerVersion = fmt.Sprintf("%s.%s", info.Major, info.Minor)
// nolint:staticcheck
//nolint:staticcheck
localCluster.ConnectionState = appv1.ConnectionState{Status: appv1.ConnectionStatusSuccessful}
} else {
// nolint:staticcheck
//nolint:staticcheck
localCluster.ConnectionState = appv1.ConnectionState{
Status: appv1.ConnectionStatusFailed,
Message: err.Error(),
Expand All @@ -82,7 +82,7 @@ func getLocalCluster(clientset kubernetes.Interface) *appv1.Cluster {
})
cluster := localCluster.DeepCopy()
now := metav1.Now()
// nolint:staticcheck
//nolint:staticcheck
cluster.ConnectionState.ModifiedAt = &now
return cluster
}
4 changes: 2 additions & 2 deletions cmd/argocd/commands/admin/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ func NewClusterShardsCommand(clientOpts *argocdclient.ClientOptions) *cobra.Comm

// parse all added flags so far to get the redis-compression flag that was added by AddCacheFlagsToCmd() above
// we can ignore unchecked error here as the command will be parsed again and checked when command.Execute() is run later
// nolint:errcheck
//nolint:errcheck
command.ParseFlags(os.Args[1:])
redisCompressionStr, _ = command.Flags().GetString(cacheutil.CLIFlagRedisCompress)
return &command
Expand Down Expand Up @@ -517,7 +517,7 @@ argocd admin cluster stats target-cluster`,

// parse all added flags so far to get the redis-compression flag that was added by AddCacheFlagsToCmd() above
// we can ignore unchecked error here as the command will be parsed again and checked when command.Execute() is run later
// nolint:errcheck
//nolint:errcheck
command.ParseFlags(os.Args[1:])
redisCompressionStr, _ = command.Flags().GetString(cacheutil.CLIFlagRedisCompress)
return &command
Expand Down
2 changes: 0 additions & 2 deletions cmd/argocd/commands/admin/cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,9 @@ func Test_loadClusters(t *testing.T) {
ID: "",
Server: "https://kubernetes.default.svc",
Name: "in-cluster",
//nolint:staticcheck
ConnectionState: v1alpha1.ConnectionState{
Status: "Successful",
},
//nolint:staticcheck
ServerVersion: ".",
Shard: ptr.To(int64(0)),
},
Expand Down
2 changes: 1 addition & 1 deletion cmd/argocd/commands/admin/settings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func newSettingsManager(data map[string]string) *settings.SettingsManager {

type fakeCmdContext struct {
mgr *settings.SettingsManager
// nolint:unused,structcheck
//nolint:unused,structcheck
out bytes.Buffer
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/argocd/commands/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -3031,7 +3031,7 @@ func NewApplicationManifestsCommand(clientOpts *argocdclient.ClientOptions) *cob
errors.CheckError(err)

proj := getProject(ctx, c, clientOpts, app.Spec.Project)
// nolint:staticcheck
//nolint:staticcheck
unstructureds = getLocalObjects(context.Background(), app, proj.Project, local, localRepoRoot, argoSettings.AppLabelKey, cluster.ServerVersion, cluster.Info.APIVersions, argoSettings.KustomizeOptions, argoSettings.TrackingMethod)
} else if len(revisions) > 0 && len(sourcePositions) > 0 {
q := application.ApplicationManifestQuery{
Expand Down
4 changes: 2 additions & 2 deletions cmd/argocd/commands/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ func printClusterDetails(clusters []argoappv1.Cluster) {
fmt.Printf("Cluster information\n\n")
fmt.Printf(" Server URL: %s\n", cluster.Server)
fmt.Printf(" Server Name: %s\n", strWithDefault(cluster.Name, "-"))
// nolint:staticcheck
//nolint:staticcheck
fmt.Printf(" Server Version: %s\n", cluster.ServerVersion)
fmt.Printf(" Namespaces: %s\n", formatNamespaces(cluster))
fmt.Printf("\nTLS configuration\n\n")
Expand Down Expand Up @@ -466,7 +466,7 @@ func printClusterTable(clusters []argoappv1.Cluster) {
if len(c.Namespaces) > 0 {
server = fmt.Sprintf("%s (%d namespaces)", c.Server, len(c.Namespaces))
}
// nolint:staticcheck
//nolint:staticcheck
_, _ = fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%s\t%s\n", server, c.Name, c.ServerVersion, c.ConnectionState.Status, c.ConnectionState.Message, c.Project)
}
_ = w.Flush()
Expand Down
2 changes: 1 addition & 1 deletion commitserver/apiclient/clientset.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func NewConnection(address string) (*grpc.ClientConn, error) {
opts = append(opts, grpc.WithTransportCredentials(insecure.NewCredentials()))

// TODO: switch to grpc.NewClient.
// nolint:staticcheck
//nolint:staticcheck
conn, err := grpc.Dial(address, opts...)
if err != nil {
log.Errorf("Unable to connect to commit service with address %s", address)
Expand Down
18 changes: 9 additions & 9 deletions commitserver/commit/commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,15 +176,15 @@ func (s *Service) initGitClient(logCtx *log.Entry, r *apiclient.CommitHydratedMa
}

// FIXME: make it work for GHE
//logCtx.Debugf("Getting user info for repo credentials")
//gitCreds := r.Repo.GetGitCreds(s.gitCredsStore)
//startTime := time.Now()
//authorName, authorEmail, err := gitCreds.GetUserInfo(ctx)
//s.metricsServer.ObserveUserInfoRequestDuration(r.Repo.Repo, getCredentialType(r.Repo), time.Since(startTime))
//if err != nil {
// cleanupOrLog()
// return nil, "", nil, fmt.Errorf("failed to get github app info: %w", err)
//}
// logCtx.Debugf("Getting user info for repo credentials")
// gitCreds := r.Repo.GetGitCreds(s.gitCredsStore)
// startTime := time.Now()
// authorName, authorEmail, err := gitCreds.GetUserInfo(ctx)
// s.metricsServer.ObserveUserInfoRequestDuration(r.Repo.Repo, getCredentialType(r.Repo), time.Since(startTime))
// if err != nil {
// cleanupOrLog()
// return nil, "", nil, fmt.Errorf("failed to get github app info: %w", err)
// }
var authorName, authorEmail string

if authorName == "" {
Expand Down
2 changes: 1 addition & 1 deletion controller/cache/cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ func TestHandleDeleteEvent_CacheDeadlock(t *testing.T) {
clusterSharding: sharding.NewClusterSharding(db, 0, 1, common.DefaultShardingAlgorithm),
settingsMgr: settingsMgr,
// Set the lock here so we can reference it later
// nolint We need to overwrite here to have access to the lock
//nolint:govet // We need to overwrite here to have access to the lock
lock: liveStateCacheLock,
}
channel := make(chan string)
Expand Down
2 changes: 1 addition & 1 deletion controller/metrics/clustercollector.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ type clusterCollector struct {

func (c *clusterCollector) Run(ctx context.Context) {
// FIXME: complains about SA1015
// nolint:staticcheck
//nolint:staticcheck
tick := time.Tick(metricsCollectionInterval)
for {
select {
Expand Down
2 changes: 2 additions & 0 deletions docs/operator-manual/argocd-cmd-params-cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ data:
otlp.insecure: "true"
# Open-Telemetry collector headers: (e.g. "key1=value1,key2=value2")
otlp.headers: ""
# Open-Telemetry collector attrs: (e.g. "key1:value1,key2:value2")
otlp.attrs: ""

# List of additional namespaces where applications may be created in and
# reconciled from. The namespace where Argo CD is installed to will always
Expand Down
8 changes: 4 additions & 4 deletions docs/snyk/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ recent minor releases.
| [dex:v2.41.1](v2.14.0-rc5/ghcr.io_dexidp_dex_v2.41.1.html) | 0 | 0 | 0 | 2 |
| [haproxy:2.6.17-alpine](v2.14.0-rc5/public.ecr.aws_docker_library_haproxy_2.6.17-alpine.html) | 0 | 0 | 2 | 4 |
| [redis:7.0.15-alpine](v2.14.0-rc5/public.ecr.aws_docker_library_redis_7.0.15-alpine.html) | 0 | 0 | 0 | 1 |
| [argocd:v2.14.0-rc5](v2.14.0-rc5/quay.io_argoproj_argocd_v2.14.0-rc5.html) | 0 | 0 | 4 | 10 |
| [argocd:v2.14.0-rc5](v2.14.0-rc5/quay.io_argoproj_argocd_v2.14.0-rc5.html) | 0 | 0 | 6 | 10 |
| [redis:7.0.15-alpine](v2.14.0-rc5/redis_7.0.15-alpine.html) | 0 | 0 | 0 | 1 |
| [install.yaml](v2.14.0-rc5/argocd-iac-install.html) | - | - | - | - |
| [namespace-install.yaml](v2.14.0-rc5/argocd-iac-namespace-install.html) | - | - | - | - |
Expand All @@ -46,7 +46,7 @@ recent minor releases.
| [dex:v2.41.1](v2.13.3/ghcr.io_dexidp_dex_v2.41.1.html) | 0 | 0 | 0 | 2 |
| [haproxy:2.6.17-alpine](v2.13.3/public.ecr.aws_docker_library_haproxy_2.6.17-alpine.html) | 0 | 0 | 2 | 4 |
| [redis:7.0.15-alpine](v2.13.3/public.ecr.aws_docker_library_redis_7.0.15-alpine.html) | 0 | 0 | 0 | 1 |
| [argocd:v2.13.3](v2.13.3/quay.io_argoproj_argocd_v2.13.3.html) | 0 | 0 | 4 | 10 |
| [argocd:v2.13.3](v2.13.3/quay.io_argoproj_argocd_v2.13.3.html) | 0 | 0 | 6 | 10 |
| [redis:7.0.15-alpine](v2.13.3/redis_7.0.15-alpine.html) | 0 | 0 | 0 | 1 |
| [install.yaml](v2.13.3/argocd-iac-install.html) | - | - | - | - |
| [namespace-install.yaml](v2.13.3/argocd-iac-namespace-install.html) | - | - | - | - |
Expand All @@ -60,7 +60,7 @@ recent minor releases.
| [dex:v2.38.0](v2.12.9/ghcr.io_dexidp_dex_v2.38.0.html) | 0 | 0 | 6 | 7 |
| [haproxy:2.6.17-alpine](v2.12.9/public.ecr.aws_docker_library_haproxy_2.6.17-alpine.html) | 0 | 0 | 2 | 4 |
| [redis:7.0.15-alpine](v2.12.9/public.ecr.aws_docker_library_redis_7.0.15-alpine.html) | 0 | 0 | 0 | 1 |
| [argocd:v2.12.9](v2.12.9/quay.io_argoproj_argocd_v2.12.9.html) | 0 | 0 | 4 | 10 |
| [argocd:v2.12.9](v2.12.9/quay.io_argoproj_argocd_v2.12.9.html) | 0 | 0 | 6 | 10 |
| [redis:7.0.15-alpine](v2.12.9/redis_7.0.15-alpine.html) | 0 | 0 | 0 | 1 |
| [install.yaml](v2.12.9/argocd-iac-install.html) | - | - | - | - |
| [namespace-install.yaml](v2.12.9/argocd-iac-namespace-install.html) | - | - | - | - |
Expand All @@ -73,7 +73,7 @@ recent minor releases.
| [ui/yarn.lock](v2.11.12/argocd-test.html) | 0 | 0 | 1 | 0 |
| [dex:v2.38.0](v2.11.12/ghcr.io_dexidp_dex_v2.38.0.html) | 0 | 0 | 6 | 7 |
| [haproxy:2.6.14-alpine](v2.11.12/haproxy_2.6.14-alpine.html) | 0 | 1 | 7 | 7 |
| [argocd:v2.11.12](v2.11.12/quay.io_argoproj_argocd_v2.11.12.html) | 0 | 0 | 5 | 21 |
| [argocd:v2.11.12](v2.11.12/quay.io_argoproj_argocd_v2.11.12.html) | 0 | 0 | 7 | 21 |
| [redis:7.0.15-alpine](v2.11.12/redis_7.0.15-alpine.html) | 0 | 0 | 0 | 1 |
| [install.yaml](v2.11.12/argocd-iac-install.html) | - | - | - | - |
| [namespace-install.yaml](v2.11.12/argocd-iac-namespace-install.html) | - | - | - | - |
Loading

0 comments on commit b47cab0

Please sign in to comment.