github.skymusic.top/operator-framework/operator-sdk@v0.8.2/hack/image/helm/scaffold-helm-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  	"log"
    19  
    20  	"github.com/operator-framework/operator-sdk/internal/pkg/scaffold"
    21  	"github.com/operator-framework/operator-sdk/internal/pkg/scaffold/helm"
    22  	"github.com/operator-framework/operator-sdk/internal/pkg/scaffold/input"
    23  	"github.com/operator-framework/operator-sdk/internal/util/projutil"
    24  )
    25  
    26  // main renders scaffolds that are required to build the helm 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/helm-operator` and then run
    29  // `operator-sdk build`.
    30  func main() {
    31  	cfg := &input.Config{
    32  		AbsProjectPath: projutil.MustGetwd(),
    33  		ProjectName:    "helm-operator",
    34  	}
    35  
    36  	s := &scaffold.Scaffold{}
    37  	err := s.Execute(cfg,
    38  		&helm.DockerfileHybrid{},
    39  		&helm.Entrypoint{},
    40  		&helm.UserSetup{},
    41  	)
    42  	if err != nil {
    43  		log.Fatalf("add scaffold failed: (%v)", err)
    44  	}
    45  }