...

Source file src/github.com/cert-manager/issuer-lib/controllers/signer/err_permanent.go

Documentation: github.com/cert-manager/issuer-lib/controllers/signer

     1  /*
     2  Copyright 2023 The cert-manager 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 signer
    18  
    19  // PermanentError is returned if it is impossible for the resource to
    20  // get in a Ready state without being changed. It should not be used
    21  // if there is any way to fix the error by altering the environment/
    22  // other resources. The client should not try again after receiving
    23  // this error.
    24  //
    25  // For the Check function, this error is useful when we detected an
    26  // invalid configuration/ setting in the Issuer or ClusterIssuer resource.
    27  // This should only happen very rarely, because of webhook validation.
    28  //
    29  // For the Sign function, this error is useful when we detected an
    30  // error that will only get resolved by creating a new CertificateRequest,
    31  // for example when it is required to craft a new CSR.
    32  //
    33  // > This error should be returned by the Sign or Check function.
    34  type PermanentError struct {
    35  	Err error
    36  }
    37  
    38  var _ error = PermanentError{}
    39  
    40  func (ve PermanentError) Unwrap() error {
    41  	return ve.Err
    42  }
    43  
    44  func (ve PermanentError) Error() string {
    45  	return ve.Err.Error()
    46  }
    47  

View as plain text