...

Source file src/github.com/GoogleCloudPlatform/k8s-config-connector/operator/pkg/k8s/constants.go

Documentation: github.com/GoogleCloudPlatform/k8s-config-connector/operator/pkg/k8s

     1  // Copyright 2022 Google LLC
     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 k8s
    16  
    17  import (
    18  	"fmt"
    19  
    20  	"k8s.io/apimachinery/pkg/types"
    21  )
    22  
    23  const (
    24  	ConfigConnectorComponentName         = "configconnector"
    25  	WorkloadIdentityAnnotation           = "iam.gke.io/gcp-service-account"
    26  	ServiceAccountNamePrefix             = "cnrm-controller-manager-"
    27  	ControllerManagerPodForClusterMode   = "cnrm-controller-manager-0"
    28  	OperatorFinalizer                    = "configconnector.cnrm.cloud.google.com/finalizer"
    29  	ConfigConnectorContextNamespaceLabel = "configconnectorcontext.cnrm.cloud.google.com/namespace"
    30  	KCCFinalizer                         = "cnrm.cloud.google.com/finalizer"
    31  	KCCSystemLabelSelectorRaw            = "cnrm.cloud.google.com/system"
    32  	KCCSystemComponentLabel              = "cnrm.cloud.google.com/component"
    33  	KCCControllerManagerComponent        = "cnrm-controller-manager"
    34  	KCCUnmanagedDetectorComponent        = "cnrm-unmanaged-detector"
    35  	CNRMDomain                           = "cnrm.cloud.google.com"
    36  	CNRMSystemNamespace                  = "cnrm-system"
    37  	NamespacedComponentLabel             = "cnrm.cloud.google.com/scoped-namespace"
    38  	OperatorSystemNamespace              = "configconnector-operator-system"
    39  	VersionAnnotation                    = "cnrm.cloud.google.com/version"
    40  	OperatorVersionAnnotation            = "cnrm.cloud.google.com/operator-version"
    41  	ProjectIdAnnotation                  = "cnrm.cloud.google.com/project-id"
    42  	StableChannel                        = "stable"
    43  	ConfigConnectorAllowedName           = "configconnector.core.cnrm.cloud.google.com"
    44  	ConfigConnectorContextAllowedName    = "configconnectorcontext.core.cnrm.cloud.google.com"
    45  	UpToDate                             = "UpToDate"
    46  	UpToDateMessage                      = "ConfigConnector is up to date"
    47  	UpdateFailed                         = "UpdateFailed"
    48  	ReconcileErrMsgTmpl                  = "error during reconciliation: %v"
    49  	ControllerManagerService             = "cnrm-manager"
    50  	NamespacedManagerServicePrefix       = "cnrm-manager-"
    51  	NamespacedManagerServiceTmpl         = "cnrm-manager-${NAMESPACE?}"
    52  	ClusterMode                          = "cluster"
    53  	NamespacedMode                       = "namespaced"
    54  	ServiceAccountProjectPolicy          = "SERVICE_ACCOUNT_PROJECT"
    55  	ResourceProjectPolicy                = "RESOURCE_PROJECT"
    56  	BillingProjectPolicy                 = "BILLING_PROJECT"
    57  	UserProjectOverrideFlag              = "--user-project-override"
    58  	BillingProjectFlag                   = "--billing-project"
    59  	CNRMManagerContainerName             = "manager"
    60  )
    61  
    62  var (
    63  	KCCControllerPodLabelSelectorRaw = fmt.Sprintf("%v=%v", KCCSystemComponentLabel, KCCControllerManagerComponent)
    64  
    65  	// IgnoredCRDList contains CRDs that should be ignored by the operator.
    66  	IgnoredCRDList = map[string]bool{
    67  		// KCC no longer supports the ServiceMapping CRD as of v1.50.0, but customer
    68  		// clusters may still contain a copy of the CRD and its CRs.
    69  		// Ignore this CRD and its CRs to avoid blocking deletions of ConfigConnectorContext
    70  		// objects on their existence (b/195157239).
    71  		"servicemappings.core.cnrm.cloud.google.com": true,
    72  		// GameServicesRealm CRD is removed from the install bundle as of
    73  		// v1.101.0.
    74  		"gameservicesrealms.gameservices.cnrm.cloud.google.com": true,
    75  	}
    76  
    77  	OperatorNamespaceIDConfigMapNN = types.NamespacedName{
    78  		Namespace: OperatorSystemNamespace,
    79  		Name:      "namespace-id",
    80  	}
    81  )
    82  

View as plain text