diff --git a/castai/sdk/api.gen.go b/castai/sdk/api.gen.go index 92680891..ef11170f 100644 --- a/castai/sdk/api.gen.go +++ b/castai/sdk/api.gen.go @@ -51,6 +51,13 @@ const ( Ssd CastaiInventoryV1beta1StorageInfoDeviceType = "ssd" ) +// Defines values for CastaiSsoV1beta1OIDCType. +const ( + TYPEBACKCHANNEL CastaiSsoV1beta1OIDCType = "TYPE_BACK_CHANNEL" + TYPEFRONTCHANNEL CastaiSsoV1beta1OIDCType = "TYPE_FRONT_CHANNEL" + TYPEUNKNOWN CastaiSsoV1beta1OIDCType = "TYPE_UNKNOWN" +) + // Defines values for CastaiSsoV1beta1SSOConnectionStatus. const ( STATUSACTIVE CastaiSsoV1beta1SSOConnectionStatus = "STATUS_ACTIVE" @@ -601,6 +608,9 @@ type CastaiSsoV1beta1CreateSSOConnection struct { // Name is the name of the connection. Name string `json:"name"` + // OIDC represents a OIDC connector. + Oidc *CastaiSsoV1beta1OIDC `json:"oidc,omitempty"` + // Okta represents a Okta connector. Okta *CastaiSsoV1beta1Okta `json:"okta,omitempty"` } @@ -613,6 +623,32 @@ type CastaiSsoV1beta1ListSSOConnectionsResponse struct { Connections []CastaiSsoV1beta1SSOConnection `json:"connections"` } +// OIDC represents a OIDC connector. +type CastaiSsoV1beta1OIDC struct { + // ClientId is the client id of the OIDC. + ClientId string `json:"clientId"` + + // ClientSecret is the client secret when using back_channel type of connection. + ClientSecret *string `json:"clientSecret"` + + // IssuerUrl is the URL of the discovery document of the OpenID Connect provider you want to connect with. + IssuerUrl string `json:"issuerUrl"` + + // Type is the type of the OIDC connection. + // + // - TYPE_UNKNOWN: TypeUknown is the default status. + // - TYPE_BACK_CHANNEL: TypeBackChannel is the back channel type of OIDC connection. + // - TYPE_FRONT_CHANNEL: TypeFrontChannel is the front channel type of OIDC connection. + Type CastaiSsoV1beta1OIDCType `json:"type"` +} + +// Type is the type of the OIDC connection. +// +// - TYPE_UNKNOWN: TypeUknown is the default status. +// - TYPE_BACK_CHANNEL: TypeBackChannel is the back channel type of OIDC connection. +// - TYPE_FRONT_CHANNEL: TypeFrontChannel is the front channel type of OIDC connection. +type CastaiSsoV1beta1OIDCType string + // Okta represents a Okta connector. type CastaiSsoV1beta1Okta struct { // ClientId is the client id of the Okta. @@ -645,6 +681,9 @@ type CastaiSsoV1beta1SSOConnection struct { // Name is the name of the connection. Name string `json:"name"` + // OIDC represents a OIDC connector. + Oidc *CastaiSsoV1beta1OIDC `json:"oidc,omitempty"` + // Okta represents a Okta connector. Okta *CastaiSsoV1beta1Okta `json:"okta,omitempty"` @@ -679,6 +718,9 @@ type CastaiSsoV1beta1UpdateSSOConnection struct { // Name is the name of the connection. Name *string `json:"name,omitempty"` + // OIDC represents a OIDC connector. + Oidc *CastaiSsoV1beta1OIDC `json:"oidc,omitempty"` + // Okta represents a Okta connector. Okta *CastaiSsoV1beta1Okta `json:"okta,omitempty"` } @@ -1023,12 +1065,18 @@ type ExternalclusterV1Cluster struct { Status *string `json:"status,omitempty"` // Cluster subnets. - Subnets *[]ExternalclusterV1Subnet `json:"subnets,omitempty"` + Subnets *[]ExternalclusterV1Subnet `json:"subnets,omitempty"` + Tags *ExternalclusterV1Cluster_Tags `json:"tags,omitempty"` // Cluster zones. Zones *[]ExternalclusterV1Zone `json:"zones,omitempty"` } +// ExternalclusterV1Cluster_Tags defines model for ExternalclusterV1Cluster.Tags. +type ExternalclusterV1Cluster_Tags struct { + AdditionalProperties map[string]string `json:"-"` +} + // ExternalclusterV1ClusterReconcileInfo defines model for externalcluster.v1.Cluster.ReconcileInfo. type ExternalclusterV1ClusterReconcileInfo struct { // Shows last reconcile error if any. @@ -1289,6 +1337,12 @@ type ExternalclusterV1Node_Labels struct { AdditionalProperties map[string]string `json:"-"` } +// NodeAffinity provides control over the assignment of individual nodes to dedicated host instances. +type ExternalclusterV1NodeAffinity struct { + // The name of the dedicated group. + DedicatedGroup *string `json:"dedicatedGroup"` +} + // ExternalclusterV1NodeConfig defines model for externalcluster.v1.NodeConfig. type ExternalclusterV1NodeConfig struct { // ID reference of Node configuration (template) to be used for node creation. Supersedes Configuration Name. @@ -1314,6 +1368,9 @@ type ExternalclusterV1NodeConfig struct { // Node Kubernetes taints. KubernetesTaints *[]ExternalclusterV1Taint `json:"kubernetesTaints,omitempty"` + // NodeAffinity provides control over the assignment of individual nodes to dedicated host instances. + NodeAffinity *ExternalclusterV1NodeAffinity `json:"nodeAffinity,omitempty"` + // NodeSpotConfig defines if node should be created as spot instance, and params for creation. SpotConfig *ExternalclusterV1NodeSpotConfig `json:"spotConfig,omitempty"` @@ -1472,6 +1529,9 @@ type ExternalclusterV1Taint struct { Value string `json:"value"` } +// UpdateClusterTagsResponse result of cluster tags update. +type ExternalclusterV1UpdateClusterTagsResponse = map[string]interface{} + // UpdateEKSClusterParams defines updatable EKS cluster configuration. type ExternalclusterV1UpdateEKSClusterParams struct { AssumeRoleArn *string `json:"assumeRoleArn,omitempty"` @@ -2508,6 +2568,11 @@ type ExternalClusterAPIDeleteNodeParams struct { // ExternalClusterAPIDrainNodeJSONBody defines parameters for ExternalClusterAPIDrainNode. type ExternalClusterAPIDrainNodeJSONBody = ExternalclusterV1DrainConfig +// ExternalClusterAPIUpdateClusterTagsJSONBody defines parameters for ExternalClusterAPIUpdateClusterTags. +type ExternalClusterAPIUpdateClusterTagsJSONBody struct { + AdditionalProperties map[string]string `json:"-"` +} + // UsersAPIUpdateCurrentUserProfileJSONBody defines parameters for UsersAPIUpdateCurrentUserProfile. type UsersAPIUpdateCurrentUserProfileJSONBody = CastaiUsersV1beta1User @@ -2620,6 +2685,9 @@ type ExternalClusterAPIAddNodeJSONRequestBody = ExternalClusterAPIAddNodeJSONBod // ExternalClusterAPIDrainNodeJSONRequestBody defines body for ExternalClusterAPIDrainNode for application/json ContentType. type ExternalClusterAPIDrainNodeJSONRequestBody = ExternalClusterAPIDrainNodeJSONBody +// ExternalClusterAPIUpdateClusterTagsJSONRequestBody defines body for ExternalClusterAPIUpdateClusterTags for application/json ContentType. +type ExternalClusterAPIUpdateClusterTagsJSONRequestBody ExternalClusterAPIUpdateClusterTagsJSONBody + // UsersAPIUpdateCurrentUserProfileJSONRequestBody defines body for UsersAPIUpdateCurrentUserProfile for application/json ContentType. type UsersAPIUpdateCurrentUserProfileJSONRequestBody = UsersAPIUpdateCurrentUserProfileJSONBody @@ -2653,6 +2721,59 @@ type SSOAPICreateSSOConnectionJSONRequestBody = SSOAPICreateSSOConnectionJSONBod // SSOAPIUpdateSSOConnectionJSONRequestBody defines body for SSOAPIUpdateSSOConnection for application/json ContentType. type SSOAPIUpdateSSOConnectionJSONRequestBody = SSOAPIUpdateSSOConnectionJSONBody +// Getter for additional properties for ExternalClusterAPIUpdateClusterTagsJSONBody. Returns the specified +// element and whether it was found +func (a ExternalClusterAPIUpdateClusterTagsJSONBody) Get(fieldName string) (value string, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for ExternalClusterAPIUpdateClusterTagsJSONBody +func (a *ExternalClusterAPIUpdateClusterTagsJSONBody) Set(fieldName string, value string) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]string) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for ExternalClusterAPIUpdateClusterTagsJSONBody to handle AdditionalProperties +func (a *ExternalClusterAPIUpdateClusterTagsJSONBody) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]string) + for fieldName, fieldBuf := range object { + var fieldVal string + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for ExternalClusterAPIUpdateClusterTagsJSONBody to handle AdditionalProperties +func (a ExternalClusterAPIUpdateClusterTagsJSONBody) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + // Getter for additional properties for CastaiEvictorV1LabelSelector_MatchLabels. Returns the specified // element and whether it was found func (a CastaiEvictorV1LabelSelector_MatchLabels) Get(fieldName string) (value string, found bool) { @@ -2706,6 +2827,59 @@ func (a CastaiEvictorV1LabelSelector_MatchLabels) MarshalJSON() ([]byte, error) return json.Marshal(object) } +// Getter for additional properties for ExternalclusterV1Cluster_Tags. Returns the specified +// element and whether it was found +func (a ExternalclusterV1Cluster_Tags) Get(fieldName string) (value string, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for ExternalclusterV1Cluster_Tags +func (a *ExternalclusterV1Cluster_Tags) Set(fieldName string, value string) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]string) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for ExternalclusterV1Cluster_Tags to handle AdditionalProperties +func (a *ExternalclusterV1Cluster_Tags) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]string) + for fieldName, fieldBuf := range object { + var fieldVal string + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for ExternalclusterV1Cluster_Tags to handle AdditionalProperties +func (a ExternalclusterV1Cluster_Tags) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + // Getter for additional properties for ExternalclusterV1EKSClusterParams_Tags. Returns the specified // element and whether it was found func (a ExternalclusterV1EKSClusterParams_Tags) Get(fieldName string) (value string, found bool) { diff --git a/castai/sdk/client.gen.go b/castai/sdk/client.gen.go index 366819db..33a1c432 100644 --- a/castai/sdk/client.gen.go +++ b/castai/sdk/client.gen.go @@ -286,6 +286,11 @@ type ClientInterface interface { // ExternalClusterAPIReconcileCluster request ExternalClusterAPIReconcileCluster(ctx context.Context, clusterId string, reqEditors ...RequestEditorFn) (*http.Response, error) + // ExternalClusterAPIUpdateClusterTags request with any body + ExternalClusterAPIUpdateClusterTagsWithBody(ctx context.Context, clusterId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + ExternalClusterAPIUpdateClusterTags(ctx context.Context, clusterId string, body ExternalClusterAPIUpdateClusterTagsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // ExternalClusterAPICreateClusterToken request ExternalClusterAPICreateClusterToken(ctx context.Context, clusterId string, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -1272,6 +1277,30 @@ func (c *Client) ExternalClusterAPIReconcileCluster(ctx context.Context, cluster return c.Client.Do(req) } +func (c *Client) ExternalClusterAPIUpdateClusterTagsWithBody(ctx context.Context, clusterId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewExternalClusterAPIUpdateClusterTagsRequestWithBody(c.Server, clusterId, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ExternalClusterAPIUpdateClusterTags(ctx context.Context, clusterId string, body ExternalClusterAPIUpdateClusterTagsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewExternalClusterAPIUpdateClusterTagsRequest(c.Server, clusterId, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + func (c *Client) ExternalClusterAPICreateClusterToken(ctx context.Context, clusterId string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewExternalClusterAPICreateClusterTokenRequest(c.Server, clusterId) if err != nil { @@ -4070,6 +4099,53 @@ func NewExternalClusterAPIReconcileClusterRequest(server string, clusterId strin return req, nil } +// NewExternalClusterAPIUpdateClusterTagsRequest calls the generic ExternalClusterAPIUpdateClusterTags builder with application/json body +func NewExternalClusterAPIUpdateClusterTagsRequest(server string, clusterId string, body ExternalClusterAPIUpdateClusterTagsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewExternalClusterAPIUpdateClusterTagsRequestWithBody(server, clusterId, "application/json", bodyReader) +} + +// NewExternalClusterAPIUpdateClusterTagsRequestWithBody generates requests for ExternalClusterAPIUpdateClusterTags with any type of body +func NewExternalClusterAPIUpdateClusterTagsRequestWithBody(server string, clusterId string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "clusterId", runtime.ParamLocationPath, clusterId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/kubernetes/external-clusters/%s/tags", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + // NewExternalClusterAPICreateClusterTokenRequest generates requests for ExternalClusterAPICreateClusterToken func NewExternalClusterAPICreateClusterTokenRequest(server string, clusterId string) (*http.Request, error) { var err error @@ -5594,6 +5670,11 @@ type ClientWithResponsesInterface interface { // ExternalClusterAPIReconcileCluster request ExternalClusterAPIReconcileClusterWithResponse(ctx context.Context, clusterId string) (*ExternalClusterAPIReconcileClusterResponse, error) + // ExternalClusterAPIUpdateClusterTags request with any body + ExternalClusterAPIUpdateClusterTagsWithBodyWithResponse(ctx context.Context, clusterId string, contentType string, body io.Reader) (*ExternalClusterAPIUpdateClusterTagsResponse, error) + + ExternalClusterAPIUpdateClusterTagsWithResponse(ctx context.Context, clusterId string, body ExternalClusterAPIUpdateClusterTagsJSONRequestBody) (*ExternalClusterAPIUpdateClusterTagsResponse, error) + // ExternalClusterAPICreateClusterToken request ExternalClusterAPICreateClusterTokenWithResponse(ctx context.Context, clusterId string) (*ExternalClusterAPICreateClusterTokenResponse, error) @@ -7284,6 +7365,36 @@ func (r ExternalClusterAPIReconcileClusterResponse) GetBody() []byte { // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 +type ExternalClusterAPIUpdateClusterTagsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ExternalclusterV1UpdateClusterTagsResponse +} + +// Status returns HTTPResponse.Status +func (r ExternalClusterAPIUpdateClusterTagsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ExternalClusterAPIUpdateClusterTagsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 +// Body returns body of byte array +func (r ExternalClusterAPIUpdateClusterTagsResponse) GetBody() []byte { + return r.Body +} + +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 + type ExternalClusterAPICreateClusterTokenResponse struct { Body []byte HTTPResponse *http.Response @@ -8900,6 +9011,23 @@ func (c *ClientWithResponses) ExternalClusterAPIReconcileClusterWithResponse(ctx return ParseExternalClusterAPIReconcileClusterResponse(rsp) } +// ExternalClusterAPIUpdateClusterTagsWithBodyWithResponse request with arbitrary body returning *ExternalClusterAPIUpdateClusterTagsResponse +func (c *ClientWithResponses) ExternalClusterAPIUpdateClusterTagsWithBodyWithResponse(ctx context.Context, clusterId string, contentType string, body io.Reader) (*ExternalClusterAPIUpdateClusterTagsResponse, error) { + rsp, err := c.ExternalClusterAPIUpdateClusterTagsWithBody(ctx, clusterId, contentType, body) + if err != nil { + return nil, err + } + return ParseExternalClusterAPIUpdateClusterTagsResponse(rsp) +} + +func (c *ClientWithResponses) ExternalClusterAPIUpdateClusterTagsWithResponse(ctx context.Context, clusterId string, body ExternalClusterAPIUpdateClusterTagsJSONRequestBody) (*ExternalClusterAPIUpdateClusterTagsResponse, error) { + rsp, err := c.ExternalClusterAPIUpdateClusterTags(ctx, clusterId, body) + if err != nil { + return nil, err + } + return ParseExternalClusterAPIUpdateClusterTagsResponse(rsp) +} + // ExternalClusterAPICreateClusterTokenWithResponse request returning *ExternalClusterAPICreateClusterTokenResponse func (c *ClientWithResponses) ExternalClusterAPICreateClusterTokenWithResponse(ctx context.Context, clusterId string) (*ExternalClusterAPICreateClusterTokenResponse, error) { rsp, err := c.ExternalClusterAPICreateClusterToken(ctx, clusterId) @@ -10627,6 +10755,32 @@ func ParseExternalClusterAPIReconcileClusterResponse(rsp *http.Response) (*Exter return response, nil } +// ParseExternalClusterAPIUpdateClusterTagsResponse parses an HTTP response from a ExternalClusterAPIUpdateClusterTagsWithResponse call +func ParseExternalClusterAPIUpdateClusterTagsResponse(rsp *http.Response) (*ExternalClusterAPIUpdateClusterTagsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &ExternalClusterAPIUpdateClusterTagsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest ExternalclusterV1UpdateClusterTagsResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + // ParseExternalClusterAPICreateClusterTokenResponse parses an HTTP response from a ExternalClusterAPICreateClusterTokenWithResponse call func ParseExternalClusterAPICreateClusterTokenResponse(rsp *http.Response) (*ExternalClusterAPICreateClusterTokenResponse, error) { bodyBytes, err := ioutil.ReadAll(rsp.Body) diff --git a/castai/sdk/mock/client.go b/castai/sdk/mock/client.go index 6a7603d5..95bd76f6 100644 --- a/castai/sdk/mock/client.go +++ b/castai/sdk/mock/client.go @@ -815,6 +815,46 @@ func (mr *MockClientInterfaceMockRecorder) ExternalClusterAPIUpdateCluster(ctx, return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExternalClusterAPIUpdateCluster", reflect.TypeOf((*MockClientInterface)(nil).ExternalClusterAPIUpdateCluster), varargs...) } +// ExternalClusterAPIUpdateClusterTags mocks base method. +func (m *MockClientInterface) ExternalClusterAPIUpdateClusterTags(ctx context.Context, clusterId string, body sdk.ExternalClusterAPIUpdateClusterTagsJSONRequestBody, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clusterId, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ExternalClusterAPIUpdateClusterTags", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ExternalClusterAPIUpdateClusterTags indicates an expected call of ExternalClusterAPIUpdateClusterTags. +func (mr *MockClientInterfaceMockRecorder) ExternalClusterAPIUpdateClusterTags(ctx, clusterId, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clusterId, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExternalClusterAPIUpdateClusterTags", reflect.TypeOf((*MockClientInterface)(nil).ExternalClusterAPIUpdateClusterTags), varargs...) +} + +// ExternalClusterAPIUpdateClusterTagsWithBody mocks base method. +func (m *MockClientInterface) ExternalClusterAPIUpdateClusterTagsWithBody(ctx context.Context, clusterId, contentType string, body io.Reader, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clusterId, contentType, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ExternalClusterAPIUpdateClusterTagsWithBody", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ExternalClusterAPIUpdateClusterTagsWithBody indicates an expected call of ExternalClusterAPIUpdateClusterTagsWithBody. +func (mr *MockClientInterfaceMockRecorder) ExternalClusterAPIUpdateClusterTagsWithBody(ctx, clusterId, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clusterId, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExternalClusterAPIUpdateClusterTagsWithBody", reflect.TypeOf((*MockClientInterface)(nil).ExternalClusterAPIUpdateClusterTagsWithBody), varargs...) +} + // ExternalClusterAPIUpdateClusterWithBody mocks base method. func (m *MockClientInterface) ExternalClusterAPIUpdateClusterWithBody(ctx context.Context, clusterId, contentType string, body io.Reader, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { m.ctrl.T.Helper() @@ -2958,6 +2998,36 @@ func (mr *MockClientWithResponsesInterfaceMockRecorder) ExternalClusterAPIRegist return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExternalClusterAPIRegisterClusterWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).ExternalClusterAPIRegisterClusterWithResponse), ctx, body) } +// ExternalClusterAPIUpdateClusterTagsWithBodyWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) ExternalClusterAPIUpdateClusterTagsWithBodyWithResponse(ctx context.Context, clusterId, contentType string, body io.Reader) (*sdk.ExternalClusterAPIUpdateClusterTagsResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ExternalClusterAPIUpdateClusterTagsWithBodyWithResponse", ctx, clusterId, contentType, body) + ret0, _ := ret[0].(*sdk.ExternalClusterAPIUpdateClusterTagsResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ExternalClusterAPIUpdateClusterTagsWithBodyWithResponse indicates an expected call of ExternalClusterAPIUpdateClusterTagsWithBodyWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) ExternalClusterAPIUpdateClusterTagsWithBodyWithResponse(ctx, clusterId, contentType, body interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExternalClusterAPIUpdateClusterTagsWithBodyWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).ExternalClusterAPIUpdateClusterTagsWithBodyWithResponse), ctx, clusterId, contentType, body) +} + +// ExternalClusterAPIUpdateClusterTagsWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) ExternalClusterAPIUpdateClusterTagsWithResponse(ctx context.Context, clusterId string, body sdk.ExternalClusterAPIUpdateClusterTagsJSONRequestBody) (*sdk.ExternalClusterAPIUpdateClusterTagsResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ExternalClusterAPIUpdateClusterTagsWithResponse", ctx, clusterId, body) + ret0, _ := ret[0].(*sdk.ExternalClusterAPIUpdateClusterTagsResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ExternalClusterAPIUpdateClusterTagsWithResponse indicates an expected call of ExternalClusterAPIUpdateClusterTagsWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) ExternalClusterAPIUpdateClusterTagsWithResponse(ctx, clusterId, body interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExternalClusterAPIUpdateClusterTagsWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).ExternalClusterAPIUpdateClusterTagsWithResponse), ctx, clusterId, body) +} + // ExternalClusterAPIUpdateClusterWithBodyWithResponse mocks base method. func (m *MockClientWithResponsesInterface) ExternalClusterAPIUpdateClusterWithBodyWithResponse(ctx context.Context, clusterId, contentType string, body io.Reader) (*sdk.ExternalClusterAPIUpdateClusterResponse, error) { m.ctrl.T.Helper() diff --git a/examples/aks/aks_cluster_arm_template/castai.tf b/examples/aks/aks_cluster_arm_template/castai.tf index 4aff6a45..52731d2e 100644 --- a/examples/aks/aks_cluster_arm_template/castai.tf +++ b/examples/aks/aks_cluster_arm_template/castai.tf @@ -58,6 +58,7 @@ module "castai-aks-cluster" { name = "default-by-castai" configuration_id = module.castai-aks-cluster.castai_node_configurations["default"] is_default = true + is_enabled = true should_taint = false constraints = { @@ -71,6 +72,7 @@ module "castai-aks-cluster" { } spot_tmpl = { configuration_id = module.castai-aks-cluster.castai_node_configurations["default"] + is_enabled = true should_taint = true custom_labels = { diff --git a/examples/aks/aks_cluster_autoscaler_policies/castai.tf b/examples/aks/aks_cluster_autoscaler_policies/castai.tf index 0d3e3a49..73fd1f39 100644 --- a/examples/aks/aks_cluster_autoscaler_policies/castai.tf +++ b/examples/aks/aks_cluster_autoscaler_policies/castai.tf @@ -58,6 +58,7 @@ module "castai-aks-cluster" { name = "default-by-castai" configuration_id = module.castai-aks-cluster.castai_node_configurations["default"] is_default = true + is_enabled = true should_taint = false constraints = { @@ -71,6 +72,7 @@ module "castai-aks-cluster" { } spot_tmpl = { configuration_id = module.castai-aks-cluster.castai_node_configurations["default"] + is_enabled = true should_taint = true custom_labels = { diff --git a/examples/aks/aks_cluster_existing/castai.tf b/examples/aks/aks_cluster_existing/castai.tf index 5f9fa0ed..cab0e40d 100644 --- a/examples/aks/aks_cluster_existing/castai.tf +++ b/examples/aks/aks_cluster_existing/castai.tf @@ -55,6 +55,7 @@ module "castai-aks-cluster" { name = "default-by-castai" configuration_id = module.castai-aks-cluster.castai_node_configurations["default"] is_default = true + is_enabled = true should_taint = false constraints = { diff --git a/examples/eks/eks_cluster_autoscaler_policies/castai.tf b/examples/eks/eks_cluster_autoscaler_policies/castai.tf index 2a7dbddd..8fca4f88 100644 --- a/examples/eks/eks_cluster_autoscaler_policies/castai.tf +++ b/examples/eks/eks_cluster_autoscaler_policies/castai.tf @@ -106,6 +106,7 @@ module "castai-eks-cluster" { name = "default-by-castai" configuration_id = module.castai-eks-cluster.castai_node_configurations["default"] is_default = true + is_enabled = true should_taint = false constraints = { @@ -122,6 +123,7 @@ module "castai-eks-cluster" { } spot_tmpl = { configuration_id = module.castai-eks-cluster.castai_node_configurations["default"] + is_enabled = true should_taint = true custom_labels = { diff --git a/examples/eks/eks_cluster_existing/castai.tf b/examples/eks/eks_cluster_existing/castai.tf index a69ab186..6909091b 100644 --- a/examples/eks/eks_cluster_existing/castai.tf +++ b/examples/eks/eks_cluster_existing/castai.tf @@ -84,6 +84,7 @@ module "castai-eks-cluster" { name = "default-by-castai" configuration_id = module.castai-eks-cluster.castai_node_configurations["default"] is_default = true + is_enabled = true should_taint = false constraints = { diff --git a/examples/eks/eks_cluster_webshop/main.tf b/examples/eks/eks_cluster_webshop/main.tf index d40983ba..144a7802 100644 --- a/examples/eks/eks_cluster_webshop/main.tf +++ b/examples/eks/eks_cluster_webshop/main.tf @@ -92,6 +92,7 @@ module "castai-eks-cluster" { name = "default-by-castai" configuration_id = module.castai-eks-cluster.castai_node_configurations["default"] is_default = true + is_enabled = true should_taint = false constraints = { diff --git a/examples/eks/eks_clusters/module/castai/castai.tf b/examples/eks/eks_clusters/module/castai/castai.tf index 141cf9fd..ff20084d 100644 --- a/examples/eks/eks_clusters/module/castai/castai.tf +++ b/examples/eks/eks_clusters/module/castai/castai.tf @@ -17,6 +17,7 @@ locals { "default" ] is_default = true + is_enabled = true should_taint = false constraints = { @@ -54,6 +55,7 @@ locals { node_templates = merge(local.default_node_tmpl, var.only_default == true ? {} : { spot_tmpl = { configuration_id = module.castai-eks-cluster.castai_node_configurations["default"] + is_enabled = true should_taint = true custom_labels = { diff --git a/examples/gke/gke_cluster_autoscaler_policies/castai.tf b/examples/gke/gke_cluster_autoscaler_policies/castai.tf index 319a1d30..c6b648c9 100644 --- a/examples/gke/gke_cluster_autoscaler_policies/castai.tf +++ b/examples/gke/gke_cluster_autoscaler_policies/castai.tf @@ -65,6 +65,7 @@ module "castai-gke-cluster" { name = "default-by-castai" configuration_id = module.castai-gke-cluster.castai_node_configurations["default"] is_default = true + is_enabled = true should_taint = false constraints = { @@ -78,6 +79,7 @@ module "castai-gke-cluster" { } spot_tmpl = { configuration_id = module.castai-gke-cluster.castai_node_configurations["default"] + is_enabled = true should_taint = true custom_labels = { diff --git a/examples/gke/gke_cluster_existing/castai.tf b/examples/gke/gke_cluster_existing/castai.tf index e42a324b..c50c760a 100644 --- a/examples/gke/gke_cluster_existing/castai.tf +++ b/examples/gke/gke_cluster_existing/castai.tf @@ -71,6 +71,7 @@ module "castai-gke-cluster" { name = "default-by-castai" configuration_id = module.castai-gke-cluster.castai_node_configurations["default"] is_default = true + is_enabled = true should_taint = false constraints = { @@ -84,6 +85,7 @@ module "castai-gke-cluster" { } spot_tmpl = { configuration_id = module.castai-gke-cluster.castai_node_configurations["default"] + is_enabled = true should_taint = true custom_labels = { diff --git a/examples/gke/gke_cluster_zonal_autoscaler/castai.tf b/examples/gke/gke_cluster_zonal_autoscaler/castai.tf index d998603d..8e3c6fbb 100644 --- a/examples/gke/gke_cluster_zonal_autoscaler/castai.tf +++ b/examples/gke/gke_cluster_zonal_autoscaler/castai.tf @@ -61,6 +61,7 @@ module "castai-gke-cluster" { name = "default-by-castai" configuration_id = module.castai-gke-cluster.castai_node_configurations["default"] is_default = true + is_enabled = true should_taint = false constraints = {