github.com/fabianvf/ocp-release-operator-sdk@v0.0.0-20190426141702-57620ee2f090/internal/pkg/scaffold/ansible/gopkgtoml.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 ansible
    16  
    17  import (
    18  	"github.com/operator-framework/operator-sdk/internal/pkg/scaffold"
    19  	"github.com/operator-framework/operator-sdk/internal/pkg/scaffold/input"
    20  )
    21  
    22  // GopkgToml - the Gopkg.toml file for a hybrid operator
    23  type GopkgToml struct {
    24  	input.Input
    25  }
    26  
    27  func (s *GopkgToml) GetInput() (input.Input, error) {
    28  	if s.Path == "" {
    29  		s.Path = scaffold.GopkgTomlFile
    30  	}
    31  	s.TemplateBody = gopkgTomlTmpl
    32  	return s.Input, nil
    33  }
    34  
    35  const gopkgTomlTmpl = `[[constraint]]
    36    name = "github.com/operator-framework/operator-sdk"
    37    # The version rule is used for a specific release and the master branch for in between releases.
    38    branch = "v0.7.x" #osdk_branch_annotation
    39    # version = "=v0.7.0" #osdk_version_annotation
    40  
    41  [[override]]
    42    name = "k8s.io/api"
    43    version = "kubernetes-1.13.1"
    44  
    45  [[override]]
    46    name = "k8s.io/apimachinery"
    47    version = "kubernetes-1.13.1"
    48  
    49  [[override]]
    50    name = "k8s.io/client-go"
    51    version = "kubernetes-1.13.1"
    52  
    53  [prune]
    54    go-tests = true
    55    unused-packages = true
    56  `