github.skymusic.top/operator-framework/operator-sdk@v0.8.2/hack/image/ansible/scaffold-ansible-image.go (about) 1 // Copyright 2019 The Operator-SDK Authors 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 main 16 17 import ( 18 "github.com/operator-framework/operator-sdk/internal/pkg/scaffold" 19 "github.com/operator-framework/operator-sdk/internal/pkg/scaffold/ansible" 20 "github.com/operator-framework/operator-sdk/internal/pkg/scaffold/input" 21 "github.com/operator-framework/operator-sdk/internal/util/projutil" 22 23 log "github.com/sirupsen/logrus" 24 ) 25 26 // main renders scaffolds that are required to build the ansible operator base 27 // image. It is intended for release engineering use only. After running this, 28 // you can place a binary in `build/_output/bin/ansible-operator` and then run 29 // `operator-sdk build`. 30 func main() { 31 cfg := &input.Config{ 32 AbsProjectPath: projutil.MustGetwd(), 33 ProjectName: "ansible-operator", 34 } 35 36 s := &scaffold.Scaffold{} 37 err := s.Execute(cfg, 38 &ansible.DockerfileHybrid{}, 39 &ansible.Entrypoint{}, 40 &ansible.UserSetup{}, 41 &ansible.K8sStatus{}, 42 &ansible.AoLogs{}, 43 ) 44 if err != nil { 45 log.Fatalf("Add scaffold failed: (%v)", err) 46 } 47 }