Documentation ¶
Index ¶
- Variables
- func EnsureNamespaceExists(c client.Client, name string)
- func GetClusterModeGCPManifest() []string
- func GetClusterModeWorkloadIdentityManifest() []string
- func GetManifestsWithAlphaAndBetaCRDs() []string
- func GetManifestsWithAlphaCRD() []string
- func GetManifestsWithBetaCRD() []string
- func GetManifestsWithDefectiveCRD() []string
- func GetManifestsWithNoCRD() []string
- func GetManifestsWithNonKCCCRD() []string
- func GetPerNamespaceManifest() []string
- func GetSharedComponentsManifest() []string
- func HasOperatorFinalizer(o metav1.Object) bool
- func ManuallyModifyNamespaceTemplates(t *testing.T, template []string, nsName, saName string, ...) []string
- func ManuallyReplaceGSA(components []string, saName string) []string
- func ManuallyReplaceSecretVolume(components []string, secretName string) []string
- func ParseObjects(t *testing.T, ctx context.Context, objects []string) *manifest.Objects
- func ToString(t *testing.T, u *unstructured.Unstructured) string
- func ToUnstructured(t *testing.T, objStr string) *unstructured.Unstructured
Constants ¶
This section is empty.
Variables ¶
View Source
var ClusterModeOnlyGCPComponents = []string{`
apiVersion: v1
kind: ServiceAccount
metadata:
name: cnrm-controller-manager
namespace: cnrm-system
`, `
apiVersion: v1
kind: Service
metadata:
name: cnrm-manager
namespace: cnrm-system
spec:
ports:
- name: controller-manager
port: 443
- name: metrics
port: 8888
selector:
cnrm.cloud.google.com/component: cnrm-controller-manager
cnrm.cloud.google.com/system: "true"
`, `
apiVersion: apps/v1
kind: StatefulSet
metadata:
labels:
cnrm.cloud.google.com/component: cnrm-controller-manager
cnrm.cloud.google.com/system: "true"
name: cnrm-controller-manager
namespace: cnrm-system
spec:
selector:
matchLabels:
cnrm.cloud.google.com/component: cnrm-controller-manager
cnrm.cloud.google.com/system: "true"
serviceName: cnrm-manager
template:
metadata:
labels:
cnrm.cloud.google.com/component: cnrm-controller-manager
cnrm.cloud.google.com/system: "true"
spec:
volumes:
- name: gcp-service-account
secret:
secretName: gcp-key
`}
View Source
var ClusterModeOnlyWorkloadIdentityComponents = []string{`
apiVersion: v1
kind: ServiceAccount
metadata:
annotations:
iam.gke.io/gcp-service-account: ${SERVICE_ACCOUNT?}
name: cnrm-controller-manager
namespace: cnrm-system
`, `
apiVersion: v1
kind: Service
metadata:
name: cnrm-manager
namespace: cnrm-system
spec:
ports:
- name: controller-manager
port: 443
- name: metrics
port: 8888
selector:
cnrm.cloud.google.com/component: cnrm-controller-manager
cnrm.cloud.google.com/system: "true"
`, `
apiVersion: apps/v1
kind: StatefulSet
metadata:
labels:
cnrm.cloud.google.com/component: cnrm-controller-manager
cnrm.cloud.google.com/system: "true"
name: cnrm-controller-manager
namespace: cnrm-system
spec:
selector:
matchLabels:
cnrm.cloud.google.com/component: cnrm-controller-manager
cnrm.cloud.google.com/system: "true"
serviceName: cnrm-manager
template:
metadata:
labels:
cnrm.cloud.google.com/component: cnrm-controller-manager
cnrm.cloud.google.com/system: "true"
`}
View Source
var FooCRD = `` /* 442-byte string literal not displayed */
View Source
var NamespacedComponentsTemplate = []string{`
apiVersion: v1
kind: ServiceAccount
metadata:
annotations:
iam.gke.io/gcp-service-account: ${SERVICE_ACCOUNT?}
labels:
cnrm.cloud.google.com/scoped-namespace: ${NAMESPACE?}
cnrm.cloud.google.com/system: "true"
name: cnrm-controller-manager-${NAMESPACE?}
namespace: cnrm-system
`, `
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
labels:
cnrm.cloud.google.com/scoped-namespace: ${NAMESPACE?}
cnrm.cloud.google.com/system: "true"
name: cnrm-admin-binding-${NAMESPACE?}
namespace: ${NAMESPACE?}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cnrm-admin
subjects:
- kind: ServiceAccount
name: cnrm-controller-manager-${NAMESPACE?}
namespace: cnrm-system
`, `
apiVersion: v1
kind: Service
metadata:
labels:
cnrm.cloud.google.com/monitored: "true"
cnrm.cloud.google.com/scoped-namespace: ${NAMESPACE?}
cnrm.cloud.google.com/system: "true"
name: cnrm-manager-${NAMESPACE?}
namespace: cnrm-system
spec:
ports:
- name: controller-manager
port: 443
- name: metrics
port: 8888
selector:
cnrm.cloud.google.com/component: cnrm-controller-manager
cnrm.cloud.google.com/scoped-namespace: ${NAMESPACE?}
cnrm.cloud.google.com/system: "true"
`, `
apiVersion: apps/v1
kind: StatefulSet
metadata:
labels:
cnrm.cloud.google.com/component: cnrm-controller-manager
cnrm.cloud.google.com/scoped-namespace: ${NAMESPACE?}
cnrm.cloud.google.com/system: "true"
name: cnrm-controller-manager-${NAMESPACE?}
namespace: cnrm-system
spec:
selector:
matchLabels:
cnrm.cloud.google.com/component: cnrm-controller-manager
cnrm.cloud.google.com/scoped-namespace: ${NAMESPACE?}
cnrm.cloud.google.com/system: "true"
serviceName: cnrm-manager-${NAMESPACE?}
template:
metadata:
labels:
cnrm.cloud.google.com/component: cnrm-controller-manager
cnrm.cloud.google.com/scoped-namespace: ${NAMESPACE?}
cnrm.cloud.google.com/system: "true"
spec:
containers:
- args: ["--scoped-namespace=${NAMESPACE?}", "--stderrthreshold=INFO", "--prometheus-scrape-endpoint=:8888"]
command: ["/configconnector/manager"]
image: gcr.io/gke-release/cnrm/controller:4af93f1
name: manager
- command: ["/monitor", "--source=configconnector:http://localhost:8888?whitelisted=reconcile_requests_total,reconcile_request_duration_seconds,reconcile_workers_total,reconcile_occupied_workers_total,internal_errors_total&customResourceType=k8s_container&customLabels[container_name]&customLabels[project_id]&customLabels[location]&customLabels[cluster_name]&customLabels[namespace_name]&customLabels[pod_name]", "--stackdriver-prefix=kubernetes.io/internal/addons"]
image: gke.gcr.io/prometheus-to-sd:v0.9.1
name: prom-to-sd
`}
View Source
var PerNamespaceControllerManagerPod = `` /* 272-byte string literal not displayed */
View Source
var SystemNs = `apiVersion: v1
kind: Namespace
metadata:
name: cnrm-system
`
Functions ¶
func EnsureNamespaceExists ¶
func GetClusterModeGCPManifest ¶
func GetClusterModeGCPManifest() []string
func GetClusterModeWorkloadIdentityManifest ¶
func GetClusterModeWorkloadIdentityManifest() []string
func GetManifestsWithAlphaAndBetaCRDs ¶ added in v1.103.0
func GetManifestsWithAlphaAndBetaCRDs() []string
func GetManifestsWithAlphaCRD ¶ added in v1.103.0
func GetManifestsWithAlphaCRD() []string
func GetManifestsWithBetaCRD ¶ added in v1.103.0
func GetManifestsWithBetaCRD() []string
func GetManifestsWithDefectiveCRD ¶ added in v1.103.0
func GetManifestsWithDefectiveCRD() []string
func GetManifestsWithNoCRD ¶ added in v1.103.0
func GetManifestsWithNoCRD() []string
func GetManifestsWithNonKCCCRD ¶ added in v1.103.0
func GetManifestsWithNonKCCCRD() []string
func GetPerNamespaceManifest ¶
func GetPerNamespaceManifest() []string
func GetSharedComponentsManifest ¶
func GetSharedComponentsManifest() []string
func HasOperatorFinalizer ¶
func ManuallyReplaceGSA ¶
func ParseObjects ¶
func ToString ¶
func ToString(t *testing.T, u *unstructured.Unstructured) string
func ToUnstructured ¶
func ToUnstructured(t *testing.T, objStr string) *unstructured.Unstructured
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.