// utility map to create a deployment object
// with (metadatanamespace, metadataname) as key
// and pointing to "refname" secret and configmap
utility map to create a deployment object
with (metadatanamespace, metadataname) as key
and pointing to "refname" secret and configmap
// utility map to create a deployment object // with ( metadatanamespace metadataname ) as key // and pointing to " refname " secret and configmap
func deploymentMap(metadatanamespace string, metadataname string,
	configmapref string, secretref string) map[string]interface{} {
	deployment := map[string]interface{}{
		"group":      "apps",
		"apiVersion": "v1",
		"kind":       "Deployment",
		"metadata": map[string]interface{}{
			"name": metadataname,
		},
		"spec": map[string]interface{}{
			"template": map[string]interface{}{
				"spec": map[string]interface{}{
					"containers": []interface{}{
						map[string]interface{}{
							"name":  "nginx",
							"image": "nginx:1.7.9",
							"env": []interface{}{
								map[string]interface{}{
									"name": "CM_FOO",
									"valueFrom": map[string]interface{}{
										"configMapKeyRef": map[string]interface{}{
											"name": configmapref,
											"key":  "somekey",
										},
									},
								},
								map[string]interface{}{
									"name": "SECRET_FOO",
									"valueFrom": map[string]interface{}{
										"secretKeyRef": map[string]interface{}{
											"name": secretref,
											"key":  "somekey",
										},
									},
								},
							},
						},
					},
				},
			},
		},
	}
	if metadatanamespace != "" {
		metadata := deployment["metadata"].(map[string]interface{})
		metadata["namespace"] = metadatanamespace
	}
	return deployment
}
func deploymentMap ( metadatanamespace string , metadataname string , configmapref string , secretref string ) map [ string ] interface { } { deployment := map [ string ] interface { } { " " : " " , " " : " " , " " : " " , " " : map [ string ] interface { } { " " : metadataname , } , " " : map [ string ] interface { } { " " : map [ string ] interface { } { " " : map [ string ] interface { } { " " : [ ] interface { } { map [ string ] interface { } { " " : " " , " " : " " , " " : [ ] interface { } { map [ string ] interface { } { " " : " " , " " : map [ string ] interface { } { " " : map [ string ] interface { } { " " : configmapref , " " : " " , } , } , } , map [ string ] interface { } { " " : " " , " " : map [ string ] interface { } { " " : map [ string ] interface { } { " " : secretref , " " : " " , } , } , } , } , } , } , } , } , } , } if metadatanamespace != " " { metadata := deployment [ " " ] . ( map [ string ] interface { } ) metadata [ " " ] = metadatanamespace } return deployment }
utility map to create a deployment object
with (metadatanamespace, metadataname) as key
and pointing to "refname" secret and configmap
utility map to create a deployment object with ( metadatanamespace metadataname ) as key and pointing to " refname " secret and configmap