github.com/IBM-Blockchain/fabric-operator@v1.0.4/pkg/k8s/controllerclient/client_structs.go (about)

     1  /*
     2   * Copyright contributors to the Hyperledger Fabric Operator project
     3   *
     4   * SPDX-License-Identifier: Apache-2.0
     5   *
     6   * Licensed under the Apache License, Version 2.0 (the "License");
     7   * you may not use this file except in compliance with the License.
     8   * You may obtain a copy of the License at:
     9   *
    10   * 	  http://www.apache.org/licenses/LICENSE-2.0
    11   *
    12   * Unless required by applicable law or agreed to in writing, software
    13   * distributed under the License is distributed on an "AS IS" BASIS,
    14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    15   * See the License for the specific language governing permissions and
    16   * limitations under the License.
    17   */
    18  
    19  package controllerclient
    20  
    21  import (
    22  	v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
    23  	"k8s.io/apimachinery/pkg/runtime"
    24  	k8sclient "sigs.k8s.io/controller-runtime/pkg/client"
    25  )
    26  
    27  // type Object interface {
    28  // 	runtime.Object
    29  // 	v1.Object
    30  // }
    31  
    32  type CreateOption struct {
    33  	Owner  v1.Object
    34  	Scheme *runtime.Scheme
    35  	Opts   []k8sclient.CreateOption
    36  }
    37  
    38  type PatchOption struct {
    39  	Resilient *ResilientPatch
    40  	Opts      []k8sclient.PatchOption
    41  }
    42  
    43  type ResilientPatch struct {
    44  	Retry    int
    45  	Into     k8sclient.Object
    46  	Strategy func(k8sclient.Object) k8sclient.Patch
    47  }
    48  
    49  type UpdateOption struct {
    50  	Owner  v1.Object
    51  	Scheme *runtime.Scheme
    52  	Opts   []k8sclient.UpdateOption
    53  }
    54  
    55  type CreateOrUpdateOption struct {
    56  	Owner  v1.Object
    57  	Scheme *runtime.Scheme
    58  }