func ServiceCreate(d *schema.ResourceData, meta interface{}) error { log.Printf("[DEDUG] ServiceCreate") kubeClient := meta.(*config.KubeProviderClient) srvc := build.Service(d, kubeClient.Version) kubeServices := kubeClient.KubeClient.Services(kubeClient.Namespace) srvcCreate, err := kubeServices.Create(srvc) if err != nil { return err } d.SetId(srvcCreate.ObjectMeta.Name) return ServiceRead(d, meta) }
func ServiceUpdate(d *schema.ResourceData, meta interface{}) error { log.Printf("[DEBUG] ServiceUpdate") log.Printf("resource data state: %v", d.State()) kubeClient := meta.(*config.KubeProviderClient) srvc := build.Service(d, kubeClient.Version) kubeServices := kubeClient.KubeClient.Services(kubeClient.Namespace) // This will most likely need deleted and recreated srvcCreate, err := kubeServices.Update(srvc) if err != nil { return err } d.SetId(srvcCreate.ObjectMeta.Name) return ServiceRead(d, meta) }