k8s.io/kubernetes@v1.31.0-alpha.0.0.20240520171757-56147500dadc/cmd/kubeadm/app/apis/output/types.go (about)

     1  /*
     2  Copyright 2019 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 output
    18  
    19  import (
    20  	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
    21  
    22  	bootstraptokenv1 "k8s.io/kubernetes/cmd/kubeadm/app/apis/bootstraptoken/v1"
    23  )
    24  
    25  // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
    26  
    27  // BootstrapToken represents information for the bootstrap token output produced by kubeadm
    28  type BootstrapToken struct {
    29  	metav1.TypeMeta
    30  
    31  	bootstraptokenv1.BootstrapToken
    32  }
    33  
    34  // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
    35  
    36  // Images represents information for the output produced by 'kubeadm config images list'
    37  type Images struct {
    38  	metav1.TypeMeta
    39  
    40  	Images []string
    41  }
    42  
    43  // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
    44  
    45  // ComponentUpgradePlan represents information about upgrade plan for one component
    46  type ComponentUpgradePlan struct {
    47  	metav1.TypeMeta
    48  
    49  	Name           string
    50  	CurrentVersion string
    51  	NewVersion     string
    52  	NodeName       string
    53  }
    54  
    55  // ComponentConfigVersionState describes the current and desired version of a component config
    56  type ComponentConfigVersionState struct {
    57  	// Group points to the Kubernetes API group that covers the config
    58  	Group string
    59  
    60  	// CurrentVersion is the currently active component config version
    61  	// NOTE: This can be empty in case the config was not found on the cluster or it was unsupported
    62  	// kubeadm generated version
    63  	CurrentVersion string
    64  
    65  	// PreferredVersion is the component config version that is currently preferred by kubeadm for use.
    66  	// NOTE: As of today, this is the only version supported by kubeadm.
    67  	PreferredVersion string
    68  
    69  	// ManualUpgradeRequired indicates if users need to manually upgrade their component config versions. This happens if
    70  	// the CurrentVersion of the config is user supplied (or modified) and no longer supported. Users should upgrade
    71  	// their component configs to PreferredVersion or any other supported component config version.
    72  	ManualUpgradeRequired bool
    73  }
    74  
    75  // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
    76  
    77  // AvailableUpgrade represents information for a single available upgrade.
    78  type AvailableUpgrade struct {
    79  	metav1.TypeMeta
    80  
    81  	Description string
    82  
    83  	Components []ComponentUpgradePlan
    84  }
    85  
    86  // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
    87  
    88  // UpgradePlan represents information about upgrade plan for the output
    89  // produced by 'kubeadm upgrade plan'
    90  type UpgradePlan struct {
    91  	metav1.TypeMeta
    92  
    93  	AvailableUpgrades []AvailableUpgrade
    94  
    95  	ConfigVersions []ComponentConfigVersionState
    96  }
    97  
    98  // Certificate represents information for a certificate or a certificate authority when using the check-expiration command.
    99  type Certificate struct {
   100  	// Name of the certificate.
   101  	Name string
   102  
   103  	// ExpirationDate defines certificate expiration date in UTC following the RFC3339 format.
   104  	ExpirationDate metav1.Time
   105  
   106  	// ResidualTimeSeconds represents the duration in seconds relative to the residual time before expiration.
   107  	ResidualTimeSeconds int64
   108  
   109  	// ExternallyManaged defines if the certificate is externally managed.
   110  	ExternallyManaged bool
   111  
   112  	// CAName represents the name of the CA that signed the certificate.
   113  	// This field is empty for self-signed, root CA certificates.
   114  	CAName string
   115  
   116  	// Missing represents if the certificate is missing.
   117  	Missing bool
   118  }
   119  
   120  // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
   121  
   122  // CertificateExpirationInfo represents information for the output produced by 'kubeadm certs check-expiration'.
   123  type CertificateExpirationInfo struct {
   124  	metav1.TypeMeta
   125  
   126  	// Certificates holds a list of certificates to show expiration information for.
   127  	Certificates []Certificate
   128  
   129  	// CertificateAuthorities holds a list of certificate authorities to show expiration information for.
   130  	CertificateAuthorities []Certificate
   131  }