sigs.k8s.io/cluster-api@v1.7.1/internal/contract/bootstrap.go (about)

     1  /*
     2  Copyright 2022 The Kubernetes Authors.
     3  
     4  Licensed under the Apache License, Version 2.0 (the "License");
     5  you may not use this file except in compliance with the License.
     6  You may obtain a copy of the License at
     7  
     8      http://www.apache.org/licenses/LICENSE-2.0
     9  
    10  Unless required by applicable law or agreed to in writing, software
    11  distributed under the License is distributed on an "AS IS" BASIS,
    12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  See the License for the specific language governing permissions and
    14  limitations under the License.
    15  */
    16  
    17  package contract
    18  
    19  import "sync"
    20  
    21  // BootstrapContract encodes information about the Cluster API contract for bootstrap objects.
    22  type BootstrapContract struct{}
    23  
    24  var bootstrap *BootstrapContract
    25  var onceBootstrap sync.Once
    26  
    27  // Bootstrap provide access to the information about the Cluster API contract for bootstrap objects.
    28  func Bootstrap() *BootstrapContract {
    29  	onceBootstrap.Do(func() {
    30  		bootstrap = &BootstrapContract{}
    31  	})
    32  	return bootstrap
    33  }
    34  
    35  // Ready provide access to status.ready field in a bootstrap object.
    36  func (b *BootstrapContract) Ready() *Bool {
    37  	return &Bool{
    38  		path: []string{"status", "ready"},
    39  	}
    40  }
    41  
    42  // DataSecretName provide access to status.dataSecretName field in a bootstrap object.
    43  func (b *BootstrapContract) DataSecretName() *String {
    44  	return &String{
    45  		path: []string{"status", "dataSecretName"},
    46  	}
    47  }
    48  
    49  // FailureReason provides access to the status.failureReason field in an bootstrap object. Note that this field is optional.
    50  func (b *BootstrapContract) FailureReason() *String {
    51  	return &String{
    52  		path: []string{"status", "failureReason"},
    53  	}
    54  }
    55  
    56  // FailureMessage provides access to the status.failureMessage field in an bootstrap object. Note that this field is optional.
    57  func (b *BootstrapContract) FailureMessage() *String {
    58  	return &String{
    59  		path: []string{"status", "failureMessage"},
    60  	}
    61  }