// createJenkinsCascTemplate creates a newly Jenkins CasC template ConfigMap with provided namespace and template.
createJenkinsCascTemplate creates a newly Jenkins CasC template ConfigMap with provided namespace and template.
// createJenkinsCascTemplate creates a newly Jenkins CasC template ConfigMap with provided namespace and template .
func createJenkinsCascTemplate(configMapClient v1core.ConfigMapsGetter, namespace string, template string) (*v1.ConfigMap, error) {
	immutable := true
	templateConfigMap := &v1.ConfigMap{
		TypeMeta: metav1.TypeMeta{
			Kind:       "ConfigMap",
			APIVersion: v1.SchemeGroupVersion.String(),
		},
		ObjectMeta: metav1.ObjectMeta{
			Namespace: namespace,
			Name:      templateConfigMapName,
		},
		Data: map[string]string{
			jenkinsYamlKey: template,
		},
		Immutable: &immutable,
	}
	templateConfigMap, err := configMapClient.ConfigMaps(namespace).Create(context.Background(), templateConfigMap, metav1.CreateOptions{})
	if err != nil {
		klog.Errorf("failed to create Jenkins CasC template ConfigMap: %s/%s", namespace, templateConfigMapName)
		return nil, err
	}
	return templateConfigMap, nil
}
func createJenkinsCascTemplate ( configMapClient v1core . ConfigMapsGetter , namespace string , template string ) ( * v1 . ConfigMap , error ) { immutable := true templateConfigMap := & v1 . ConfigMap { TypeMeta : metav1 . TypeMeta { Kind : " " , APIVersion : v1 . SchemeGroupVersion . String ( ) , } , ObjectMeta : metav1 . ObjectMeta { Namespace : namespace , Name : templateConfigMapName , } , Data : map [ string ] string { jenkinsYamlKey : template , } , Immutable : & immutable , } templateConfigMap , err := configMapClient . ConfigMaps ( namespace ) . Create ( context . Background ( ) , templateConfigMap , metav1 . CreateOptions { } ) if err != nil { klog . Errorf ( " " , namespace , templateConfigMapName ) return nil , err } return templateConfigMap , nil }
createJenkinsCascTemplate creates a newly Jenkins CasC template ConfigMap with provided namespace and template.
createJenkinsCascTemplate creates a newly Jenkins CasC template ConfigMap with provided namespace and template .
// construct new template ConfigMap