github.com/kubearmor/cilium@v1.6.12/api/v1/models/daemon_configuration_status.go (about)

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  package models
     4  
     5  // This file was generated by the swagger tool.
     6  // Editing this file might prove futile when you re-run the swagger generate command
     7  
     8  import (
     9  	strfmt "github.com/go-openapi/strfmt"
    10  
    11  	"github.com/go-openapi/errors"
    12  	"github.com/go-openapi/swag"
    13  )
    14  
    15  // DaemonConfigurationStatus Response to a daemon configuration request. Contains the addressing
    16  // information, k8s, node monitor and immutable and mutable configuration
    17  // settings.
    18  //
    19  // swagger:model DaemonConfigurationStatus
    20  type DaemonConfigurationStatus struct {
    21  
    22  	// addressing
    23  	Addressing *NodeAddressing `json:"addressing,omitempty"`
    24  
    25  	// datapath mode
    26  	DatapathMode DatapathMode `json:"datapathMode,omitempty"`
    27  
    28  	// MTU on workload facing devices
    29  	DeviceMTU int64 `json:"deviceMTU,omitempty"`
    30  
    31  	// Immutable configuration (read-only)
    32  	Immutable ConfigurationMap `json:"immutable,omitempty"`
    33  
    34  	// Configured IPAM mode
    35  	IPAMMode string `json:"ipam-mode,omitempty"`
    36  
    37  	// ipvlan configuration
    38  	IpvlanConfiguration *IpvlanConfiguration `json:"ipvlanConfiguration,omitempty"`
    39  
    40  	// k8s configuration
    41  	K8sConfiguration string `json:"k8s-configuration,omitempty"`
    42  
    43  	// k8s endpoint
    44  	K8sEndpoint string `json:"k8s-endpoint,omitempty"`
    45  
    46  	// kvstore configuration
    47  	KvstoreConfiguration *KVstoreConfiguration `json:"kvstoreConfiguration,omitempty"`
    48  
    49  	// Status of masquerading feature
    50  	Masquerade bool `json:"masquerade,omitempty"`
    51  
    52  	// Status of the node monitor
    53  	NodeMonitor *MonitorStatus `json:"nodeMonitor,omitempty"`
    54  
    55  	// Currently applied configuration
    56  	Realized *DaemonConfigurationSpec `json:"realized,omitempty"`
    57  
    58  	// MTU for network facing routes
    59  	RouteMTU int64 `json:"routeMTU,omitempty"`
    60  }
    61  
    62  // Validate validates this daemon configuration status
    63  func (m *DaemonConfigurationStatus) Validate(formats strfmt.Registry) error {
    64  	var res []error
    65  
    66  	if err := m.validateAddressing(formats); err != nil {
    67  		res = append(res, err)
    68  	}
    69  
    70  	if err := m.validateDatapathMode(formats); err != nil {
    71  		res = append(res, err)
    72  	}
    73  
    74  	if err := m.validateImmutable(formats); err != nil {
    75  		res = append(res, err)
    76  	}
    77  
    78  	if err := m.validateIpvlanConfiguration(formats); err != nil {
    79  		res = append(res, err)
    80  	}
    81  
    82  	if err := m.validateKvstoreConfiguration(formats); err != nil {
    83  		res = append(res, err)
    84  	}
    85  
    86  	if err := m.validateNodeMonitor(formats); err != nil {
    87  		res = append(res, err)
    88  	}
    89  
    90  	if err := m.validateRealized(formats); err != nil {
    91  		res = append(res, err)
    92  	}
    93  
    94  	if len(res) > 0 {
    95  		return errors.CompositeValidationError(res...)
    96  	}
    97  	return nil
    98  }
    99  
   100  func (m *DaemonConfigurationStatus) validateAddressing(formats strfmt.Registry) error {
   101  
   102  	if swag.IsZero(m.Addressing) { // not required
   103  		return nil
   104  	}
   105  
   106  	if m.Addressing != nil {
   107  		if err := m.Addressing.Validate(formats); err != nil {
   108  			if ve, ok := err.(*errors.Validation); ok {
   109  				return ve.ValidateName("addressing")
   110  			}
   111  			return err
   112  		}
   113  	}
   114  
   115  	return nil
   116  }
   117  
   118  func (m *DaemonConfigurationStatus) validateDatapathMode(formats strfmt.Registry) error {
   119  
   120  	if swag.IsZero(m.DatapathMode) { // not required
   121  		return nil
   122  	}
   123  
   124  	if err := m.DatapathMode.Validate(formats); err != nil {
   125  		if ve, ok := err.(*errors.Validation); ok {
   126  			return ve.ValidateName("datapathMode")
   127  		}
   128  		return err
   129  	}
   130  
   131  	return nil
   132  }
   133  
   134  func (m *DaemonConfigurationStatus) validateImmutable(formats strfmt.Registry) error {
   135  
   136  	if swag.IsZero(m.Immutable) { // not required
   137  		return nil
   138  	}
   139  
   140  	if err := m.Immutable.Validate(formats); err != nil {
   141  		if ve, ok := err.(*errors.Validation); ok {
   142  			return ve.ValidateName("immutable")
   143  		}
   144  		return err
   145  	}
   146  
   147  	return nil
   148  }
   149  
   150  func (m *DaemonConfigurationStatus) validateIpvlanConfiguration(formats strfmt.Registry) error {
   151  
   152  	if swag.IsZero(m.IpvlanConfiguration) { // not required
   153  		return nil
   154  	}
   155  
   156  	if m.IpvlanConfiguration != nil {
   157  		if err := m.IpvlanConfiguration.Validate(formats); err != nil {
   158  			if ve, ok := err.(*errors.Validation); ok {
   159  				return ve.ValidateName("ipvlanConfiguration")
   160  			}
   161  			return err
   162  		}
   163  	}
   164  
   165  	return nil
   166  }
   167  
   168  func (m *DaemonConfigurationStatus) validateKvstoreConfiguration(formats strfmt.Registry) error {
   169  
   170  	if swag.IsZero(m.KvstoreConfiguration) { // not required
   171  		return nil
   172  	}
   173  
   174  	if m.KvstoreConfiguration != nil {
   175  		if err := m.KvstoreConfiguration.Validate(formats); err != nil {
   176  			if ve, ok := err.(*errors.Validation); ok {
   177  				return ve.ValidateName("kvstoreConfiguration")
   178  			}
   179  			return err
   180  		}
   181  	}
   182  
   183  	return nil
   184  }
   185  
   186  func (m *DaemonConfigurationStatus) validateNodeMonitor(formats strfmt.Registry) error {
   187  
   188  	if swag.IsZero(m.NodeMonitor) { // not required
   189  		return nil
   190  	}
   191  
   192  	if m.NodeMonitor != nil {
   193  		if err := m.NodeMonitor.Validate(formats); err != nil {
   194  			if ve, ok := err.(*errors.Validation); ok {
   195  				return ve.ValidateName("nodeMonitor")
   196  			}
   197  			return err
   198  		}
   199  	}
   200  
   201  	return nil
   202  }
   203  
   204  func (m *DaemonConfigurationStatus) validateRealized(formats strfmt.Registry) error {
   205  
   206  	if swag.IsZero(m.Realized) { // not required
   207  		return nil
   208  	}
   209  
   210  	if m.Realized != nil {
   211  		if err := m.Realized.Validate(formats); err != nil {
   212  			if ve, ok := err.(*errors.Validation); ok {
   213  				return ve.ValidateName("realized")
   214  			}
   215  			return err
   216  		}
   217  	}
   218  
   219  	return nil
   220  }
   221  
   222  // MarshalBinary interface implementation
   223  func (m *DaemonConfigurationStatus) MarshalBinary() ([]byte, error) {
   224  	if m == nil {
   225  		return nil, nil
   226  	}
   227  	return swag.WriteJSON(m)
   228  }
   229  
   230  // UnmarshalBinary interface implementation
   231  func (m *DaemonConfigurationStatus) UnmarshalBinary(b []byte) error {
   232  	var res DaemonConfigurationStatus
   233  	if err := swag.ReadJSON(b, &res); err != nil {
   234  		return err
   235  	}
   236  	*m = res
   237  	return nil
   238  }