istio.io/istio@v0.0.0-20240520182934-d79c90f27776/pkg/config/analysis/analyzers/all.go (about)

     1  // Copyright Istio Authors
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  package analyzers
    16  
    17  import (
    18  	"istio.io/istio/pkg/config/analysis"
    19  	"istio.io/istio/pkg/config/analysis/analyzers/annotations"
    20  	"istio.io/istio/pkg/config/analysis/analyzers/authz"
    21  	"istio.io/istio/pkg/config/analysis/analyzers/deployment"
    22  	"istio.io/istio/pkg/config/analysis/analyzers/deprecation"
    23  	"istio.io/istio/pkg/config/analysis/analyzers/destinationrule"
    24  	"istio.io/istio/pkg/config/analysis/analyzers/envoyfilter"
    25  	"istio.io/istio/pkg/config/analysis/analyzers/externalcontrolplane"
    26  	"istio.io/istio/pkg/config/analysis/analyzers/gateway"
    27  	"istio.io/istio/pkg/config/analysis/analyzers/injection"
    28  	"istio.io/istio/pkg/config/analysis/analyzers/k8sgateway"
    29  	"istio.io/istio/pkg/config/analysis/analyzers/multicluster"
    30  	"istio.io/istio/pkg/config/analysis/analyzers/schema"
    31  	"istio.io/istio/pkg/config/analysis/analyzers/service"
    32  	"istio.io/istio/pkg/config/analysis/analyzers/serviceentry"
    33  	"istio.io/istio/pkg/config/analysis/analyzers/sidecar"
    34  	"istio.io/istio/pkg/config/analysis/analyzers/telemetry"
    35  	"istio.io/istio/pkg/config/analysis/analyzers/virtualservice"
    36  	"istio.io/istio/pkg/config/analysis/analyzers/webhook"
    37  )
    38  
    39  // All returns all analyzers
    40  func All() []analysis.Analyzer {
    41  	analyzers := []analysis.Analyzer{
    42  		// Please keep this list sorted alphabetically by pkg.name for convenience
    43  		&annotations.K8sAnalyzer{},
    44  		&authz.AuthorizationPoliciesAnalyzer{},
    45  		&deployment.ServiceAssociationAnalyzer{},
    46  		&deployment.ApplicationUIDAnalyzer{},
    47  		&deprecation.FieldAnalyzer{},
    48  		&externalcontrolplane.ExternalControlPlaneAnalyzer{},
    49  		&gateway.IngressGatewayPortAnalyzer{},
    50  		&gateway.CertificateAnalyzer{},
    51  		&gateway.SecretAnalyzer{},
    52  		&gateway.ConflictingGatewayAnalyzer{},
    53  		&injection.Analyzer{},
    54  		&injection.ImageAnalyzer{},
    55  		&injection.ImageAutoAnalyzer{},
    56  		&k8sgateway.SelectorAnalyzer{},
    57  		&multicluster.MeshNetworksAnalyzer{},
    58  		&service.PortNameAnalyzer{},
    59  		&sidecar.SelectorAnalyzer{},
    60  		&virtualservice.ConflictingMeshGatewayHostsAnalyzer{},
    61  		&virtualservice.DestinationHostAnalyzer{},
    62  		&virtualservice.DestinationRuleAnalyzer{},
    63  		&virtualservice.GatewayAnalyzer{},
    64  		&virtualservice.JWTClaimRouteAnalyzer{},
    65  		&virtualservice.RegexAnalyzer{},
    66  		&destinationrule.CaCertificateAnalyzer{},
    67  		&serviceentry.ProtocolAddressesAnalyzer{},
    68  		&webhook.Analyzer{},
    69  		&envoyfilter.EnvoyPatchAnalyzer{},
    70  		&telemetry.ProdiverAnalyzer{},
    71  		&telemetry.SelectorAnalyzer{},
    72  		&telemetry.DefaultSelectorAnalyzer{},
    73  		&telemetry.LightstepAnalyzer{},
    74  		&multicluster.ServiceAnalyzer{},
    75  	}
    76  
    77  	analyzers = append(analyzers, schema.AllValidationAnalyzers()...)
    78  
    79  	return analyzers
    80  }
    81  
    82  func AllMultiCluster() []analysis.Analyzer {
    83  	analyzers := []analysis.Analyzer{
    84  		&multicluster.ServiceAnalyzer{},
    85  	}
    86  	return analyzers
    87  }
    88  
    89  // AllCombined returns all analyzers combined as one
    90  func AllCombined() analysis.CombinedAnalyzer {
    91  	return analysis.Combine("all", All()...)
    92  }
    93  
    94  // AllMultiClusterCombined returns all multi-cluster analyzers combined as one
    95  func AllMultiClusterCombined() analysis.CombinedAnalyzer {
    96  	return analysis.Combine("all-multi-cluster", AllMultiCluster()...)
    97  }