diff --git a/go.mod b/go.mod index 9013182838..8b34797753 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/mitchellh/copystructure v1.0.0 // indirect github.com/mitchellh/reflectwalk v1.0.1 // indirect github.com/onsi/gomega v1.10.2 - github.com/openshift/api v0.0.0-20210402143208-92e9dab578e8 + github.com/openshift/api v0.0.0-20210409143810-a99ffa1cac67 github.com/openshift/build-machinery-go v0.0.0-20210209125900-0da259a2c359 github.com/openshift/client-go v0.0.0-20201214125552-e615e336eb49 github.com/openshift/library-go v0.0.0-20201130154959-bd449d1e2e25 diff --git a/go.sum b/go.sum index 587871f217..6c3828b430 100644 --- a/go.sum +++ b/go.sum @@ -436,8 +436,8 @@ github.com/openshift/api v0.0.0-20200827090112-c05698d102cf/go.mod h1:M3xexPhgM8 github.com/openshift/api v0.0.0-20200901182017-7ac89ba6b971/go.mod h1:M3xexPhgM8DISzzRpuFUy+jfPjQPIcs9yqEYj17mXV8= github.com/openshift/api v0.0.0-20201019163320-c6a5ec25f267/go.mod h1:RDvBcRQMGLa3aNuDuejVBbTEQj/2i14NXdpOLqbNBvM= github.com/openshift/api v0.0.0-20201214114959-164a2fb63b5f/go.mod h1:aqU5Cq+kqKKPbDMqxo9FojgDeSpNJI7iuskjXjtojDg= -github.com/openshift/api v0.0.0-20210402143208-92e9dab578e8 h1:lcyFMv56/IVXd1GEJ7Fvqt4El9ndTOW/QHM5R925Fmc= -github.com/openshift/api v0.0.0-20210402143208-92e9dab578e8/go.mod h1:dZ4kytOo3svxJHNYd0J55hwe/6IQG5gAUHUE0F3Jkio= +github.com/openshift/api v0.0.0-20210409143810-a99ffa1cac67 h1:NK+Z47dkqop4eKdymf7voxSrTL2ociCzP5yvRU7CSbE= +github.com/openshift/api v0.0.0-20210409143810-a99ffa1cac67/go.mod h1:dZ4kytOo3svxJHNYd0J55hwe/6IQG5gAUHUE0F3Jkio= github.com/openshift/build-machinery-go v0.0.0-20200211121458-5e3d6e570160/go.mod h1:1CkcsT3aVebzRBzVTSbiKSkJMsC/CASqxesfqEMfJEc= github.com/openshift/build-machinery-go v0.0.0-20200424080330-082bf86082cc/go.mod h1:1CkcsT3aVebzRBzVTSbiKSkJMsC/CASqxesfqEMfJEc= github.com/openshift/build-machinery-go v0.0.0-20200819073603-48aa266c95f7/go.mod h1:b1BuldmJlbA/xYtdZvKi+7j5YGB44qJUJDZ9zwiNCfE= diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/l7policies/doc.go b/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/l7policies/doc.go deleted file mode 100644 index 813579905c..0000000000 --- a/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/l7policies/doc.go +++ /dev/null @@ -1,123 +0,0 @@ -/* -Package l7policies provides information and interaction with L7Policies and -Rules of the LBaaS v2 extension for the OpenStack Networking service. - -Example to Create a L7Policy - - createOpts := l7policies.CreateOpts{ - Name: "redirect-example.com", - ListenerID: "023f2e34-7806-443b-bfae-16c324569a3d", - Action: l7policies.ActionRedirectToURL, - RedirectURL: "http://www.example.com", - } - l7policy, err := l7policies.Create(lbClient, createOpts).Extract() - if err != nil { - panic(err) - } - -Example to List L7Policies - - listOpts := l7policies.ListOpts{ - ListenerID: "c79a4468-d788-410c-bf79-9a8ef6354852", - } - allPages, err := l7policies.List(lbClient, listOpts).AllPages() - if err != nil { - panic(err) - } - allL7Policies, err := l7policies.ExtractL7Policies(allPages) - if err != nil { - panic(err) - } - for _, l7policy := range allL7Policies { - fmt.Printf("%+v\n", l7policy) - } - -Example to Get a L7Policy - - l7policy, err := l7policies.Get(lbClient, "023f2e34-7806-443b-bfae-16c324569a3d").Extract() - if err != nil { - panic(err) - } - -Example to Delete a L7Policy - - l7policyID := "d67d56a6-4a86-4688-a282-f46444705c64" - err := l7policies.Delete(lbClient, l7policyID).ExtractErr() - if err != nil { - panic(err) - } - -Example to Update a L7Policy - - l7policyID := "d67d56a6-4a86-4688-a282-f46444705c64" - name := "new-name" - updateOpts := l7policies.UpdateOpts{ - Name: &name, - } - l7policy, err := l7policies.Update(lbClient, l7policyID, updateOpts).Extract() - if err != nil { - panic(err) - } - -Example to Create a Rule - - l7policyID := "d67d56a6-4a86-4688-a282-f46444705c64" - createOpts := l7policies.CreateRuleOpts{ - RuleType: l7policies.TypePath, - CompareType: l7policies.CompareTypeRegex, - Value: "/images*", - } - rule, err := l7policies.CreateRule(lbClient, l7policyID, createOpts).Extract() - if err != nil { - panic(err) - } - -Example to List L7 Rules - - l7policyID := "d67d56a6-4a86-4688-a282-f46444705c64" - listOpts := l7policies.ListRulesOpts{ - RuleType: l7policies.TypePath, - } - allPages, err := l7policies.ListRules(lbClient, l7policyID, listOpts).AllPages() - if err != nil { - panic(err) - } - allRules, err := l7policies.ExtractRules(allPages) - if err != nil { - panic(err) - } - for _, rule := allRules { - fmt.Printf("%+v\n", rule) - } - -Example to Get a l7 rule - - l7rule, err := l7policies.GetRule(lbClient, "023f2e34-7806-443b-bfae-16c324569a3d", "53ad8ab8-40fa-11e8-a508-00224d6b7bc1").Extract() - if err != nil { - panic(err) - } - -Example to Delete a l7 rule - - l7policyID := "d67d56a6-4a86-4688-a282-f46444705c64" - ruleID := "64dba99f-8af8-4200-8882-e32a0660f23e" - err := l7policies.DeleteRule(lbClient, l7policyID, ruleID).ExtractErr() - if err != nil { - panic(err) - } - -Example to Update a Rule - - l7policyID := "d67d56a6-4a86-4688-a282-f46444705c64" - ruleID := "64dba99f-8af8-4200-8882-e32a0660f23e" - updateOpts := l7policies.UpdateRuleOpts{ - RuleType: l7policies.TypePath, - CompareType: l7policies.CompareTypeRegex, - Value: "/images/special*", - } - rule, err := l7policies.UpdateRule(lbClient, l7policyID, ruleID, updateOpts).Extract() - if err != nil { - panic(err) - } -*/ -package l7policies diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/l7policies/requests.go b/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/l7policies/requests.go deleted file mode 100644 index 19f487450f..0000000000 --- a/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/l7policies/requests.go +++ /dev/null @@ -1,384 +0,0 @@ -package l7policies - -import ( - "github.com/gophercloud/gophercloud" - "github.com/gophercloud/gophercloud/pagination" -) - -// CreateOptsBuilder allows extensions to add additional parameters to the -// Create request. -type CreateOptsBuilder interface { - ToL7PolicyCreateMap() (map[string]interface{}, error) -} - -type Action string -type RuleType string -type CompareType string - -const ( - ActionRedirectToPool Action = "REDIRECT_TO_POOL" - ActionRedirectToURL Action = "REDIRECT_TO_URL" - ActionReject Action = "REJECT" - - TypeCookie RuleType = "COOKIE" - TypeFileType RuleType = "FILE_TYPE" - TypeHeader RuleType = "HEADER" - TypeHostName RuleType = "HOST_NAME" - TypePath RuleType = "PATH" - - CompareTypeContains CompareType = "CONTAINS" - CompareTypeEndWith CompareType = "ENDS_WITH" - CompareTypeEqual CompareType = "EQUAL_TO" - CompareTypeRegex CompareType = "REGEX" - CompareTypeStartWith CompareType = "STARTS_WITH" -) - -// CreateOpts is the common options struct used in this package's Create -// operation. -type CreateOpts struct { - // Name of the L7 policy. - Name string `json:"name,omitempty"` - - // The ID of the listener. - ListenerID string `json:"listener_id" required:"true"` - - // The L7 policy action. One of REDIRECT_TO_POOL, REDIRECT_TO_URL, or REJECT. - Action Action `json:"action" required:"true"` - - // The position of this policy on the listener. - Position int32 `json:"position,omitempty"` - - // A human-readable description for the resource. - Description string `json:"description,omitempty"` - - // ProjectID is the UUID of the project who owns the L7 policy in octavia. - // Only administrative users can specify a project UUID other than their own. - ProjectID string `json:"project_id,omitempty"` - - // Requests matching this policy will be redirected to the pool with this ID. - // Only valid if action is REDIRECT_TO_POOL. - RedirectPoolID string `json:"redirect_pool_id,omitempty"` - - // Requests matching this policy will be redirected to this URL. - // Only valid if action is REDIRECT_TO_URL. - RedirectURL string `json:"redirect_url,omitempty"` - - // The administrative state of the Loadbalancer. A valid value is true (UP) - // or false (DOWN). - AdminStateUp *bool `json:"admin_state_up,omitempty"` -} - -// ToL7PolicyCreateMap builds a request body from CreateOpts. -func (opts CreateOpts) ToL7PolicyCreateMap() (map[string]interface{}, error) { - return gophercloud.BuildRequestBody(opts, "l7policy") -} - -// Create accepts a CreateOpts struct and uses the values to create a new l7policy. -func Create(c *gophercloud.ServiceClient, opts CreateOptsBuilder) (r CreateResult) { - b, err := opts.ToL7PolicyCreateMap() - if err != nil { - r.Err = err - return - } - resp, err := c.Post(rootURL(c), b, &r.Body, nil) - _, r.Header, r.Err = gophercloud.ParseResponse(resp, err) - return -} - -// ListOptsBuilder allows extensions to add additional parameters to the -// List request. -type ListOptsBuilder interface { - ToL7PolicyListQuery() (string, error) -} - -// ListOpts allows the filtering and sorting of paginated collections through -// the API. -type ListOpts struct { - Name string `q:"name"` - Description string `q:"description"` - ListenerID string `q:"listener_id"` - Action string `q:"action"` - ProjectID string `q:"project_id"` - RedirectPoolID string `q:"redirect_pool_id"` - RedirectURL string `q:"redirect_url"` - Position int32 `q:"position"` - AdminStateUp bool `q:"admin_state_up"` - ID string `q:"id"` - Limit int `q:"limit"` - Marker string `q:"marker"` - SortKey string `q:"sort_key"` - SortDir string `q:"sort_dir"` -} - -// ToL7PolicyListQuery formats a ListOpts into a query string. -func (opts ListOpts) ToL7PolicyListQuery() (string, error) { - q, err := gophercloud.BuildQueryString(opts) - return q.String(), err -} - -// List returns a Pager which allows you to iterate over a collection of -// l7policies. It accepts a ListOpts struct, which allows you to filter and sort -// the returned collection for greater efficiency. -// -// Default policy settings return only those l7policies that are owned by the -// project who submits the request, unless an admin user submits the request. -func List(c *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager { - url := rootURL(c) - if opts != nil { - query, err := opts.ToL7PolicyListQuery() - if err != nil { - return pagination.Pager{Err: err} - } - url += query - } - return pagination.NewPager(c, url, func(r pagination.PageResult) pagination.Page { - return L7PolicyPage{pagination.LinkedPageBase{PageResult: r}} - }) -} - -// Get retrieves a particular l7policy based on its unique ID. -func Get(c *gophercloud.ServiceClient, id string) (r GetResult) { - resp, err := c.Get(resourceURL(c, id), &r.Body, nil) - _, r.Header, r.Err = gophercloud.ParseResponse(resp, err) - return -} - -// Delete will permanently delete a particular l7policy based on its unique ID. -func Delete(c *gophercloud.ServiceClient, id string) (r DeleteResult) { - resp, err := c.Delete(resourceURL(c, id), nil) - _, r.Header, r.Err = gophercloud.ParseResponse(resp, err) - return -} - -// UpdateOptsBuilder allows extensions to add additional parameters to the -// Update request. -type UpdateOptsBuilder interface { - ToL7PolicyUpdateMap() (map[string]interface{}, error) -} - -// UpdateOpts is the common options struct used in this package's Update -// operation. -type UpdateOpts struct { - // Name of the L7 policy, empty string is allowed. - Name *string `json:"name,omitempty"` - - // The L7 policy action. One of REDIRECT_TO_POOL, REDIRECT_TO_URL, or REJECT. - Action Action `json:"action,omitempty"` - - // The position of this policy on the listener. - Position int32 `json:"position,omitempty"` - - // A human-readable description for the resource, empty string is allowed. - Description *string `json:"description,omitempty"` - - // Requests matching this policy will be redirected to the pool with this ID. - // Only valid if action is REDIRECT_TO_POOL. - RedirectPoolID *string `json:"redirect_pool_id,omitempty"` - - // Requests matching this policy will be redirected to this URL. - // Only valid if action is REDIRECT_TO_URL. - RedirectURL *string `json:"redirect_url,omitempty"` - - // The administrative state of the Loadbalancer. A valid value is true (UP) - // or false (DOWN). - AdminStateUp *bool `json:"admin_state_up,omitempty"` -} - -// ToL7PolicyUpdateMap builds a request body from UpdateOpts. -func (opts UpdateOpts) ToL7PolicyUpdateMap() (map[string]interface{}, error) { - b, err := gophercloud.BuildRequestBody(opts, "l7policy") - if err != nil { - return nil, err - } - - m := b["l7policy"].(map[string]interface{}) - - if m["redirect_pool_id"] == "" { - m["redirect_pool_id"] = nil - } - - if m["redirect_url"] == "" { - m["redirect_url"] = nil - } - - return b, nil -} - -// Update allows l7policy to be updated. -func Update(c *gophercloud.ServiceClient, id string, opts UpdateOptsBuilder) (r UpdateResult) { - b, err := opts.ToL7PolicyUpdateMap() - if err != nil { - r.Err = err - return - } - resp, err := c.Put(resourceURL(c, id), b, &r.Body, &gophercloud.RequestOpts{ - OkCodes: []int{200}, - }) - _, r.Header, r.Err = gophercloud.ParseResponse(resp, err) - return -} - -// CreateRuleOpts is the common options struct used in this package's CreateRule -// operation. -type CreateRuleOpts struct { - // The L7 rule type. One of COOKIE, FILE_TYPE, HEADER, HOST_NAME, or PATH. - RuleType RuleType `json:"type" required:"true"` - - // The comparison type for the L7 rule. One of CONTAINS, ENDS_WITH, EQUAL_TO, REGEX, or STARTS_WITH. - CompareType CompareType `json:"compare_type" required:"true"` - - // The value to use for the comparison. For example, the file type to compare. - Value string `json:"value" required:"true"` - - // ProjectID is the UUID of the project who owns the rule in octavia. - // Only administrative users can specify a project UUID other than their own. - ProjectID string `json:"project_id,omitempty"` - - // The key to use for the comparison. For example, the name of the cookie to evaluate. - Key string `json:"key,omitempty"` - - // When true the logic of the rule is inverted. For example, with invert true, - // equal to would become not equal to. Default is false. - Invert bool `json:"invert,omitempty"` - - // The administrative state of the Loadbalancer. A valid value is true (UP) - // or false (DOWN). - AdminStateUp *bool `json:"admin_state_up,omitempty"` -} - -// ToRuleCreateMap builds a request body from CreateRuleOpts. -func (opts CreateRuleOpts) ToRuleCreateMap() (map[string]interface{}, error) { - return gophercloud.BuildRequestBody(opts, "rule") -} - -// CreateRule will create and associate a Rule with a particular L7Policy. -func CreateRule(c *gophercloud.ServiceClient, policyID string, opts CreateRuleOpts) (r CreateRuleResult) { - b, err := opts.ToRuleCreateMap() - if err != nil { - r.Err = err - return - } - resp, err := c.Post(ruleRootURL(c, policyID), b, &r.Body, nil) - _, r.Header, r.Err = gophercloud.ParseResponse(resp, err) - return -} - -// ListRulesOptsBuilder allows extensions to add additional parameters to the -// ListRules request. -type ListRulesOptsBuilder interface { - ToRulesListQuery() (string, error) -} - -// ListRulesOpts allows the filtering and sorting of paginated collections -// through the API. -type ListRulesOpts struct { - RuleType RuleType `q:"type"` - ProjectID string `q:"project_id"` - CompareType CompareType `q:"compare_type"` - Value string `q:"value"` - Key string `q:"key"` - Invert bool `q:"invert"` - AdminStateUp bool `q:"admin_state_up"` - ID string `q:"id"` - Limit int `q:"limit"` - Marker string `q:"marker"` - SortKey string `q:"sort_key"` - SortDir string `q:"sort_dir"` -} - -// ToRulesListQuery formats a ListOpts into a query string. -func (opts ListRulesOpts) ToRulesListQuery() (string, error) { - q, err := gophercloud.BuildQueryString(opts) - return q.String(), err -} - -// ListRules returns a Pager which allows you to iterate over a collection of -// rules. It accepts a ListRulesOptsBuilder, which allows you to filter and -// sort the returned collection for greater efficiency. -// -// Default policy settings return only those rules that are owned by the -// project who submits the request, unless an admin user submits the request. -func ListRules(c *gophercloud.ServiceClient, policyID string, opts ListRulesOptsBuilder) pagination.Pager { - url := ruleRootURL(c, policyID) - if opts != nil { - query, err := opts.ToRulesListQuery() - if err != nil { - return pagination.Pager{Err: err} - } - url += query - } - return pagination.NewPager(c, url, func(r pagination.PageResult) pagination.Page { - return RulePage{pagination.LinkedPageBase{PageResult: r}} - }) -} - -// GetRule retrieves a particular L7Policy Rule based on its unique ID. -func GetRule(c *gophercloud.ServiceClient, policyID string, ruleID string) (r GetRuleResult) { - resp, err := c.Get(ruleResourceURL(c, policyID, ruleID), &r.Body, nil) - _, r.Header, r.Err = gophercloud.ParseResponse(resp, err) - return -} - -// DeleteRule will remove a Rule from a particular L7Policy. -func DeleteRule(c *gophercloud.ServiceClient, policyID string, ruleID string) (r DeleteRuleResult) { - resp, err := c.Delete(ruleResourceURL(c, policyID, ruleID), nil) - _, r.Header, r.Err = gophercloud.ParseResponse(resp, err) - return -} - -// UpdateRuleOptsBuilder allows to add additional parameters to the PUT request. -type UpdateRuleOptsBuilder interface { - ToRuleUpdateMap() (map[string]interface{}, error) -} - -// UpdateRuleOpts is the common options struct used in this package's Update -// operation. -type UpdateRuleOpts struct { - // The L7 rule type. One of COOKIE, FILE_TYPE, HEADER, HOST_NAME, or PATH. - RuleType RuleType `json:"type,omitempty"` - - // The comparison type for the L7 rule. One of CONTAINS, ENDS_WITH, EQUAL_TO, REGEX, or STARTS_WITH. - CompareType CompareType `json:"compare_type,omitempty"` - - // The value to use for the comparison. For example, the file type to compare. - Value string `json:"value,omitempty"` - - // The key to use for the comparison. For example, the name of the cookie to evaluate. - Key *string `json:"key,omitempty"` - - // When true the logic of the rule is inverted. For example, with invert true, - // equal to would become not equal to. Default is false. - Invert *bool `json:"invert,omitempty"` - - // The administrative state of the Loadbalancer. A valid value is true (UP) - // or false (DOWN). - AdminStateUp *bool `json:"admin_state_up,omitempty"` -} - -// ToRuleUpdateMap builds a request body from UpdateRuleOpts. -func (opts UpdateRuleOpts) ToRuleUpdateMap() (map[string]interface{}, error) { - b, err := gophercloud.BuildRequestBody(opts, "rule") - if err != nil { - return nil, err - } - - if m := b["rule"].(map[string]interface{}); m["key"] == "" { - m["key"] = nil - } - - return b, nil -} - -// UpdateRule allows Rule to be updated. -func UpdateRule(c *gophercloud.ServiceClient, policyID string, ruleID string, opts UpdateRuleOptsBuilder) (r UpdateRuleResult) { - b, err := opts.ToRuleUpdateMap() - if err != nil { - r.Err = err - return - } - resp, err := c.Put(ruleResourceURL(c, policyID, ruleID), b, &r.Body, &gophercloud.RequestOpts{ - OkCodes: []int{200, 201, 202}, - }) - _, r.Header, r.Err = gophercloud.ParseResponse(resp, err) - return -} diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/l7policies/results.go b/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/l7policies/results.go deleted file mode 100644 index dafcceed14..0000000000 --- a/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/l7policies/results.go +++ /dev/null @@ -1,237 +0,0 @@ -package l7policies - -import ( - "github.com/gophercloud/gophercloud" - "github.com/gophercloud/gophercloud/pagination" -) - -// L7Policy is a collection of L7 rules associated with a Listener, and which -// may also have an association to a back-end pool. -type L7Policy struct { - // The unique ID for the L7 policy. - ID string `json:"id"` - - // Name of the L7 policy. - Name string `json:"name"` - - // The ID of the listener. - ListenerID string `json:"listener_id"` - - // The L7 policy action. One of REDIRECT_TO_POOL, REDIRECT_TO_URL, or REJECT. - Action string `json:"action"` - - // The position of this policy on the listener. - Position int32 `json:"position"` - - // A human-readable description for the resource. - Description string `json:"description"` - - // ProjectID is the UUID of the project who owns the L7 policy in octavia. - // Only administrative users can specify a project UUID other than their own. - ProjectID string `json:"project_id"` - - // Requests matching this policy will be redirected to the pool with this ID. - // Only valid if action is REDIRECT_TO_POOL. - RedirectPoolID string `json:"redirect_pool_id"` - - // Requests matching this policy will be redirected to this URL. - // Only valid if action is REDIRECT_TO_URL. - RedirectURL string `json:"redirect_url"` - - // The administrative state of the L7 policy, which is up (true) or down (false). - AdminStateUp bool `json:"admin_state_up"` - - // The provisioning status of the L7 policy. - // This value is ACTIVE, PENDING_* or ERROR. - ProvisioningStatus string `json:"provisioning_status"` - - // The operating status of the L7 policy. - OperatingStatus string `json:"operating_status"` - - // Rules are List of associated L7 rule IDs. - Rules []Rule `json:"rules"` -} - -// Rule represents layer 7 load balancing rule. -type Rule struct { - // The unique ID for the L7 rule. - ID string `json:"id"` - - // The L7 rule type. One of COOKIE, FILE_TYPE, HEADER, HOST_NAME, or PATH. - RuleType string `json:"type"` - - // The comparison type for the L7 rule. One of CONTAINS, ENDS_WITH, EQUAL_TO, REGEX, or STARTS_WITH. - CompareType string `json:"compare_type"` - - // The value to use for the comparison. For example, the file type to compare. - Value string `json:"value"` - - // ProjectID is the UUID of the project who owns the rule in octavia. - // Only administrative users can specify a project UUID other than their own. - ProjectID string `json:"project_id"` - - // The key to use for the comparison. For example, the name of the cookie to evaluate. - Key string `json:"key"` - - // When true the logic of the rule is inverted. For example, with invert true, - // equal to would become not equal to. Default is false. - Invert bool `json:"invert"` - - // The administrative state of the L7 rule, which is up (true) or down (false). - AdminStateUp bool `json:"admin_state_up"` - - // The provisioning status of the L7 rule. - // This value is ACTIVE, PENDING_* or ERROR. - ProvisioningStatus string `json:"provisioning_status"` - - // The operating status of the L7 policy. - OperatingStatus string `json:"operating_status"` -} - -type commonResult struct { - gophercloud.Result -} - -// Extract is a function that accepts a result and extracts a l7policy. -func (r commonResult) Extract() (*L7Policy, error) { - var s struct { - L7Policy *L7Policy `json:"l7policy"` - } - err := r.ExtractInto(&s) - return s.L7Policy, err -} - -// CreateResult represents the result of a Create operation. Call its Extract -// method to interpret the result as a L7Policy. -type CreateResult struct { - commonResult -} - -// L7PolicyPage is the page returned by a pager when traversing over a -// collection of l7policies. -type L7PolicyPage struct { - pagination.LinkedPageBase -} - -// NextPageURL is invoked when a paginated collection of l7policies has reached -// the end of a page and the pager seeks to traverse over a new one. In order -// to do this, it needs to construct the next page's URL. -func (r L7PolicyPage) NextPageURL() (string, error) { - var s struct { - Links []gophercloud.Link `json:"l7policies_links"` - } - err := r.ExtractInto(&s) - if err != nil { - return "", err - } - return gophercloud.ExtractNextURL(s.Links) -} - -// IsEmpty checks whether a L7PolicyPage struct is empty. -func (r L7PolicyPage) IsEmpty() (bool, error) { - is, err := ExtractL7Policies(r) - return len(is) == 0, err -} - -// ExtractL7Policies accepts a Page struct, specifically a L7PolicyPage struct, -// and extracts the elements into a slice of L7Policy structs. In other words, -// a generic collection is mapped into a relevant slice. -func ExtractL7Policies(r pagination.Page) ([]L7Policy, error) { - var s struct { - L7Policies []L7Policy `json:"l7policies"` - } - err := (r.(L7PolicyPage)).ExtractInto(&s) - return s.L7Policies, err -} - -// GetResult represents the result of a Get operation. Call its Extract -// method to interpret the result as a L7Policy. -type GetResult struct { - commonResult -} - -// DeleteResult represents the result of a Delete operation. Call its -// ExtractErr method to determine if the request succeeded or failed. -type DeleteResult struct { - gophercloud.ErrResult -} - -// UpdateResult represents the result of an Update operation. Call its Extract -// method to interpret the result as a L7Policy. -type UpdateResult struct { - commonResult -} - -type commonRuleResult struct { - gophercloud.Result -} - -// Extract is a function that accepts a result and extracts a rule. -func (r commonRuleResult) Extract() (*Rule, error) { - var s struct { - Rule *Rule `json:"rule"` - } - err := r.ExtractInto(&s) - return s.Rule, err -} - -// CreateRuleResult represents the result of a CreateRule operation. -// Call its Extract method to interpret it as a Rule. -type CreateRuleResult struct { - commonRuleResult -} - -// RulePage is the page returned by a pager when traversing over a -// collection of Rules in a L7Policy. -type RulePage struct { - pagination.LinkedPageBase -} - -// NextPageURL is invoked when a paginated collection of rules has reached -// the end of a page and the pager seeks to traverse over a new one. In order -// to do this, it needs to construct the next page's URL. -func (r RulePage) NextPageURL() (string, error) { - var s struct { - Links []gophercloud.Link `json:"rules_links"` - } - err := r.ExtractInto(&s) - if err != nil { - return "", err - } - return gophercloud.ExtractNextURL(s.Links) -} - -// IsEmpty checks whether a RulePage struct is empty. -func (r RulePage) IsEmpty() (bool, error) { - is, err := ExtractRules(r) - return len(is) == 0, err -} - -// ExtractRules accepts a Page struct, specifically a RulePage struct, -// and extracts the elements into a slice of Rules structs. In other words, -// a generic collection is mapped into a relevant slice. -func ExtractRules(r pagination.Page) ([]Rule, error) { - var s struct { - Rules []Rule `json:"rules"` - } - err := (r.(RulePage)).ExtractInto(&s) - return s.Rules, err -} - -// GetRuleResult represents the result of a GetRule operation. -// Call its Extract method to interpret it as a Rule. -type GetRuleResult struct { - commonRuleResult -} - -// DeleteRuleResult represents the result of a DeleteRule operation. -// Call its ExtractErr method to determine if the request succeeded or failed. -type DeleteRuleResult struct { - gophercloud.ErrResult -} - -// UpdateRuleResult represents the result of an UpdateRule operation. -// Call its Extract method to interpret it as a Rule. -type UpdateRuleResult struct { - commonRuleResult -} diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/l7policies/urls.go b/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/l7policies/urls.go deleted file mode 100644 index ecb607a8e8..0000000000 --- a/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/l7policies/urls.go +++ /dev/null @@ -1,25 +0,0 @@ -package l7policies - -import "github.com/gophercloud/gophercloud" - -const ( - rootPath = "lbaas" - resourcePath = "l7policies" - rulePath = "rules" -) - -func rootURL(c *gophercloud.ServiceClient) string { - return c.ServiceURL(rootPath, resourcePath) -} - -func resourceURL(c *gophercloud.ServiceClient, id string) string { - return c.ServiceURL(rootPath, resourcePath, id) -} - -func ruleRootURL(c *gophercloud.ServiceClient, policyID string) string { - return c.ServiceURL(rootPath, resourcePath, policyID, rulePath) -} - -func ruleResourceURL(c *gophercloud.ServiceClient, policyID string, ruleID string) string { - return c.ServiceURL(rootPath, resourcePath, policyID, rulePath, ruleID) -} diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/listeners/doc.go b/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/listeners/doc.go deleted file mode 100644 index eeea6eea82..0000000000 --- a/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/listeners/doc.go +++ /dev/null @@ -1,74 +0,0 @@ -/* -Package listeners provides information and interaction with Listeners of the -LBaaS v2 extension for the OpenStack Networking service. - -Example to List Listeners - - listOpts := listeners.ListOpts{ - LoadbalancerID : "ca430f80-1737-4712-8dc6-3f640d55594b", - } - - allPages, err := listeners.List(networkClient, listOpts).AllPages() - if err != nil { - panic(err) - } - - allListeners, err := listeners.ExtractListeners(allPages) - if err != nil { - panic(err) - } - - for _, listener := range allListeners { - fmt.Printf("%+v\n", listener) - } - -Example to Create a Listener - - createOpts := listeners.CreateOpts{ - Protocol: "TCP", - Name: "db", - LoadbalancerID: "79e05663-7f03-45d2-a092-8b94062f22ab", - AdminStateUp: gophercloud.Enabled, - DefaultPoolID: "41efe233-7591-43c5-9cf7-923964759f9e", - ProtocolPort: 3306, - } - - listener, err := listeners.Create(networkClient, createOpts).Extract() - if err != nil { - panic(err) - } - -Example to Update a Listener - - listenerID := "d67d56a6-4a86-4688-a282-f46444705c64" - - i1001 := 1001 - i181000 := 181000 - updateOpts := listeners.UpdateOpts{ - ConnLimit: &i1001, - TimeoutClientData: &i181000, - TimeoutMemberData: &i181000, - } - - listener, err := listeners.Update(networkClient, listenerID, updateOpts).Extract() - if err != nil { - panic(err) - } - -Example to Delete a Listener - - listenerID := "d67d56a6-4a86-4688-a282-f46444705c64" - err := listeners.Delete(networkClient, listenerID).ExtractErr() - if err != nil { - panic(err) - } - -Example to Get the Statistics of a Listener - - listenerID := "d67d56a6-4a86-4688-a282-f46444705c64" - stats, err := listeners.GetStats(networkClient, listenerID).Extract() - if err != nil { - panic(err) - } -*/ -package listeners diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/listeners/requests.go b/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/listeners/requests.go deleted file mode 100644 index f839fa9506..0000000000 --- a/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/listeners/requests.go +++ /dev/null @@ -1,260 +0,0 @@ -package listeners - -import ( - "github.com/gophercloud/gophercloud" - "github.com/gophercloud/gophercloud/pagination" -) - -// Type Protocol represents a listener protocol. -type Protocol string - -// Supported attributes for create/update operations. -const ( - ProtocolTCP Protocol = "TCP" - ProtocolUDP Protocol = "UDP" - ProtocolPROXY Protocol = "PROXY" - ProtocolHTTP Protocol = "HTTP" - ProtocolHTTPS Protocol = "HTTPS" - ProtocolTerminatedHTTPS Protocol = "TERMINATED_HTTPS" -) - -// ListOptsBuilder allows extensions to add additional parameters to the -// List request. -type ListOptsBuilder interface { - ToListenerListQuery() (string, error) -} - -// ListOpts allows the filtering and sorting of paginated collections through -// the API. Filtering is achieved by passing in struct field values that map to -// the floating IP attributes you want to see returned. SortKey allows you to -// sort by a particular listener attribute. SortDir sets the direction, and is -// either `asc' or `desc'. Marker and Limit are used for pagination. -type ListOpts struct { - ID string `q:"id"` - Name string `q:"name"` - AdminStateUp *bool `q:"admin_state_up"` - ProjectID string `q:"project_id"` - LoadbalancerID string `q:"loadbalancer_id"` - DefaultPoolID string `q:"default_pool_id"` - Protocol string `q:"protocol"` - ProtocolPort int `q:"protocol_port"` - ConnectionLimit int `q:"connection_limit"` - Limit int `q:"limit"` - Marker string `q:"marker"` - SortKey string `q:"sort_key"` - SortDir string `q:"sort_dir"` - TimeoutClientData *int `q:"timeout_client_data"` - TimeoutMemberData *int `q:"timeout_member_data"` - TimeoutMemberConnect *int `q:"timeout_member_connect"` - TimeoutTCPInspect *int `q:"timeout_tcp_inspect"` -} - -// ToListenerListQuery formats a ListOpts into a query string. -func (opts ListOpts) ToListenerListQuery() (string, error) { - q, err := gophercloud.BuildQueryString(opts) - return q.String(), err -} - -// List returns a Pager which allows you to iterate over a collection of -// listeners. It accepts a ListOpts struct, which allows you to filter and sort -// the returned collection for greater efficiency. -// -// Default policy settings return only those listeners that are owned by the -// project who submits the request, unless an admin user submits the request. -func List(c *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager { - url := rootURL(c) - if opts != nil { - query, err := opts.ToListenerListQuery() - if err != nil { - return pagination.Pager{Err: err} - } - url += query - } - return pagination.NewPager(c, url, func(r pagination.PageResult) pagination.Page { - return ListenerPage{pagination.LinkedPageBase{PageResult: r}} - }) -} - -// CreateOptsBuilder allows extensions to add additional parameters to the -// Create request. -type CreateOptsBuilder interface { - ToListenerCreateMap() (map[string]interface{}, error) -} - -// CreateOpts represents options for creating a listener. -type CreateOpts struct { - // The load balancer on which to provision this listener. - LoadbalancerID string `json:"loadbalancer_id" required:"true"` - - // The protocol - can either be TCP, HTTP, HTTPS or TERMINATED_HTTPS. - Protocol Protocol `json:"protocol" required:"true"` - - // The port on which to listen for client traffic. - ProtocolPort int `json:"protocol_port" required:"true"` - - // ProjectID is only required if the caller has an admin role and wants - // to create a pool for another project. - ProjectID string `json:"project_id,omitempty"` - - // Human-readable name for the Listener. Does not have to be unique. - Name string `json:"name,omitempty"` - - // The ID of the default pool with which the Listener is associated. - DefaultPoolID string `json:"default_pool_id,omitempty"` - - // Human-readable description for the Listener. - Description string `json:"description,omitempty"` - - // The maximum number of connections allowed for the Listener. - ConnLimit *int `json:"connection_limit,omitempty"` - - // A reference to a Barbican container of TLS secrets. - DefaultTlsContainerRef string `json:"default_tls_container_ref,omitempty"` - - // A list of references to TLS secrets. - SniContainerRefs []string `json:"sni_container_refs,omitempty"` - - // The administrative state of the Listener. A valid value is true (UP) - // or false (DOWN). - AdminStateUp *bool `json:"admin_state_up,omitempty"` - - // Frontend client inactivity timeout in milliseconds - TimeoutClientData *int `json:"timeout_client_data,omitempty"` - - // Backend member inactivity timeout in milliseconds - TimeoutMemberData *int `json:"timeout_member_data,omitempty"` - - // Backend member connection timeout in milliseconds - TimeoutMemberConnect *int `json:"timeout_member_connect,omitempty"` - - // Time, in milliseconds, to wait for additional TCP packets for content inspection - TimeoutTCPInspect *int `json:"timeout_tcp_inspect,omitempty"` - - // A dictionary of optional headers to insert into the request before it is sent to the backend member. - InsertHeaders map[string]string `json:"insert_headers,omitempty"` - - // A list of IPv4, IPv6 or mix of both CIDRs - AllowedCIDRs []string `json:"allowed_cidrs,omitempty"` -} - -// ToListenerCreateMap builds a request body from CreateOpts. -func (opts CreateOpts) ToListenerCreateMap() (map[string]interface{}, error) { - return gophercloud.BuildRequestBody(opts, "listener") -} - -// Create is an operation which provisions a new Listeners based on the -// configuration defined in the CreateOpts struct. Once the request is -// validated and progress has started on the provisioning process, a -// CreateResult will be returned. -// -// Users with an admin role can create Listeners on behalf of other projects by -// specifying a ProjectID attribute different than their own. -func Create(c *gophercloud.ServiceClient, opts CreateOptsBuilder) (r CreateResult) { - b, err := opts.ToListenerCreateMap() - if err != nil { - r.Err = err - return - } - resp, err := c.Post(rootURL(c), b, &r.Body, nil) - _, r.Header, r.Err = gophercloud.ParseResponse(resp, err) - return -} - -// Get retrieves a particular Listeners based on its unique ID. -func Get(c *gophercloud.ServiceClient, id string) (r GetResult) { - resp, err := c.Get(resourceURL(c, id), &r.Body, nil) - _, r.Header, r.Err = gophercloud.ParseResponse(resp, err) - return -} - -// UpdateOptsBuilder allows extensions to add additional parameters to the -// Update request. -type UpdateOptsBuilder interface { - ToListenerUpdateMap() (map[string]interface{}, error) -} - -// UpdateOpts represents options for updating a Listener. -type UpdateOpts struct { - // Human-readable name for the Listener. Does not have to be unique. - Name *string `json:"name,omitempty"` - - // The ID of the default pool with which the Listener is associated. - DefaultPoolID *string `json:"default_pool_id,omitempty"` - - // Human-readable description for the Listener. - Description *string `json:"description,omitempty"` - - // The maximum number of connections allowed for the Listener. - ConnLimit *int `json:"connection_limit,omitempty"` - - // A reference to a Barbican container of TLS secrets. - DefaultTlsContainerRef *string `json:"default_tls_container_ref,omitempty"` - - // A list of references to TLS secrets. - SniContainerRefs *[]string `json:"sni_container_refs,omitempty"` - - // The administrative state of the Listener. A valid value is true (UP) - // or false (DOWN). - AdminStateUp *bool `json:"admin_state_up,omitempty"` - - // Frontend client inactivity timeout in milliseconds - TimeoutClientData *int `json:"timeout_client_data,omitempty"` - - // Backend member inactivity timeout in milliseconds - TimeoutMemberData *int `json:"timeout_member_data,omitempty"` - - // Backend member connection timeout in milliseconds - TimeoutMemberConnect *int `json:"timeout_member_connect,omitempty"` - - // Time, in milliseconds, to wait for additional TCP packets for content inspection - TimeoutTCPInspect *int `json:"timeout_tcp_inspect,omitempty"` - - // A dictionary of optional headers to insert into the request before it is sent to the backend member. - InsertHeaders *map[string]string `json:"insert_headers,omitempty"` - - // A list of IPv4, IPv6 or mix of both CIDRs - AllowedCIDRs *[]string `json:"allowed_cidrs,omitempty"` -} - -// ToListenerUpdateMap builds a request body from UpdateOpts. -func (opts UpdateOpts) ToListenerUpdateMap() (map[string]interface{}, error) { - b, err := gophercloud.BuildRequestBody(opts, "listener") - if err != nil { - return nil, err - } - - if m := b["listener"].(map[string]interface{}); m["default_pool_id"] == "" { - m["default_pool_id"] = nil - } - - return b, nil -} - -// Update is an operation which modifies the attributes of the specified -// Listener. -func Update(c *gophercloud.ServiceClient, id string, opts UpdateOpts) (r UpdateResult) { - b, err := opts.ToListenerUpdateMap() - if err != nil { - r.Err = err - return - } - resp, err := c.Put(resourceURL(c, id), b, &r.Body, &gophercloud.RequestOpts{ - OkCodes: []int{200, 202}, - }) - _, r.Header, r.Err = gophercloud.ParseResponse(resp, err) - return -} - -// Delete will permanently delete a particular Listeners based on its unique ID. -func Delete(c *gophercloud.ServiceClient, id string) (r DeleteResult) { - resp, err := c.Delete(resourceURL(c, id), nil) - _, r.Header, r.Err = gophercloud.ParseResponse(resp, err) - return -} - -// GetStats will return the shows the current statistics of a particular Listeners. -func GetStats(c *gophercloud.ServiceClient, id string) (r StatsResult) { - resp, err := c.Get(statisticsRootURL(c, id), &r.Body, nil) - _, r.Header, r.Err = gophercloud.ParseResponse(resp, err) - return -} diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/listeners/results.go b/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/listeners/results.go deleted file mode 100644 index 7bf6734ef7..0000000000 --- a/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/listeners/results.go +++ /dev/null @@ -1,190 +0,0 @@ -package listeners - -import ( - "github.com/gophercloud/gophercloud" - "github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/l7policies" - "github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/pools" - "github.com/gophercloud/gophercloud/pagination" -) - -type LoadBalancerID struct { - ID string `json:"id"` -} - -// Listener is the primary load balancing configuration object that specifies -// the loadbalancer and port on which client traffic is received, as well -// as other details such as the load balancing method to be use, protocol, etc. -type Listener struct { - // The unique ID for the Listener. - ID string `json:"id"` - - // Owner of the Listener. - ProjectID string `json:"project_id"` - - // Human-readable name for the Listener. Does not have to be unique. - Name string `json:"name"` - - // Human-readable description for the Listener. - Description string `json:"description"` - - // The protocol to loadbalance. A valid value is TCP, HTTP, or HTTPS. - Protocol string `json:"protocol"` - - // The port on which to listen to client traffic that is associated with the - // Loadbalancer. A valid value is from 0 to 65535. - ProtocolPort int `json:"protocol_port"` - - // The UUID of default pool. Must have compatible protocol with listener. - DefaultPoolID string `json:"default_pool_id"` - - // A list of load balancer IDs. - Loadbalancers []LoadBalancerID `json:"loadbalancers"` - - // The maximum number of connections allowed for the Loadbalancer. - // Default is -1, meaning no limit. - ConnLimit int `json:"connection_limit"` - - // The list of references to TLS secrets. - SniContainerRefs []string `json:"sni_container_refs"` - - // A reference to a Barbican container of TLS secrets. - DefaultTlsContainerRef string `json:"default_tls_container_ref"` - - // The administrative state of the Listener. A valid value is true (UP) or false (DOWN). - AdminStateUp bool `json:"admin_state_up"` - - // Pools are the pools which are part of this listener. - Pools []pools.Pool `json:"pools"` - - // L7policies are the L7 policies which are part of this listener. - L7Policies []l7policies.L7Policy `json:"l7policies"` - - // The provisioning status of the Listener. - // This value is ACTIVE, PENDING_* or ERROR. - ProvisioningStatus string `json:"provisioning_status"` - - // Frontend client inactivity timeout in milliseconds - TimeoutClientData int `json:"timeout_client_data"` - - // Backend member inactivity timeout in milliseconds - TimeoutMemberData int `json:"timeout_member_data"` - - // Backend member connection timeout in milliseconds - TimeoutMemberConnect int `json:"timeout_member_connect"` - - // Time, in milliseconds, to wait for additional TCP packets for content inspection - TimeoutTCPInspect int `json:"timeout_tcp_inspect"` - - // A dictionary of optional headers to insert into the request before it is sent to the backend member. - InsertHeaders map[string]string `json:"insert_headers"` - - // A list of IPv4, IPv6 or mix of both CIDRs - AllowedCIDRs []string `json:"allowed_cidrs"` -} - -type Stats struct { - // The currently active connections. - ActiveConnections int `json:"active_connections"` - - // The total bytes received. - BytesIn int `json:"bytes_in"` - - // The total bytes sent. - BytesOut int `json:"bytes_out"` - - // The total requests that were unable to be fulfilled. - RequestErrors int `json:"request_errors"` - - // The total connections handled. - TotalConnections int `json:"total_connections"` -} - -// ListenerPage is the page returned by a pager when traversing over a -// collection of listeners. -type ListenerPage struct { - pagination.LinkedPageBase -} - -// NextPageURL is invoked when a paginated collection of listeners has reached -// the end of a page and the pager seeks to traverse over a new one. In order -// to do this, it needs to construct the next page's URL. -func (r ListenerPage) NextPageURL() (string, error) { - var s struct { - Links []gophercloud.Link `json:"listeners_links"` - } - err := r.ExtractInto(&s) - if err != nil { - return "", err - } - return gophercloud.ExtractNextURL(s.Links) -} - -// IsEmpty checks whether a ListenerPage struct is empty. -func (r ListenerPage) IsEmpty() (bool, error) { - is, err := ExtractListeners(r) - return len(is) == 0, err -} - -// ExtractListeners accepts a Page struct, specifically a ListenerPage struct, -// and extracts the elements into a slice of Listener structs. In other words, -// a generic collection is mapped into a relevant slice. -func ExtractListeners(r pagination.Page) ([]Listener, error) { - var s struct { - Listeners []Listener `json:"listeners"` - } - err := (r.(ListenerPage)).ExtractInto(&s) - return s.Listeners, err -} - -type commonResult struct { - gophercloud.Result -} - -// Extract is a function that accepts a result and extracts a listener. -func (r commonResult) Extract() (*Listener, error) { - var s struct { - Listener *Listener `json:"listener"` - } - err := r.ExtractInto(&s) - return s.Listener, err -} - -// CreateResult represents the result of a create operation. Call its Extract -// method to interpret it as a Listener. -type CreateResult struct { - commonResult -} - -// GetResult represents the result of a get operation. Call its Extract -// method to interpret it as a Listener. -type GetResult struct { - commonResult -} - -// UpdateResult represents the result of an update operation. Call its Extract -// method to interpret it as a Listener. -type UpdateResult struct { - commonResult -} - -// DeleteResult represents the result of a delete operation. Call its -// ExtractErr method to determine if the request succeeded or failed. -type DeleteResult struct { - gophercloud.ErrResult -} - -// StatsResult represents the result of a GetStats operation. -// Call its Extract method to interpret it as a Stats. -type StatsResult struct { - gophercloud.Result -} - -// Extract is a function that accepts a result and extracts the status of -// a Listener. -func (r StatsResult) Extract() (*Stats, error) { - var s struct { - Stats *Stats `json:"stats"` - } - err := r.ExtractInto(&s) - return s.Stats, err -} diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/listeners/urls.go b/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/listeners/urls.go deleted file mode 100644 index e9e3bccd3e..0000000000 --- a/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/listeners/urls.go +++ /dev/null @@ -1,21 +0,0 @@ -package listeners - -import "github.com/gophercloud/gophercloud" - -const ( - rootPath = "lbaas" - resourcePath = "listeners" - statisticsPath = "stats" -) - -func rootURL(c *gophercloud.ServiceClient) string { - return c.ServiceURL(rootPath, resourcePath) -} - -func resourceURL(c *gophercloud.ServiceClient, id string) string { - return c.ServiceURL(rootPath, resourcePath, id) -} - -func statisticsRootURL(c *gophercloud.ServiceClient, id string) string { - return c.ServiceURL(rootPath, resourcePath, id, statisticsPath) -} diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/loadbalancers/doc.go b/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/loadbalancers/doc.go deleted file mode 100644 index 5c2b42d60a..0000000000 --- a/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/loadbalancers/doc.go +++ /dev/null @@ -1,92 +0,0 @@ -/* -Package loadbalancers provides information and interaction with Load Balancers -of the LBaaS v2 extension for the OpenStack Networking service. - -Example to List Load Balancers - - listOpts := loadbalancers.ListOpts{ - Provider: "haproxy", - } - - allPages, err := loadbalancers.List(networkClient, listOpts).AllPages() - if err != nil { - panic(err) - } - - allLoadbalancers, err := loadbalancers.ExtractLoadBalancers(allPages) - if err != nil { - panic(err) - } - - for _, lb := range allLoadbalancers { - fmt.Printf("%+v\n", lb) - } - -Example to Create a Load Balancer - - createOpts := loadbalancers.CreateOpts{ - Name: "db_lb", - AdminStateUp: gophercloud.Enabled, - VipSubnetID: "9cedb85d-0759-4898-8a4b-fa5a5ea10086", - VipAddress: "10.30.176.48", - FlavorID: "60df399a-ee85-11e9-81b4-2a2ae2dbcce4", - Provider: "haproxy", - Tags: []string{"test", "stage"}, - } - - lb, err := loadbalancers.Create(networkClient, createOpts).Extract() - if err != nil { - panic(err) - } - -Example to Update a Load Balancer - - lbID := "d67d56a6-4a86-4688-a282-f46444705c64" - name := "new-name" - updateOpts := loadbalancers.UpdateOpts{ - Name: &name, - } - lb, err := loadbalancers.Update(networkClient, lbID, updateOpts).Extract() - if err != nil { - panic(err) - } - -Example to Delete a Load Balancers - - deleteOpts := loadbalancers.DeleteOpts{ - Cascade: true, - } - - lbID := "d67d56a6-4a86-4688-a282-f46444705c64" - - err := loadbalancers.Delete(networkClient, lbID, deleteOpts).ExtractErr() - if err != nil { - panic(err) - } - -Example to Get the Status of a Load Balancer - - lbID := "d67d56a6-4a86-4688-a282-f46444705c64" - status, err := loadbalancers.GetStatuses(networkClient, LBID).Extract() - if err != nil { - panic(err) - } - -Example to Get the Statistics of a Load Balancer - - lbID := "d67d56a6-4a86-4688-a282-f46444705c64" - stats, err := loadbalancers.GetStats(networkClient, LBID).Extract() - if err != nil { - panic(err) - } - -Example to Failover a Load Balancers - - lbID := "d67d56a6-4a86-4688-a282-f46444705c64" - - err := loadbalancers.Failover(networkClient, lbID).ExtractErr() - if err != nil { - panic(err) - } -*/ -package loadbalancers diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/loadbalancers/requests.go b/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/loadbalancers/requests.go deleted file mode 100644 index 63c832fb01..0000000000 --- a/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/loadbalancers/requests.go +++ /dev/null @@ -1,253 +0,0 @@ -package loadbalancers - -import ( - "github.com/gophercloud/gophercloud" - "github.com/gophercloud/gophercloud/pagination" -) - -// ListOptsBuilder allows extensions to add additional parameters to the -// List request. -type ListOptsBuilder interface { - ToLoadBalancerListQuery() (string, error) -} - -// ListOpts allows the filtering and sorting of paginated collections through -// the API. Filtering is achieved by passing in struct field values that map to -// the Loadbalancer attributes you want to see returned. SortKey allows you to -// sort by a particular attribute. SortDir sets the direction, and is -// either `asc' or `desc'. Marker and Limit are used for pagination. -type ListOpts struct { - Description string `q:"description"` - AdminStateUp *bool `q:"admin_state_up"` - ProjectID string `q:"project_id"` - ProvisioningStatus string `q:"provisioning_status"` - VipAddress string `q:"vip_address"` - VipPortID string `q:"vip_port_id"` - VipSubnetID string `q:"vip_subnet_id"` - VipNetworkID string `q:"vip_network_id"` - ID string `q:"id"` - OperatingStatus string `q:"operating_status"` - Name string `q:"name"` - FlavorID string `q:"flavor_id"` - AvailabilityZone string `q:"availability_zone"` - Provider string `q:"provider"` - Limit int `q:"limit"` - Marker string `q:"marker"` - SortKey string `q:"sort_key"` - SortDir string `q:"sort_dir"` - Tags []string `q:"tags"` - TagsAny []string `q:"tags-any"` - TagsNot []string `q:"not-tags"` - TagsNotAny []string `q:"not-tags-any"` -} - -// ToLoadBalancerListQuery formats a ListOpts into a query string. -func (opts ListOpts) ToLoadBalancerListQuery() (string, error) { - q, err := gophercloud.BuildQueryString(opts) - return q.String(), err -} - -// List returns a Pager which allows you to iterate over a collection of -// load balancers. It accepts a ListOpts struct, which allows you to filter -// and sort the returned collection for greater efficiency. -// -// Default policy settings return only those load balancers that are owned by -// the project who submits the request, unless an admin user submits the request. -func List(c *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager { - url := rootURL(c) - if opts != nil { - query, err := opts.ToLoadBalancerListQuery() - if err != nil { - return pagination.Pager{Err: err} - } - url += query - } - return pagination.NewPager(c, url, func(r pagination.PageResult) pagination.Page { - return LoadBalancerPage{pagination.LinkedPageBase{PageResult: r}} - }) -} - -// CreateOptsBuilder allows extensions to add additional parameters to the -// Create request. -type CreateOptsBuilder interface { - ToLoadBalancerCreateMap() (map[string]interface{}, error) -} - -// CreateOpts is the common options struct used in this package's Create -// operation. -type CreateOpts struct { - // Human-readable name for the Loadbalancer. Does not have to be unique. - Name string `json:"name,omitempty"` - - // Human-readable description for the Loadbalancer. - Description string `json:"description,omitempty"` - - // Providing a neutron port ID for the vip_port_id tells Octavia to use this - // port for the VIP. If the port has more than one subnet you must specify - // either the vip_subnet_id or vip_address to clarify which address should - // be used for the VIP. - VipPortID string `json:"vip_port_id,omitempty"` - - // The subnet on which to allocate the Loadbalancer's address. A project can - // only create Loadbalancers on networks authorized by policy (e.g. networks - // that belong to them or networks that are shared). - VipSubnetID string `json:"vip_subnet_id,omitempty"` - - // The network on which to allocate the Loadbalancer's address. A tenant can - // only create Loadbalancers on networks authorized by policy (e.g. networks - // that belong to them or networks that are shared). - VipNetworkID string `json:"vip_network_id,omitempty"` - - // ProjectID is the UUID of the project who owns the Loadbalancer. - // Only administrative users can specify a project UUID other than their own. - ProjectID string `json:"project_id,omitempty"` - - // The IP address of the Loadbalancer. - VipAddress string `json:"vip_address,omitempty"` - - // The administrative state of the Loadbalancer. A valid value is true (UP) - // or false (DOWN). - AdminStateUp *bool `json:"admin_state_up,omitempty"` - - // The UUID of a flavor. - FlavorID string `json:"flavor_id,omitempty"` - - // The name of an Octavia availability zone. - // Requires Octavia API version 2.14 or later. - AvailabilityZone string `json:"availability_zone,omitempty"` - - // The name of the provider. - Provider string `json:"provider,omitempty"` - - // Tags is a set of resource tags. - Tags []string `json:"tags,omitempty"` -} - -// ToLoadBalancerCreateMap builds a request body from CreateOpts. -func (opts CreateOpts) ToLoadBalancerCreateMap() (map[string]interface{}, error) { - return gophercloud.BuildRequestBody(opts, "loadbalancer") -} - -// Create is an operation which provisions a new loadbalancer based on the -// configuration defined in the CreateOpts struct. Once the request is -// validated and progress has started on the provisioning process, a -// CreateResult will be returned. -func Create(c *gophercloud.ServiceClient, opts CreateOptsBuilder) (r CreateResult) { - b, err := opts.ToLoadBalancerCreateMap() - if err != nil { - r.Err = err - return - } - resp, err := c.Post(rootURL(c), b, &r.Body, nil) - _, r.Header, r.Err = gophercloud.ParseResponse(resp, err) - return -} - -// Get retrieves a particular Loadbalancer based on its unique ID. -func Get(c *gophercloud.ServiceClient, id string) (r GetResult) { - resp, err := c.Get(resourceURL(c, id), &r.Body, nil) - _, r.Header, r.Err = gophercloud.ParseResponse(resp, err) - return -} - -// UpdateOptsBuilder allows extensions to add additional parameters to the -// Update request. -type UpdateOptsBuilder interface { - ToLoadBalancerUpdateMap() (map[string]interface{}, error) -} - -// UpdateOpts is the common options struct used in this package's Update -// operation. -type UpdateOpts struct { - // Human-readable name for the Loadbalancer. Does not have to be unique. - Name *string `json:"name,omitempty"` - - // Human-readable description for the Loadbalancer. - Description *string `json:"description,omitempty"` - - // The administrative state of the Loadbalancer. A valid value is true (UP) - // or false (DOWN). - AdminStateUp *bool `json:"admin_state_up,omitempty"` - - // Tags is a set of resource tags. - Tags *[]string `json:"tags,omitempty"` -} - -// ToLoadBalancerUpdateMap builds a request body from UpdateOpts. -func (opts UpdateOpts) ToLoadBalancerUpdateMap() (map[string]interface{}, error) { - return gophercloud.BuildRequestBody(opts, "loadbalancer") -} - -// Update is an operation which modifies the attributes of the specified -// LoadBalancer. -func Update(c *gophercloud.ServiceClient, id string, opts UpdateOpts) (r UpdateResult) { - b, err := opts.ToLoadBalancerUpdateMap() - if err != nil { - r.Err = err - return - } - resp, err := c.Put(resourceURL(c, id), b, &r.Body, &gophercloud.RequestOpts{ - OkCodes: []int{200, 202}, - }) - _, r.Header, r.Err = gophercloud.ParseResponse(resp, err) - return -} - -// DeleteOptsBuilder allows extensions to add additional parameters to the -// Delete request. -type DeleteOptsBuilder interface { - ToLoadBalancerDeleteQuery() (string, error) -} - -// DeleteOpts is the common options struct used in this package's Delete -// operation. -type DeleteOpts struct { - // Cascade will delete all children of the load balancer (listners, monitors, etc). - Cascade bool `q:"cascade"` -} - -// ToLoadBalancerDeleteQuery formats a DeleteOpts into a query string. -func (opts DeleteOpts) ToLoadBalancerDeleteQuery() (string, error) { - q, err := gophercloud.BuildQueryString(opts) - return q.String(), err -} - -// Delete will permanently delete a particular LoadBalancer based on its -// unique ID. -func Delete(c *gophercloud.ServiceClient, id string, opts DeleteOptsBuilder) (r DeleteResult) { - url := resourceURL(c, id) - if opts != nil { - query, err := opts.ToLoadBalancerDeleteQuery() - if err != nil { - r.Err = err - return - } - url += query - } - resp, err := c.Delete(url, nil) - _, r.Header, r.Err = gophercloud.ParseResponse(resp, err) - return -} - -// GetStatuses will return the status of a particular LoadBalancer. -func GetStatuses(c *gophercloud.ServiceClient, id string) (r GetStatusesResult) { - resp, err := c.Get(statusRootURL(c, id), &r.Body, nil) - _, r.Header, r.Err = gophercloud.ParseResponse(resp, err) - return -} - -// GetStats will return the shows the current statistics of a particular LoadBalancer. -func GetStats(c *gophercloud.ServiceClient, id string) (r StatsResult) { - resp, err := c.Get(statisticsRootURL(c, id), &r.Body, nil) - _, r.Header, r.Err = gophercloud.ParseResponse(resp, err) - return -} - -// Failover performs a failover of a load balancer. -func Failover(c *gophercloud.ServiceClient, id string) (r FailoverResult) { - resp, err := c.Put(failoverRootURL(c, id), nil, nil, &gophercloud.RequestOpts{ - OkCodes: []int{202}, - }) - _, r.Header, r.Err = gophercloud.ParseResponse(resp, err) - return -} diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/loadbalancers/results.go b/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/loadbalancers/results.go deleted file mode 100644 index 9a385363f2..0000000000 --- a/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/loadbalancers/results.go +++ /dev/null @@ -1,249 +0,0 @@ -package loadbalancers - -import ( - "encoding/json" - "time" - - "github.com/gophercloud/gophercloud" - "github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/listeners" - "github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/pools" - "github.com/gophercloud/gophercloud/pagination" -) - -// LoadBalancer is the primary load balancing configuration object that -// specifies the virtual IP address on which client traffic is received, as well -// as other details such as the load balancing method to be use, protocol, etc. -type LoadBalancer struct { - // Human-readable description for the Loadbalancer. - Description string `json:"description"` - - // The administrative state of the Loadbalancer. - // A valid value is true (UP) or false (DOWN). - AdminStateUp bool `json:"admin_state_up"` - - // Owner of the LoadBalancer. - ProjectID string `json:"project_id"` - - // UpdatedAt and CreatedAt contain ISO-8601 timestamps of when the state of the - // loadbalancer last changed, and when it was created. - UpdatedAt time.Time `json:"-"` - CreatedAt time.Time `json:"-"` - - // The provisioning status of the LoadBalancer. - // This value is ACTIVE, PENDING_CREATE or ERROR. - ProvisioningStatus string `json:"provisioning_status"` - - // The IP address of the Loadbalancer. - VipAddress string `json:"vip_address"` - - // The UUID of the port associated with the IP address. - VipPortID string `json:"vip_port_id"` - - // The UUID of the subnet on which to allocate the virtual IP for the - // Loadbalancer address. - VipSubnetID string `json:"vip_subnet_id"` - - // The UUID of the network on which to allocate the virtual IP for the - // Loadbalancer address. - VipNetworkID string `json:"vip_network_id"` - - // The unique ID for the LoadBalancer. - ID string `json:"id"` - - // The operating status of the LoadBalancer. This value is ONLINE or OFFLINE. - OperatingStatus string `json:"operating_status"` - - // Human-readable name for the LoadBalancer. Does not have to be unique. - Name string `json:"name"` - - // The UUID of a flavor if set. - FlavorID string `json:"flavor_id"` - - // The name of an Octavia availability zone if set. - AvailabilityZone string `json:"availability_zone"` - - // The name of the provider. - Provider string `json:"provider"` - - // Listeners are the listeners related to this Loadbalancer. - Listeners []listeners.Listener `json:"listeners"` - - // Pools are the pools related to this Loadbalancer. - Pools []pools.Pool `json:"pools"` - - // Tags is a list of resource tags. Tags are arbitrarily defined strings - // attached to the resource. - Tags []string `json:"tags"` -} - -func (r *LoadBalancer) UnmarshalJSON(b []byte) error { - type tmp LoadBalancer - - // Support for older neutron time format - var s1 struct { - tmp - CreatedAt gophercloud.JSONRFC3339NoZ `json:"created_at"` - UpdatedAt gophercloud.JSONRFC3339NoZ `json:"updated_at"` - } - - err := json.Unmarshal(b, &s1) - if err == nil { - *r = LoadBalancer(s1.tmp) - r.CreatedAt = time.Time(s1.CreatedAt) - r.UpdatedAt = time.Time(s1.UpdatedAt) - - return nil - } - - // Support for newer neutron time format - var s2 struct { - tmp - CreatedAt time.Time `json:"created_at"` - UpdatedAt time.Time `json:"updated_at"` - } - - err = json.Unmarshal(b, &s2) - if err != nil { - return err - } - - *r = LoadBalancer(s2.tmp) - r.CreatedAt = time.Time(s2.CreatedAt) - r.UpdatedAt = time.Time(s2.UpdatedAt) - - return nil -} - -// StatusTree represents the status of a loadbalancer. -type StatusTree struct { - Loadbalancer *LoadBalancer `json:"loadbalancer"` -} - -type Stats struct { - // The currently active connections. - ActiveConnections int `json:"active_connections"` - - // The total bytes received. - BytesIn int `json:"bytes_in"` - - // The total bytes sent. - BytesOut int `json:"bytes_out"` - - // The total requests that were unable to be fulfilled. - RequestErrors int `json:"request_errors"` - - // The total connections handled. - TotalConnections int `json:"total_connections"` -} - -// LoadBalancerPage is the page returned by a pager when traversing over a -// collection of load balancers. -type LoadBalancerPage struct { - pagination.LinkedPageBase -} - -// NextPageURL is invoked when a paginated collection of load balancers has -// reached the end of a page and the pager seeks to traverse over a new one. -// In order to do this, it needs to construct the next page's URL. -func (r LoadBalancerPage) NextPageURL() (string, error) { - var s struct { - Links []gophercloud.Link `json:"loadbalancers_links"` - } - err := r.ExtractInto(&s) - if err != nil { - return "", err - } - return gophercloud.ExtractNextURL(s.Links) -} - -// IsEmpty checks whether a LoadBalancerPage struct is empty. -func (r LoadBalancerPage) IsEmpty() (bool, error) { - is, err := ExtractLoadBalancers(r) - return len(is) == 0, err -} - -// ExtractLoadBalancers accepts a Page struct, specifically a LoadbalancerPage -// struct, and extracts the elements into a slice of LoadBalancer structs. In -// other words, a generic collection is mapped into a relevant slice. -func ExtractLoadBalancers(r pagination.Page) ([]LoadBalancer, error) { - var s struct { - LoadBalancers []LoadBalancer `json:"loadbalancers"` - } - err := (r.(LoadBalancerPage)).ExtractInto(&s) - return s.LoadBalancers, err -} - -type commonResult struct { - gophercloud.Result -} - -// Extract is a function that accepts a result and extracts a loadbalancer. -func (r commonResult) Extract() (*LoadBalancer, error) { - var s struct { - LoadBalancer *LoadBalancer `json:"loadbalancer"` - } - err := r.ExtractInto(&s) - return s.LoadBalancer, err -} - -// GetStatusesResult represents the result of a GetStatuses operation. -// Call its Extract method to interpret it as a StatusTree. -type GetStatusesResult struct { - gophercloud.Result -} - -// Extract is a function that accepts a result and extracts the status of -// a Loadbalancer. -func (r GetStatusesResult) Extract() (*StatusTree, error) { - var s struct { - Statuses *StatusTree `json:"statuses"` - } - err := r.ExtractInto(&s) - return s.Statuses, err -} - -// StatsResult represents the result of a GetStats operation. -// Call its Extract method to interpret it as a Stats. -type StatsResult struct { - gophercloud.Result -} - -// Extract is a function that accepts a result and extracts the status of -// a Loadbalancer. -func (r StatsResult) Extract() (*Stats, error) { - var s struct { - Stats *Stats `json:"stats"` - } - err := r.ExtractInto(&s) - return s.Stats, err -} - -// CreateResult represents the result of a create operation. Call its Extract -// method to interpret it as a LoadBalancer. -type CreateResult struct { - commonResult -} - -// GetResult represents the result of a get operation. Call its Extract -// method to interpret it as a LoadBalancer. -type GetResult struct { - commonResult -} - -// UpdateResult represents the result of an update operation. Call its Extract -// method to interpret it as a LoadBalancer. -type UpdateResult struct { - commonResult -} - -// DeleteResult represents the result of a delete operation. Call its -// ExtractErr method to determine if the request succeeded or failed. -type DeleteResult struct { - gophercloud.ErrResult -} - -// FailoverResult represents the result of a failover operation. Call its -// ExtractErr method to determine if the request succeeded or failed. -type FailoverResult struct { - gophercloud.ErrResult -} diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/loadbalancers/urls.go b/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/loadbalancers/urls.go deleted file mode 100644 index 7b184e35f6..0000000000 --- a/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/loadbalancers/urls.go +++ /dev/null @@ -1,31 +0,0 @@ -package loadbalancers - -import "github.com/gophercloud/gophercloud" - -const ( - rootPath = "lbaas" - resourcePath = "loadbalancers" - statusPath = "status" - statisticsPath = "stats" - failoverPath = "failover" -) - -func rootURL(c *gophercloud.ServiceClient) string { - return c.ServiceURL(rootPath, resourcePath) -} - -func resourceURL(c *gophercloud.ServiceClient, id string) string { - return c.ServiceURL(rootPath, resourcePath, id) -} - -func statusRootURL(c *gophercloud.ServiceClient, id string) string { - return c.ServiceURL(rootPath, resourcePath, id, statusPath) -} - -func statisticsRootURL(c *gophercloud.ServiceClient, id string) string { - return c.ServiceURL(rootPath, resourcePath, id, statisticsPath) -} - -func failoverRootURL(c *gophercloud.ServiceClient, id string) string { - return c.ServiceURL(rootPath, resourcePath, id, failoverPath) -} diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/monitors/doc.go b/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/monitors/doc.go deleted file mode 100644 index b191b45e9c..0000000000 --- a/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/monitors/doc.go +++ /dev/null @@ -1,71 +0,0 @@ -/* -Package monitors provides information and interaction with Monitors -of the LBaaS v2 extension for the OpenStack Networking service. - -Example to List Monitors - - listOpts := monitors.ListOpts{ - PoolID: "c79a4468-d788-410c-bf79-9a8ef6354852", - } - - allPages, err := monitors.List(networkClient, listOpts).AllPages() - if err != nil { - panic(err) - } - - allMonitors, err := monitors.ExtractMonitors(allPages) - if err != nil { - panic(err) - } - - for _, monitor := range allMonitors { - fmt.Printf("%+v\n", monitor) - } - -Example to Create a Monitor - - createOpts := monitors.CreateOpts{ - Type: "HTTP", - Name: "db", - PoolID: "84f1b61f-58c4-45bf-a8a9-2dafb9e5214d", - Delay: 20, - Timeout: 10, - MaxRetries: 5, - MaxRetriesDown: 4, - URLPath: "/check", - ExpectedCodes: "200-299", - } - - monitor, err := monitors.Create(networkClient, createOpts).Extract() - if err != nil { - panic(err) - } - -Example to Update a Monitor - - monitorID := "d67d56a6-4a86-4688-a282-f46444705c64" - - updateOpts := monitors.UpdateOpts{ - Name: "NewHealthmonitorName", - Delay: 3, - Timeout: 20, - MaxRetries: 10, - MaxRetriesDown: 8, - URLPath: "/another_check", - ExpectedCodes: "301", - } - - monitor, err := monitors.Update(networkClient, monitorID, updateOpts).Extract() - if err != nil { - panic(err) - } - -Example to Delete a Monitor - - monitorID := "d67d56a6-4a86-4688-a282-f46444705c64" - err := monitors.Delete(networkClient, monitorID).ExtractErr() - if err != nil { - panic(err) - } -*/ -package monitors diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/monitors/requests.go b/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/monitors/requests.go deleted file mode 100644 index aedf672fc1..0000000000 --- a/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/monitors/requests.go +++ /dev/null @@ -1,252 +0,0 @@ -package monitors - -import ( - "fmt" - - "github.com/gophercloud/gophercloud" - "github.com/gophercloud/gophercloud/pagination" -) - -// ListOptsBuilder allows extensions to add additional parameters to the -// List request. -type ListOptsBuilder interface { - ToMonitorListQuery() (string, error) -} - -// ListOpts allows the filtering and sorting of paginated collections through -// the API. Filtering is achieved by passing in struct field values that map to -// the Monitor attributes you want to see returned. SortKey allows you to -// sort by a particular Monitor attribute. SortDir sets the direction, and is -// either `asc' or `desc'. Marker and Limit are used for pagination. -type ListOpts struct { - ID string `q:"id"` - Name string `q:"name"` - TenantID string `q:"tenant_id"` - ProjectID string `q:"project_id"` - PoolID string `q:"pool_id"` - Type string `q:"type"` - Delay int `q:"delay"` - Timeout int `q:"timeout"` - MaxRetries int `q:"max_retries"` - MaxRetriesDown int `q:"max_retries_down"` - HTTPMethod string `q:"http_method"` - URLPath string `q:"url_path"` - ExpectedCodes string `q:"expected_codes"` - AdminStateUp *bool `q:"admin_state_up"` - Status string `q:"status"` - Limit int `q:"limit"` - Marker string `q:"marker"` - SortKey string `q:"sort_key"` - SortDir string `q:"sort_dir"` -} - -// ToMonitorListQuery formats a ListOpts into a query string. -func (opts ListOpts) ToMonitorListQuery() (string, error) { - q, err := gophercloud.BuildQueryString(opts) - if err != nil { - return "", err - } - return q.String(), nil -} - -// List returns a Pager which allows you to iterate over a collection of -// health monitors. It accepts a ListOpts struct, which allows you to filter and sort -// the returned collection for greater efficiency. -// -// Default policy settings return only those health monitors that are owned by the -// tenant who submits the request, unless an admin user submits the request. -func List(c *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager { - url := rootURL(c) - if opts != nil { - query, err := opts.ToMonitorListQuery() - if err != nil { - return pagination.Pager{Err: err} - } - url += query - } - return pagination.NewPager(c, url, func(r pagination.PageResult) pagination.Page { - return MonitorPage{pagination.LinkedPageBase{PageResult: r}} - }) -} - -// Constants that represent approved monitoring types. -const ( - TypePING = "PING" - TypeTCP = "TCP" - TypeHTTP = "HTTP" - TypeHTTPS = "HTTPS" -) - -var ( - errDelayMustGETimeout = fmt.Errorf("Delay must be greater than or equal to timeout") -) - -// CreateOptsBuilder allows extensions to add additional parameters to the -// List request. -type CreateOptsBuilder interface { - ToMonitorCreateMap() (map[string]interface{}, error) -} - -// CreateOpts is the common options struct used in this package's Create -// operation. -type CreateOpts struct { - // The Pool to Monitor. - PoolID string `json:"pool_id" required:"true"` - - // The type of probe, which is PING, TCP, HTTP, or HTTPS, that is - // sent by the load balancer to verify the member state. - Type string `json:"type" required:"true"` - - // The time, in seconds, between sending probes to members. - Delay int `json:"delay" required:"true"` - - // Maximum number of seconds for a Monitor to wait for a ping reply - // before it times out. The value must be less than the delay value. - Timeout int `json:"timeout" required:"true"` - - // Number of permissible ping failures before changing the member's - // status to INACTIVE. Must be a number between 1 and 10. - MaxRetries int `json:"max_retries" required:"true"` - - // Number of permissible ping failures befor changing the member's - // status to ERROR. Must be a number between 1 and 10. - MaxRetriesDown int `json:"max_retries_down,omitempty"` - - // URI path that will be accessed if Monitor type is HTTP or HTTPS. - URLPath string `json:"url_path,omitempty"` - - // The HTTP method used for requests by the Monitor. If this attribute - // is not specified, it defaults to "GET". Required for HTTP(S) types. - HTTPMethod string `json:"http_method,omitempty"` - - // Expected HTTP codes for a passing HTTP(S) Monitor. You can either specify - // a single status like "200", a range like "200-202", or a combination like - // "200-202, 401". - ExpectedCodes string `json:"expected_codes,omitempty"` - - // TenantID is the UUID of the project who owns the Monitor. - // Only administrative users can specify a project UUID other than their own. - TenantID string `json:"tenant_id,omitempty"` - - // ProjectID is the UUID of the project who owns the Monitor. - // Only administrative users can specify a project UUID other than their own. - ProjectID string `json:"project_id,omitempty"` - - // The Name of the Monitor. - Name string `json:"name,omitempty"` - - // The administrative state of the Monitor. A valid value is true (UP) - // or false (DOWN). - AdminStateUp *bool `json:"admin_state_up,omitempty"` -} - -// ToMonitorCreateMap builds a request body from CreateOpts. -func (opts CreateOpts) ToMonitorCreateMap() (map[string]interface{}, error) { - return gophercloud.BuildRequestBody(opts, "healthmonitor") -} - -/* - Create is an operation which provisions a new Health Monitor. There are - different types of Monitor you can provision: PING, TCP or HTTP(S). Below - are examples of how to create each one. - - Here is an example config struct to use when creating a PING or TCP Monitor: - - CreateOpts{Type: TypePING, Delay: 20, Timeout: 10, MaxRetries: 3} - CreateOpts{Type: TypeTCP, Delay: 20, Timeout: 10, MaxRetries: 3} - - Here is an example config struct to use when creating a HTTP(S) Monitor: - - CreateOpts{Type: TypeHTTP, Delay: 20, Timeout: 10, MaxRetries: 3, - HttpMethod: "HEAD", ExpectedCodes: "200", PoolID: "2c946bfc-1804-43ab-a2ff-58f6a762b505"} -*/ -func Create(c *gophercloud.ServiceClient, opts CreateOptsBuilder) (r CreateResult) { - b, err := opts.ToMonitorCreateMap() - if err != nil { - r.Err = err - return - } - resp, err := c.Post(rootURL(c), b, &r.Body, nil) - _, r.Header, r.Err = gophercloud.ParseResponse(resp, err) - return -} - -// Get retrieves a particular Health Monitor based on its unique ID. -func Get(c *gophercloud.ServiceClient, id string) (r GetResult) { - resp, err := c.Get(resourceURL(c, id), &r.Body, nil) - _, r.Header, r.Err = gophercloud.ParseResponse(resp, err) - return -} - -// UpdateOptsBuilder allows extensions to add additional parameters to the -// Update request. -type UpdateOptsBuilder interface { - ToMonitorUpdateMap() (map[string]interface{}, error) -} - -// UpdateOpts is the common options struct used in this package's Update -// operation. -type UpdateOpts struct { - // The time, in seconds, between sending probes to members. - Delay int `json:"delay,omitempty"` - - // Maximum number of seconds for a Monitor to wait for a ping reply - // before it times out. The value must be less than the delay value. - Timeout int `json:"timeout,omitempty"` - - // Number of permissible ping failures before changing the member's - // status to INACTIVE. Must be a number between 1 and 10. - MaxRetries int `json:"max_retries,omitempty"` - - // Number of permissible ping failures befor changing the member's - // status to ERROR. Must be a number between 1 and 10. - MaxRetriesDown int `json:"max_retries_down,omitempty"` - - // URI path that will be accessed if Monitor type is HTTP or HTTPS. - // Required for HTTP(S) types. - URLPath string `json:"url_path,omitempty"` - - // The HTTP method used for requests by the Monitor. If this attribute - // is not specified, it defaults to "GET". Required for HTTP(S) types. - HTTPMethod string `json:"http_method,omitempty"` - - // Expected HTTP codes for a passing HTTP(S) Monitor. You can either specify - // a single status like "200", or a range like "200-202". Required for HTTP(S) - // types. - ExpectedCodes string `json:"expected_codes,omitempty"` - - // The Name of the Monitor. - Name *string `json:"name,omitempty"` - - // The administrative state of the Monitor. A valid value is true (UP) - // or false (DOWN). - AdminStateUp *bool `json:"admin_state_up,omitempty"` -} - -// ToMonitorUpdateMap builds a request body from UpdateOpts. -func (opts UpdateOpts) ToMonitorUpdateMap() (map[string]interface{}, error) { - return gophercloud.BuildRequestBody(opts, "healthmonitor") -} - -// Update is an operation which modifies the attributes of the specified -// Monitor. -func Update(c *gophercloud.ServiceClient, id string, opts UpdateOptsBuilder) (r UpdateResult) { - b, err := opts.ToMonitorUpdateMap() - if err != nil { - r.Err = err - return - } - - resp, err := c.Put(resourceURL(c, id), b, &r.Body, &gophercloud.RequestOpts{ - OkCodes: []int{200, 202}, - }) - _, r.Header, r.Err = gophercloud.ParseResponse(resp, err) - return -} - -// Delete will permanently delete a particular Monitor based on its unique ID. -func Delete(c *gophercloud.ServiceClient, id string) (r DeleteResult) { - resp, err := c.Delete(resourceURL(c, id), nil) - _, r.Header, r.Err = gophercloud.ParseResponse(resp, err) - return -} diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/monitors/results.go b/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/monitors/results.go deleted file mode 100644 index dec9395192..0000000000 --- a/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/monitors/results.go +++ /dev/null @@ -1,160 +0,0 @@ -package monitors - -import ( - "github.com/gophercloud/gophercloud" - "github.com/gophercloud/gophercloud/pagination" -) - -type PoolID struct { - ID string `json:"id"` -} - -// Monitor represents a load balancer health monitor. A health monitor is used -// to determine whether or not back-end members of the VIP's pool are usable -// for processing a request. A pool can have several health monitors associated -// with it. There are different types of health monitors supported: -// -// PING: used to ping the members using ICMP. -// TCP: used to connect to the members using TCP. -// HTTP: used to send an HTTP request to the member. -// HTTPS: used to send a secure HTTP request to the member. -// -// When a pool has several monitors associated with it, each member of the pool -// is monitored by all these monitors. If any monitor declares the member as -// unhealthy, then the member status is changed to INACTIVE and the member -// won't participate in its pool's load balancing. In other words, ALL monitors -// must declare the member to be healthy for it to stay ACTIVE. -type Monitor struct { - // The unique ID for the Monitor. - ID string `json:"id"` - - // The Name of the Monitor. - Name string `json:"name"` - - // The owner of the Monitor. - ProjectID string `json:"project_id"` - - // The type of probe sent by the load balancer to verify the member state, - // which is PING, TCP, HTTP, or HTTPS. - Type string `json:"type"` - - // The time, in seconds, between sending probes to members. - Delay int `json:"delay"` - - // The maximum number of seconds for a monitor to wait for a connection to be - // established before it times out. This value must be less than the delay - // value. - Timeout int `json:"timeout"` - - // Number of allowed connection failures before changing the status of the - // member to INACTIVE. A valid value is from 1 to 10. - MaxRetries int `json:"max_retries"` - - // Number of allowed connection failures before changing the status of the - // member to Error. A valid value is from 1 to 10. - MaxRetriesDown int `json:"max_retries_down"` - - // The HTTP method that the monitor uses for requests. - HTTPMethod string `json:"http_method"` - - // The HTTP path of the request sent by the monitor to test the health of a - // member. Must be a string beginning with a forward slash (/). - URLPath string `json:"url_path" ` - - // Expected HTTP codes for a passing HTTP(S) monitor. - ExpectedCodes string `json:"expected_codes"` - - // The administrative state of the health monitor, which is up (true) or - // down (false). - AdminStateUp bool `json:"admin_state_up"` - - // The status of the health monitor. Indicates whether the health monitor is - // operational. - Status string `json:"status"` - - // List of pools that are associated with the health monitor. - Pools []PoolID `json:"pools"` - - // The provisioning status of the Monitor. - // This value is ACTIVE, PENDING_* or ERROR. - ProvisioningStatus string `json:"provisioning_status"` - - // The operating status of the monitor. - OperatingStatus string `json:"operating_status"` -} - -// MonitorPage is the page returned by a pager when traversing over a -// collection of health monitors. -type MonitorPage struct { - pagination.LinkedPageBase -} - -// NextPageURL is invoked when a paginated collection of monitors has reached -// the end of a page and the pager seeks to traverse over a new one. In order -// to do this, it needs to construct the next page's URL. -func (r MonitorPage) NextPageURL() (string, error) { - var s struct { - Links []gophercloud.Link `json:"healthmonitors_links"` - } - - err := r.ExtractInto(&s) - if err != nil { - return "", err - } - - return gophercloud.ExtractNextURL(s.Links) -} - -// IsEmpty checks whether a MonitorPage struct is empty. -func (r MonitorPage) IsEmpty() (bool, error) { - is, err := ExtractMonitors(r) - return len(is) == 0, err -} - -// ExtractMonitors accepts a Page struct, specifically a MonitorPage struct, -// and extracts the elements into a slice of Monitor structs. In other words, -// a generic collection is mapped into a relevant slice. -func ExtractMonitors(r pagination.Page) ([]Monitor, error) { - var s struct { - Monitors []Monitor `json:"healthmonitors"` - } - err := (r.(MonitorPage)).ExtractInto(&s) - return s.Monitors, err -} - -type commonResult struct { - gophercloud.Result -} - -// Extract is a function that accepts a result and extracts a monitor. -func (r commonResult) Extract() (*Monitor, error) { - var s struct { - Monitor *Monitor `json:"healthmonitor"` - } - err := r.ExtractInto(&s) - return s.Monitor, err -} - -// CreateResult represents the result of a create operation. Call its Extract -// method to interpret it as a Monitor. -type CreateResult struct { - commonResult -} - -// GetResult represents the result of a get operation. Call its Extract -// method to interpret it as a Monitor. -type GetResult struct { - commonResult -} - -// UpdateResult represents the result of an update operation. Call its Extract -// method to interpret it as a Monitor. -type UpdateResult struct { - commonResult -} - -// DeleteResult represents the result of a delete operation. Call its -// ExtractErr method to determine if the result succeeded or failed. -type DeleteResult struct { - gophercloud.ErrResult -} diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/monitors/urls.go b/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/monitors/urls.go deleted file mode 100644 index a222e52a93..0000000000 --- a/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/monitors/urls.go +++ /dev/null @@ -1,16 +0,0 @@ -package monitors - -import "github.com/gophercloud/gophercloud" - -const ( - rootPath = "lbaas" - resourcePath = "healthmonitors" -) - -func rootURL(c *gophercloud.ServiceClient) string { - return c.ServiceURL(rootPath, resourcePath) -} - -func resourceURL(c *gophercloud.ServiceClient, id string) string { - return c.ServiceURL(rootPath, resourcePath, id) -} diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/pools/doc.go b/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/pools/doc.go deleted file mode 100644 index d26de312cb..0000000000 --- a/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/pools/doc.go +++ /dev/null @@ -1,154 +0,0 @@ -/* -Package pools provides information and interaction with Pools and -Members of the LBaaS v2 extension for the OpenStack Networking service. - -Example to List Pools - - listOpts := pools.ListOpts{ - LoadbalancerID: "c79a4468-d788-410c-bf79-9a8ef6354852", - } - - allPages, err := pools.List(networkClient, listOpts).AllPages() - if err != nil { - panic(err) - } - - allPools, err := pools.ExtractMonitors(allPages) - if err != nil { - panic(err) - } - - for _, pools := range allPools { - fmt.Printf("%+v\n", pool) - } - -Example to Create a Pool - - createOpts := pools.CreateOpts{ - LBMethod: pools.LBMethodRoundRobin, - Protocol: "HTTP", - Name: "Example pool", - LoadbalancerID: "79e05663-7f03-45d2-a092-8b94062f22ab", - } - - pool, err := pools.Create(networkClient, createOpts).Extract() - if err != nil { - panic(err) - } - -Example to Update a Pool - - poolID := "d67d56a6-4a86-4688-a282-f46444705c64" - - updateOpts := pools.UpdateOpts{ - Name: "new-name", - } - - pool, err := pools.Update(networkClient, poolID, updateOpts).Extract() - if err != nil { - panic(err) - } - -Example to Delete a Pool - - poolID := "d67d56a6-4a86-4688-a282-f46444705c64" - err := pools.Delete(networkClient, poolID).ExtractErr() - if err != nil { - panic(err) - } - -Example to List Pool Members - - poolID := "d67d56a6-4a86-4688-a282-f46444705c64" - - listOpts := pools.ListMemberOpts{ - ProtocolPort: 80, - } - - allPages, err := pools.ListMembers(networkClient, poolID, listOpts).AllPages() - if err != nil { - panic(err) - } - - allMembers, err := pools.ExtractMembers(allPages) - if err != nil { - panic(err) - } - - for _, member := allMembers { - fmt.Printf("%+v\n", member) - } - -Example to Create a Member - - poolID := "d67d56a6-4a86-4688-a282-f46444705c64" - - weight := 10 - createOpts := pools.CreateMemberOpts{ - Name: "db", - SubnetID: "1981f108-3c48-48d2-b908-30f7d28532c9", - Address: "10.0.2.11", - ProtocolPort: 80, - Weight: &weight, - } - - member, err := pools.CreateMember(networkClient, poolID, createOpts).Extract() - if err != nil { - panic(err) - } - -Example to Update a Member - - poolID := "d67d56a6-4a86-4688-a282-f46444705c64" - memberID := "64dba99f-8af8-4200-8882-e32a0660f23e" - - weight := 4 - updateOpts := pools.UpdateMemberOpts{ - Name: "new-name", - Weight: &weight, - } - - member, err := pools.UpdateMember(networkClient, poolID, memberID, updateOpts).Extract() - if err != nil { - panic(err) - } - -Example to Delete a Member - - poolID := "d67d56a6-4a86-4688-a282-f46444705c64" - memberID := "64dba99f-8af8-4200-8882-e32a0660f23e" - - err := pools.DeleteMember(networkClient, poolID, memberID).ExtractErr() - if err != nil { - panic(err) - } - -Example to Update Members: - - poolID := "d67d56a6-4a86-4688-a282-f46444705c64" - - weight_1 := 20 - member1 := pools.BatchUpdateMemberOpts{ - Address: "192.0.2.16", - ProtocolPort: 80, - Name: "web-server-1", - SubnetID: "bbb35f84-35cc-4b2f-84c2-a6a29bba68aa", - Weight: &weight_1, - } - - weight_2 := 10 - member2 := pools.BatchUpdateMemberOpts{ - Address: "192.0.2.17", - ProtocolPort: 80, - Name: "web-server-2", - Weight: &weight_2, - SubnetID: "bbb35f84-35cc-4b2f-84c2-a6a29bba68aa", - } - members := []pools.BatchUpdateMemberOpts{member1, member2} - - err := pools.BatchUpdateMembers(networkClient, poolID, members).ExtractErr() - if err != nil { - panic(err) - } -*/ -package pools diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/pools/requests.go b/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/pools/requests.go deleted file mode 100644 index 5a4c7750a3..0000000000 --- a/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/pools/requests.go +++ /dev/null @@ -1,433 +0,0 @@ -package pools - -import ( - "github.com/gophercloud/gophercloud" - "github.com/gophercloud/gophercloud/pagination" -) - -// ListOptsBuilder allows extensions to add additional parameters to the -// List request. -type ListOptsBuilder interface { - ToPoolListQuery() (string, error) -} - -// ListOpts allows the filtering and sorting of paginated collections through -// the API. Filtering is achieved by passing in struct field values that map to -// the Pool attributes you want to see returned. SortKey allows you to -// sort by a particular Pool attribute. SortDir sets the direction, and is -// either `asc' or `desc'. Marker and Limit are used for pagination. -type ListOpts struct { - LBMethod string `q:"lb_algorithm"` - Protocol string `q:"protocol"` - ProjectID string `q:"project_id"` - AdminStateUp *bool `q:"admin_state_up"` - Name string `q:"name"` - ID string `q:"id"` - LoadbalancerID string `q:"loadbalancer_id"` - Limit int `q:"limit"` - Marker string `q:"marker"` - SortKey string `q:"sort_key"` - SortDir string `q:"sort_dir"` -} - -// ToPoolListQuery formats a ListOpts into a query string. -func (opts ListOpts) ToPoolListQuery() (string, error) { - q, err := gophercloud.BuildQueryString(opts) - return q.String(), err -} - -// List returns a Pager which allows you to iterate over a collection of -// pools. It accepts a ListOpts struct, which allows you to filter and sort -// the returned collection for greater efficiency. -// -// Default policy settings return only those pools that are owned by the -// project who submits the request, unless an admin user submits the request. -func List(c *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager { - url := rootURL(c) - if opts != nil { - query, err := opts.ToPoolListQuery() - if err != nil { - return pagination.Pager{Err: err} - } - url += query - } - return pagination.NewPager(c, url, func(r pagination.PageResult) pagination.Page { - return PoolPage{pagination.LinkedPageBase{PageResult: r}} - }) -} - -type LBMethod string -type Protocol string - -// Supported attributes for create/update operations. -const ( - LBMethodRoundRobin LBMethod = "ROUND_ROBIN" - LBMethodLeastConnections LBMethod = "LEAST_CONNECTIONS" - LBMethodSourceIp LBMethod = "SOURCE_IP" - - ProtocolTCP Protocol = "TCP" - ProtocolUDP Protocol = "UDP" - ProtocolPROXY Protocol = "PROXY" - ProtocolHTTP Protocol = "HTTP" - ProtocolHTTPS Protocol = "HTTPS" -) - -// CreateOptsBuilder allows extensions to add additional parameters to the -// Create request. -type CreateOptsBuilder interface { - ToPoolCreateMap() (map[string]interface{}, error) -} - -// CreateOpts is the common options struct used in this package's Create -// operation. -type CreateOpts struct { - // The algorithm used to distribute load between the members of the pool. The - // current specification supports LBMethodRoundRobin, LBMethodLeastConnections - // and LBMethodSourceIp as valid values for this attribute. - LBMethod LBMethod `json:"lb_algorithm" required:"true"` - - // The protocol used by the pool members, you can use either - // ProtocolTCP, ProtocolUDP, ProtocolPROXY, ProtocolHTTP, or ProtocolHTTPS. - Protocol Protocol `json:"protocol" required:"true"` - - // The Loadbalancer on which the members of the pool will be associated with. - // Note: one of LoadbalancerID or ListenerID must be provided. - LoadbalancerID string `json:"loadbalancer_id,omitempty" xor:"ListenerID"` - - // The Listener on which the members of the pool will be associated with. - // Note: one of LoadbalancerID or ListenerID must be provided. - ListenerID string `json:"listener_id,omitempty" xor:"LoadbalancerID"` - - // ProjectID is the UUID of the project who owns the Pool. - // Only administrative users can specify a project UUID other than their own. - ProjectID string `json:"project_id,omitempty"` - - // Name of the pool. - Name string `json:"name,omitempty"` - - // Human-readable description for the pool. - Description string `json:"description,omitempty"` - - // Persistence is the session persistence of the pool. - // Omit this field to prevent session persistence. - Persistence *SessionPersistence `json:"session_persistence,omitempty"` - - // The administrative state of the Pool. A valid value is true (UP) - // or false (DOWN). - AdminStateUp *bool `json:"admin_state_up,omitempty"` -} - -// ToPoolCreateMap builds a request body from CreateOpts. -func (opts CreateOpts) ToPoolCreateMap() (map[string]interface{}, error) { - return gophercloud.BuildRequestBody(opts, "pool") -} - -// Create accepts a CreateOpts struct and uses the values to create a new -// load balancer pool. -func Create(c *gophercloud.ServiceClient, opts CreateOptsBuilder) (r CreateResult) { - b, err := opts.ToPoolCreateMap() - if err != nil { - r.Err = err - return - } - resp, err := c.Post(rootURL(c), b, &r.Body, nil) - _, r.Header, r.Err = gophercloud.ParseResponse(resp, err) - return -} - -// Get retrieves a particular pool based on its unique ID. -func Get(c *gophercloud.ServiceClient, id string) (r GetResult) { - resp, err := c.Get(resourceURL(c, id), &r.Body, nil) - _, r.Header, r.Err = gophercloud.ParseResponse(resp, err) - return -} - -// UpdateOptsBuilder allows extensions to add additional parameters to the -// Update request. -type UpdateOptsBuilder interface { - ToPoolUpdateMap() (map[string]interface{}, error) -} - -// UpdateOpts is the common options struct used in this package's Update -// operation. -type UpdateOpts struct { - // Name of the pool. - Name *string `json:"name,omitempty"` - - // Human-readable description for the pool. - Description *string `json:"description,omitempty"` - - // The algorithm used to distribute load between the members of the pool. The - // current specification supports LBMethodRoundRobin, LBMethodLeastConnections - // and LBMethodSourceIp as valid values for this attribute. - LBMethod LBMethod `json:"lb_algorithm,omitempty"` - - // The administrative state of the Pool. A valid value is true (UP) - // or false (DOWN). - AdminStateUp *bool `json:"admin_state_up,omitempty"` -} - -// ToPoolUpdateMap builds a request body from UpdateOpts. -func (opts UpdateOpts) ToPoolUpdateMap() (map[string]interface{}, error) { - return gophercloud.BuildRequestBody(opts, "pool") -} - -// Update allows pools to be updated. -func Update(c *gophercloud.ServiceClient, id string, opts UpdateOptsBuilder) (r UpdateResult) { - b, err := opts.ToPoolUpdateMap() - if err != nil { - r.Err = err - return - } - resp, err := c.Put(resourceURL(c, id), b, &r.Body, &gophercloud.RequestOpts{ - OkCodes: []int{200}, - }) - _, r.Header, r.Err = gophercloud.ParseResponse(resp, err) - return -} - -// Delete will permanently delete a particular pool based on its unique ID. -func Delete(c *gophercloud.ServiceClient, id string) (r DeleteResult) { - resp, err := c.Delete(resourceURL(c, id), nil) - _, r.Header, r.Err = gophercloud.ParseResponse(resp, err) - return -} - -// ListMemberOptsBuilder allows extensions to add additional parameters to the -// ListMembers request. -type ListMembersOptsBuilder interface { - ToMembersListQuery() (string, error) -} - -// ListMembersOpts allows the filtering and sorting of paginated collections -// through the API. Filtering is achieved by passing in struct field values -// that map to the Member attributes you want to see returned. SortKey allows -// you to sort by a particular Member attribute. SortDir sets the direction, -// and is either `asc' or `desc'. Marker and Limit are used for pagination. -type ListMembersOpts struct { - Name string `q:"name"` - Weight int `q:"weight"` - AdminStateUp *bool `q:"admin_state_up"` - ProjectID string `q:"project_id"` - Address string `q:"address"` - ProtocolPort int `q:"protocol_port"` - ID string `q:"id"` - Limit int `q:"limit"` - Marker string `q:"marker"` - SortKey string `q:"sort_key"` - SortDir string `q:"sort_dir"` -} - -// ToMemberListQuery formats a ListOpts into a query string. -func (opts ListMembersOpts) ToMembersListQuery() (string, error) { - q, err := gophercloud.BuildQueryString(opts) - return q.String(), err -} - -// ListMembers returns a Pager which allows you to iterate over a collection of -// members. It accepts a ListMembersOptsBuilder, which allows you to filter and -// sort the returned collection for greater efficiency. -// -// Default policy settings return only those members that are owned by the -// project who submits the request, unless an admin user submits the request. -func ListMembers(c *gophercloud.ServiceClient, poolID string, opts ListMembersOptsBuilder) pagination.Pager { - url := memberRootURL(c, poolID) - if opts != nil { - query, err := opts.ToMembersListQuery() - if err != nil { - return pagination.Pager{Err: err} - } - url += query - } - return pagination.NewPager(c, url, func(r pagination.PageResult) pagination.Page { - return MemberPage{pagination.LinkedPageBase{PageResult: r}} - }) -} - -// CreateMemberOptsBuilder allows extensions to add additional parameters to the -// CreateMember request. -type CreateMemberOptsBuilder interface { - ToMemberCreateMap() (map[string]interface{}, error) -} - -// CreateMemberOpts is the common options struct used in this package's CreateMember -// operation. -type CreateMemberOpts struct { - // The IP address of the member to receive traffic from the load balancer. - Address string `json:"address" required:"true"` - - // The port on which to listen for client traffic. - ProtocolPort int `json:"protocol_port" required:"true"` - - // Name of the Member. - Name string `json:"name,omitempty"` - - // ProjectID is the UUID of the project who owns the Member. - // Only administrative users can specify a project UUID other than their own. - ProjectID string `json:"project_id,omitempty"` - - // A positive integer value that indicates the relative portion of traffic - // that this member should receive from the pool. For example, a member with - // a weight of 10 receives five times as much traffic as a member with a - // weight of 2. - Weight *int `json:"weight,omitempty"` - - // If you omit this parameter, LBaaS uses the vip_subnet_id parameter value - // for the subnet UUID. - SubnetID string `json:"subnet_id,omitempty"` - - // The administrative state of the Pool. A valid value is true (UP) - // or false (DOWN). - AdminStateUp *bool `json:"admin_state_up,omitempty"` - - // Is the member a backup? Backup members only receive traffic when all non-backup members are down. - Backup *bool `json:"backup,omitempty"` - - // An alternate IP address used for health monitoring a backend member. - MonitorAddress string `json:"monitor_address,omitempty"` - - // An alternate protocol port used for health monitoring a backend member. - MonitorPort *int `json:"monitor_port,omitempty"` -} - -// ToMemberCreateMap builds a request body from CreateMemberOpts. -func (opts CreateMemberOpts) ToMemberCreateMap() (map[string]interface{}, error) { - return gophercloud.BuildRequestBody(opts, "member") -} - -// CreateMember will create and associate a Member with a particular Pool. -func CreateMember(c *gophercloud.ServiceClient, poolID string, opts CreateMemberOptsBuilder) (r CreateMemberResult) { - b, err := opts.ToMemberCreateMap() - if err != nil { - r.Err = err - return - } - resp, err := c.Post(memberRootURL(c, poolID), b, &r.Body, nil) - _, r.Header, r.Err = gophercloud.ParseResponse(resp, err) - return -} - -// GetMember retrieves a particular Pool Member based on its unique ID. -func GetMember(c *gophercloud.ServiceClient, poolID string, memberID string) (r GetMemberResult) { - resp, err := c.Get(memberResourceURL(c, poolID, memberID), &r.Body, nil) - _, r.Header, r.Err = gophercloud.ParseResponse(resp, err) - return -} - -// UpdateMemberOptsBuilder allows extensions to add additional parameters to the -// List request. -type UpdateMemberOptsBuilder interface { - ToMemberUpdateMap() (map[string]interface{}, error) -} - -// UpdateMemberOpts is the common options struct used in this package's Update -// operation. -type UpdateMemberOpts struct { - // Name of the Member. - Name *string `json:"name,omitempty"` - - // A positive integer value that indicates the relative portion of traffic - // that this member should receive from the pool. For example, a member with - // a weight of 10 receives five times as much traffic as a member with a - // weight of 2. - Weight *int `json:"weight,omitempty"` - - // The administrative state of the Pool. A valid value is true (UP) - // or false (DOWN). - AdminStateUp *bool `json:"admin_state_up,omitempty"` -} - -// ToMemberUpdateMap builds a request body from UpdateMemberOpts. -func (opts UpdateMemberOpts) ToMemberUpdateMap() (map[string]interface{}, error) { - return gophercloud.BuildRequestBody(opts, "member") -} - -// Update allows Member to be updated. -func UpdateMember(c *gophercloud.ServiceClient, poolID string, memberID string, opts UpdateMemberOptsBuilder) (r UpdateMemberResult) { - b, err := opts.ToMemberUpdateMap() - if err != nil { - r.Err = err - return - } - resp, err := c.Put(memberResourceURL(c, poolID, memberID), b, &r.Body, &gophercloud.RequestOpts{ - OkCodes: []int{200, 201, 202}, - }) - _, r.Header, r.Err = gophercloud.ParseResponse(resp, err) - return -} - -// BatchUpdateMemberOptsBuilder allows extensions to add additional parameters to the BatchUpdateMembers request. -type BatchUpdateMemberOptsBuilder interface { - ToBatchMemberUpdateMap() (map[string]interface{}, error) -} - -// BatchUpdateMemberOpts is the common options struct used in this package's BatchUpdateMembers -// operation. -type BatchUpdateMemberOpts struct { - // The IP address of the member to receive traffic from the load balancer. - Address string `json:"address" required:"true"` - - // The port on which to listen for client traffic. - ProtocolPort int `json:"protocol_port" required:"true"` - - // Name of the Member. - Name *string `json:"name,omitempty"` - - // ProjectID is the UUID of the project who owns the Member. - // Only administrative users can specify a project UUID other than their own. - ProjectID string `json:"project_id,omitempty"` - - // A positive integer value that indicates the relative portion of traffic - // that this member should receive from the pool. For example, a member with - // a weight of 10 receives five times as much traffic as a member with a - // weight of 2. - Weight *int `json:"weight,omitempty"` - - // If you omit this parameter, LBaaS uses the vip_subnet_id parameter value - // for the subnet UUID. - SubnetID *string `json:"subnet_id,omitempty"` - - // The administrative state of the Pool. A valid value is true (UP) - // or false (DOWN). - AdminStateUp *bool `json:"admin_state_up,omitempty"` -} - -// ToBatchMemberUpdateMap builds a request body from BatchUpdateMemberOpts. -func (opts BatchUpdateMemberOpts) ToBatchMemberUpdateMap() (map[string]interface{}, error) { - b, err := gophercloud.BuildRequestBody(opts, "") - if err != nil { - return nil, err - } - - if b["subnet_id"] == "" { - b["subnet_id"] = nil - } - - return b, nil -} - -// BatchUpdateMembers updates the pool members in batch -func BatchUpdateMembers(c *gophercloud.ServiceClient, poolID string, opts []BatchUpdateMemberOpts) (r UpdateMembersResult) { - members := []map[string]interface{}{} - for _, opt := range opts { - b, err := opt.ToBatchMemberUpdateMap() - if err != nil { - r.Err = err - return - } - members = append(members, b) - } - - b := map[string]interface{}{"members": members} - - resp, err := c.Put(memberRootURL(c, poolID), b, nil, &gophercloud.RequestOpts{OkCodes: []int{202}}) - _, r.Header, r.Err = gophercloud.ParseResponse(resp, err) - return -} - -// DeleteMember will remove and disassociate a Member from a particular Pool. -func DeleteMember(c *gophercloud.ServiceClient, poolID string, memberID string) (r DeleteMemberResult) { - resp, err := c.Delete(memberResourceURL(c, poolID, memberID), nil) - _, r.Header, r.Err = gophercloud.ParseResponse(resp, err) - return -} diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/pools/results.go b/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/pools/results.go deleted file mode 100644 index 1dc0ed90ac..0000000000 --- a/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/pools/results.go +++ /dev/null @@ -1,328 +0,0 @@ -package pools - -import ( - "encoding/json" - "time" - - "github.com/gophercloud/gophercloud" - "github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/monitors" - "github.com/gophercloud/gophercloud/pagination" -) - -// SessionPersistence represents the session persistence feature of the load -// balancing service. It attempts to force connections or requests in the same -// session to be processed by the same member as long as it is ative. Three -// types of persistence are supported: -// -// SOURCE_IP: With this mode, all connections originating from the same source -// IP address, will be handled by the same Member of the Pool. -// HTTP_COOKIE: With this persistence mode, the load balancing function will -// create a cookie on the first request from a client. Subsequent -// requests containing the same cookie value will be handled by -// the same Member of the Pool. -// APP_COOKIE: With this persistence mode, the load balancing function will -// rely on a cookie established by the backend application. All -// requests carrying the same cookie value will be handled by the -// same Member of the Pool. -type SessionPersistence struct { - // The type of persistence mode. - Type string `json:"type"` - - // Name of cookie if persistence mode is set appropriately. - CookieName string `json:"cookie_name,omitempty"` -} - -// LoadBalancerID represents a load balancer. -type LoadBalancerID struct { - ID string `json:"id"` -} - -// ListenerID represents a listener. -type ListenerID struct { - ID string `json:"id"` -} - -// Pool represents a logical set of devices, such as web servers, that you -// group together to receive and process traffic. The load balancing function -// chooses a Member of the Pool according to the configured load balancing -// method to handle the new requests or connections received on the VIP address. -type Pool struct { - // The load-balancer algorithm, which is round-robin, least-connections, and - // so on. This value, which must be supported, is dependent on the provider. - // Round-robin must be supported. - LBMethod string `json:"lb_algorithm"` - - // The protocol of the Pool, which is TCP, HTTP, or HTTPS. - Protocol string `json:"protocol"` - - // Description for the Pool. - Description string `json:"description"` - - // A list of listeners objects IDs. - Listeners []ListenerID `json:"listeners"` //[]map[string]interface{} - - // A list of member objects IDs. - Members []Member `json:"members"` - - // The ID of associated health monitor. - MonitorID string `json:"healthmonitor_id"` - - // The network on which the members of the Pool will be located. Only members - // that are on this network can be added to the Pool. - SubnetID string `json:"subnet_id"` - - // Owner of the Pool. - ProjectID string `json:"project_id"` - - // The administrative state of the Pool, which is up (true) or down (false). - AdminStateUp bool `json:"admin_state_up"` - - // Pool name. Does not have to be unique. - Name string `json:"name"` - - // The unique ID for the Pool. - ID string `json:"id"` - - // A list of load balancer objects IDs. - Loadbalancers []LoadBalancerID `json:"loadbalancers"` - - // Indicates whether connections in the same session will be processed by the - // same Pool member or not. - Persistence SessionPersistence `json:"session_persistence"` - - // The load balancer provider. - Provider string `json:"provider"` - - // The Monitor associated with this Pool. - Monitor monitors.Monitor `json:"healthmonitor"` - - // The provisioning status of the pool. - // This value is ACTIVE, PENDING_* or ERROR. - ProvisioningStatus string `json:"provisioning_status"` - - // The operating status of the pool. - OperatingStatus string `json:"operating_status"` -} - -// PoolPage is the page returned by a pager when traversing over a -// collection of pools. -type PoolPage struct { - pagination.LinkedPageBase -} - -// NextPageURL is invoked when a paginated collection of pools has reached -// the end of a page and the pager seeks to traverse over a new one. In order -// to do this, it needs to construct the next page's URL. -func (r PoolPage) NextPageURL() (string, error) { - var s struct { - Links []gophercloud.Link `json:"pools_links"` - } - err := r.ExtractInto(&s) - if err != nil { - return "", err - } - return gophercloud.ExtractNextURL(s.Links) -} - -// IsEmpty checks whether a PoolPage struct is empty. -func (r PoolPage) IsEmpty() (bool, error) { - is, err := ExtractPools(r) - return len(is) == 0, err -} - -// ExtractPools accepts a Page struct, specifically a PoolPage struct, -// and extracts the elements into a slice of Pool structs. In other words, -// a generic collection is mapped into a relevant slice. -func ExtractPools(r pagination.Page) ([]Pool, error) { - var s struct { - Pools []Pool `json:"pools"` - } - err := (r.(PoolPage)).ExtractInto(&s) - return s.Pools, err -} - -type commonResult struct { - gophercloud.Result -} - -// Extract is a function that accepts a result and extracts a pool. -func (r commonResult) Extract() (*Pool, error) { - var s struct { - Pool *Pool `json:"pool"` - } - err := r.ExtractInto(&s) - return s.Pool, err -} - -// CreateResult represents the result of a Create operation. Call its Extract -// method to interpret the result as a Pool. -type CreateResult struct { - commonResult -} - -// GetResult represents the result of a Get operation. Call its Extract -// method to interpret the result as a Pool. -type GetResult struct { - commonResult -} - -// UpdateResult represents the result of an Update operation. Call its Extract -// method to interpret the result as a Pool. -type UpdateResult struct { - commonResult -} - -// DeleteResult represents the result of a Delete operation. Call its -// ExtractErr method to determine if the request succeeded or failed. -type DeleteResult struct { - gophercloud.ErrResult -} - -// Member represents the application running on a backend server. -type Member struct { - // Name of the Member. - Name string `json:"name"` - - // Weight of Member. - Weight int `json:"weight"` - - // The administrative state of the member, which is up (true) or down (false). - AdminStateUp bool `json:"admin_state_up"` - - // Owner of the Member. - ProjectID string `json:"project_id"` - - // Parameter value for the subnet UUID. - SubnetID string `json:"subnet_id"` - - // The Pool to which the Member belongs. - PoolID string `json:"pool_id"` - - // The IP address of the Member. - Address string `json:"address"` - - // The port on which the application is hosted. - ProtocolPort int `json:"protocol_port"` - - // The unique ID for the Member. - ID string `json:"id"` - - // The provisioning status of the pool. - // This value is ACTIVE, PENDING_* or ERROR. - ProvisioningStatus string `json:"provisioning_status"` - - // DateTime when the member was created - CreatedAt time.Time `json:"-"` - - // DateTime when the member was updated - UpdatedAt time.Time `json:"-"` - - // The operating status of the member - OperatingStatus string `json:"operating_status"` - - // Is the member a backup? Backup members only receive traffic when all non-backup members are down. - Backup bool `json:"backup"` - - // An alternate IP address used for health monitoring a backend member. - MonitorAddress string `json:"monitor_address"` - - // An alternate protocol port used for health monitoring a backend member. - MonitorPort int `json:"monitor_port"` -} - -// MemberPage is the page returned by a pager when traversing over a -// collection of Members in a Pool. -type MemberPage struct { - pagination.LinkedPageBase -} - -// NextPageURL is invoked when a paginated collection of members has reached -// the end of a page and the pager seeks to traverse over a new one. In order -// to do this, it needs to construct the next page's URL. -func (r MemberPage) NextPageURL() (string, error) { - var s struct { - Links []gophercloud.Link `json:"members_links"` - } - err := r.ExtractInto(&s) - if err != nil { - return "", err - } - return gophercloud.ExtractNextURL(s.Links) -} - -// IsEmpty checks whether a MemberPage struct is empty. -func (r MemberPage) IsEmpty() (bool, error) { - is, err := ExtractMembers(r) - return len(is) == 0, err -} - -// ExtractMembers accepts a Page struct, specifically a MemberPage struct, -// and extracts the elements into a slice of Members structs. In other words, -// a generic collection is mapped into a relevant slice. -func ExtractMembers(r pagination.Page) ([]Member, error) { - var s struct { - Members []Member `json:"members"` - } - err := (r.(MemberPage)).ExtractInto(&s) - return s.Members, err -} - -type commonMemberResult struct { - gophercloud.Result -} - -func (r *Member) UnmarshalJSON(b []byte) error { - type tmp Member - var s struct { - tmp - CreatedAt gophercloud.JSONRFC3339NoZ `json:"created_at"` - UpdatedAt gophercloud.JSONRFC3339NoZ `json:"updated_at"` - } - err := json.Unmarshal(b, &s) - if err != nil { - return err - } - *r = Member(s.tmp) - r.CreatedAt = time.Time(s.CreatedAt) - r.UpdatedAt = time.Time(s.UpdatedAt) - return nil -} - -// ExtractMember is a function that accepts a result and extracts a member. -func (r commonMemberResult) Extract() (*Member, error) { - var s struct { - Member *Member `json:"member"` - } - err := r.ExtractInto(&s) - return s.Member, err -} - -// CreateMemberResult represents the result of a CreateMember operation. -// Call its Extract method to interpret it as a Member. -type CreateMemberResult struct { - commonMemberResult -} - -// GetMemberResult represents the result of a GetMember operation. -// Call its Extract method to interpret it as a Member. -type GetMemberResult struct { - commonMemberResult -} - -// UpdateMemberResult represents the result of an UpdateMember operation. -// Call its Extract method to interpret it as a Member. -type UpdateMemberResult struct { - commonMemberResult -} - -// UpdateMembersResult represents the result of an UpdateMembers operation. -// Call its ExtractErr method to determine if the request succeeded or failed. -type UpdateMembersResult struct { - gophercloud.ErrResult -} - -// DeleteMemberResult represents the result of a DeleteMember operation. -// Call its ExtractErr method to determine if the request succeeded or failed. -type DeleteMemberResult struct { - gophercloud.ErrResult -} diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/pools/urls.go b/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/pools/urls.go deleted file mode 100644 index e7443c4f19..0000000000 --- a/vendor/github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/pools/urls.go +++ /dev/null @@ -1,25 +0,0 @@ -package pools - -import "github.com/gophercloud/gophercloud" - -const ( - rootPath = "lbaas" - resourcePath = "pools" - memberPath = "members" -) - -func rootURL(c *gophercloud.ServiceClient) string { - return c.ServiceURL(rootPath, resourcePath) -} - -func resourceURL(c *gophercloud.ServiceClient, id string) string { - return c.ServiceURL(rootPath, resourcePath, id) -} - -func memberRootURL(c *gophercloud.ServiceClient, poolId string) string { - return c.ServiceURL(rootPath, resourcePath, poolId, memberPath) -} - -func memberResourceURL(c *gophercloud.ServiceClient, poolID string, memberID string) string { - return c.ServiceURL(rootPath, resourcePath, poolID, memberPath, memberID) -} diff --git a/vendor/github.com/openshift/api/Makefile b/vendor/github.com/openshift/api/Makefile index df3697c8d7..0fb3c431a4 100644 --- a/vendor/github.com/openshift/api/Makefile +++ b/vendor/github.com/openshift/api/Makefile @@ -20,6 +20,7 @@ CONTROLLER_GEN_VERSION :=v0.2.5 # $3 - manifests # $4 - output $(call add-crd-gen,authorization,./authorization/v1,./authorization/v1,./authorization/v1) +$(call add-crd-gen,apiserver,./apiserver/v1,./apiserver/v1,./apiserver/v1) $(call add-crd-gen,config,./config/v1,./config/v1,./config/v1) $(call add-crd-gen,helm,./helm/v1beta1,./helm/v1beta1,./helm/v1beta1) $(call add-crd-gen,console,./console/v1,./console/v1,./console/v1) @@ -32,6 +33,7 @@ $(call add-crd-gen,quota,./quota/v1,./quota/v1,./quota/v1) $(call add-crd-gen,samples,./samples/v1,./samples/v1,./samples/v1) $(call add-crd-gen,security,./security/v1,./security/v1,./security/v1) $(call add-crd-gen,securityinternal,./securityinternal/v1,./securityinternal/v1,./securityinternal/v1) +$(call add-crd-gen,cloudnetwork,./cloudnetwork/v1,./cloudnetwork/v1,./cloudnetwork/v1) $(call add-crd-gen,network,./network/v1,./network/v1,./network/v1) $(call add-crd-gen,networkoperator,./networkoperator/v1,./networkoperator/v1,./networkoperator/v1) $(call add-crd-gen,operatorcontrolplane,./operatorcontrolplane/v1alpha1,./operatorcontrolplane/v1alpha1,./operatorcontrolplane/v1alpha1) diff --git a/vendor/github.com/openshift/api/apiserver/install.go b/vendor/github.com/openshift/api/apiserver/install.go new file mode 100644 index 0000000000..c0cf2ac29c --- /dev/null +++ b/vendor/github.com/openshift/api/apiserver/install.go @@ -0,0 +1,22 @@ +package apiserver + +import ( + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + + v1 "github.com/openshift/api/apiserver/v1" +) + +var ( + schemeBuilder = runtime.NewSchemeBuilder(v1.Install) + // Install is a function which adds every version of this group to a scheme + Install = schemeBuilder.AddToScheme +) + +func Resource(resource string) schema.GroupResource { + return schema.GroupResource{Group: "apiserver.openshift.io", Resource: resource} +} + +func Kind(kind string) schema.GroupKind { + return schema.GroupKind{Group: "apiserver.openshift.io", Kind: kind} +} diff --git a/vendor/github.com/openshift/api/apiserver/v1/apiserver.openshift.io_deprecatedapirequests.yaml b/vendor/github.com/openshift/api/apiserver/v1/apiserver.openshift.io_deprecatedapirequests.yaml new file mode 100644 index 0000000000..89beaaa9d5 --- /dev/null +++ b/vendor/github.com/openshift/api/apiserver/v1/apiserver.openshift.io_deprecatedapirequests.yaml @@ -0,0 +1,247 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + include.release.openshift.io/self-managed-high-availability: "true" + include.release.openshift.io/single-node-developer: "true" + name: deprecatedapirequests.apiserver.openshift.io +spec: + group: apiserver.openshift.io + names: + kind: DeprecatedAPIRequest + listKind: DeprecatedAPIRequestList + plural: deprecatedapirequests + singular: deprecatedapirequest + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + description: DeprecatedAPIRequest tracts requests made to a deprecated API. + The instance name should be of the form `resource.version.group`, matching + the deprecated resource. + type: object + required: + - spec + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: spec defines the characteristics of the resource. + type: object + properties: + removedRelease: + description: removedRelease is when the API will be removed. + type: string + maxLength: 64 + minLength: 3 + pattern: ^[0-9][0-9]*\.[0-9][0-9]*$ + status: + description: status contains the observed state of the resource. + type: object + properties: + conditions: + description: conditions contains details of the current status of + this API Resource. + type: array + items: + description: "Condition contains details for one aspect of the current + state of this API Resource. --- This struct is intended for direct + use as an array at the field path .status.conditions. For example, + type FooStatus struct{ // Represents the observations of a + foo's current state. // Known .status.conditions.type are: + \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type + \ // +patchStrategy=merge // +listType=map // +listMapKey=type + \ Conditions []metav1.Condition `json:\"conditions,omitempty\" + patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` + \n // other fields }" + type: object + required: + - lastTransitionTime + - message + - reason + - status + - type + properties: + lastTransitionTime: + description: lastTransitionTime is the last time the condition + transitioned from one status to another. This should be when + the underlying condition changed. If that is not known, then + using the time when the API field changed is acceptable. + type: string + format: date-time + message: + description: message is a human readable message indicating + details about the transition. This may be an empty string. + type: string + maxLength: 32768 + observedGeneration: + description: observedGeneration represents the .metadata.generation + that the condition was set based upon. For instance, if .metadata.generation + is currently 12, but the .status.conditions[x].observedGeneration + is 9, the condition is out of date with respect to the current + state of the instance. + type: integer + format: int64 + minimum: 0 + reason: + description: reason contains a programmatic identifier indicating + the reason for the condition's last transition. Producers + of specific condition types may define expected values and + meanings for this field, and whether the values are considered + a guaranteed API. The value should be a CamelCase string. + This field may not be empty. + type: string + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + status: + description: status of the condition, one of True, False, Unknown. + type: string + enum: + - "True" + - "False" + - Unknown + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + --- Many .condition.type values are consistent across resources + like Available, but because arbitrary conditions can be useful + (see .node.status.conditions), the ability to deconflict is + important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + type: string + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + requestsLast24h: + description: requestsLast24h contains request history for the last + 24 hours, indexed by the hour, so 12:00AM-12:59 is in index 0, 6am-6:59am + is index 6, etc. The index of the current hour is updated live and + then duplicated into the requestsLastHour field. + type: array + items: + description: RequestLog logs request for various nodes. + type: object + properties: + nodes: + description: nodes contains logs of requests per node. + type: array + items: + description: NodeRequestLog contains logs of requests to a + certain node. + type: object + properties: + lastUpdate: + description: lastUpdate should *always* being within the + hour this is for. This is a time indicating the last + moment the server is recording for, not the actual update + time. + type: string + format: date-time + nodeName: + description: nodeName where the request are being handled. + type: string + users: + description: users contains request details by top 10 + users. Note that because in the case of an apiserver + restart the list of top 10 users is determined on a + best-effort basis, the list might be imprecise. + type: array + items: + description: RequestUser contains logs of a user's requests. + type: object + properties: + count: + description: count of requests. + type: integer + requests: + description: requests details by verb. + type: array + items: + description: RequestCount counts requests by API + request verb. + type: object + properties: + count: + description: count of requests for verb. + type: integer + verb: + description: verb of API request (get, list, + create, etc...) + type: string + username: + description: userName that made the request. + type: string + requestsLastHour: + description: requestsLastHour contains request history for the current + hour. This is porcelain to make the API easier to read by humans + seeing if they addressed a problem. This field is reset on the hour. + type: object + properties: + nodes: + description: nodes contains logs of requests per node. + type: array + items: + description: NodeRequestLog contains logs of requests to a certain + node. + type: object + properties: + lastUpdate: + description: lastUpdate should *always* being within the + hour this is for. This is a time indicating the last + moment the server is recording for, not the actual update + time. + type: string + format: date-time + nodeName: + description: nodeName where the request are being handled. + type: string + users: + description: users contains request details by top 10 users. + Note that because in the case of an apiserver restart + the list of top 10 users is determined on a best-effort + basis, the list might be imprecise. + type: array + items: + description: RequestUser contains logs of a user's requests. + type: object + properties: + count: + description: count of requests. + type: integer + requests: + description: requests details by verb. + type: array + items: + description: RequestCount counts requests by API + request verb. + type: object + properties: + count: + description: count of requests for verb. + type: integer + verb: + description: verb of API request (get, list, + create, etc...) + type: string + username: + description: userName that made the request. + type: string + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/vendor/github.com/openshift/api/apiserver/v1/doc.go b/vendor/github.com/openshift/api/apiserver/v1/doc.go new file mode 100644 index 0000000000..cc6a8aa617 --- /dev/null +++ b/vendor/github.com/openshift/api/apiserver/v1/doc.go @@ -0,0 +1,8 @@ +// +k8s:deepcopy-gen=package,register +// +k8s:defaulter-gen=TypeMeta +// +k8s:openapi-gen=true + +// +kubebuilder:validation:Optional +// +groupName=apiserver.openshift.io +// Package v1 is the v1 version of the API. +package v1 diff --git a/vendor/github.com/openshift/api/apiserver/v1/register.go b/vendor/github.com/openshift/api/apiserver/v1/register.go new file mode 100644 index 0000000000..82d3584c41 --- /dev/null +++ b/vendor/github.com/openshift/api/apiserver/v1/register.go @@ -0,0 +1,38 @@ +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +var ( + GroupName = "apiserver.openshift.io" + GroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"} + schemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) + // Install is a function which adds this version to a scheme + Install = schemeBuilder.AddToScheme + + // SchemeGroupVersion generated code relies on this name + // Deprecated + SchemeGroupVersion = GroupVersion + // AddToScheme exists solely to keep the old generators creating valid code + // DEPRECATED + AddToScheme = schemeBuilder.AddToScheme +) + +// Resource generated code relies on this being here, but it logically belongs to the group +// DEPRECATED +func Resource(resource string) schema.GroupResource { + return schema.GroupResource{Group: GroupName, Resource: resource} +} + +// Adds the list of known types to api.Scheme. +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(GroupVersion, + &DeprecatedAPIRequest{}, + &DeprecatedAPIRequestList{}, + ) + metav1.AddToGroupVersion(scheme, GroupVersion) + return nil +} diff --git a/vendor/github.com/openshift/api/apiserver/v1/types_deprecatedapirequest.go b/vendor/github.com/openshift/api/apiserver/v1/types_deprecatedapirequest.go new file mode 100644 index 0000000000..9caf3f6ab4 --- /dev/null +++ b/vendor/github.com/openshift/api/apiserver/v1/types_deprecatedapirequest.go @@ -0,0 +1,114 @@ +// Package v1 is an api version in the apiserver.openshift.io group +package v1 + +import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +kubebuilder:resource:scope="Cluster" +// +kubebuilder:subresource:status +// +genclient:nonNamespaced + +// DeprecatedAPIRequest tracts requests made to a deprecated API. The instance name should +// be of the form `resource.version.group`, matching the deprecated resource. +type DeprecatedAPIRequest struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // spec defines the characteristics of the resource. + // +kubebuilder:validation:Required + // +required + Spec DeprecatedAPIRequestSpec `json:"spec"` + + // status contains the observed state of the resource. + Status DeprecatedAPIRequestStatus `json:"status,omitempty"` +} + +type DeprecatedAPIRequestSpec struct { + // removedRelease is when the API will be removed. + // +kubebuilder:validation:Pattern=^[0-9][0-9]*\.[0-9][0-9]*$ + // +kubebuilder:validation:MinLength=3 + // +kubebuilder:validation:MaxLength=64 + // +required + RemovedRelease string `json:"removedRelease"` +} + +// +k8s:deepcopy-gen=true +type DeprecatedAPIRequestStatus struct { + + // conditions contains details of the current status of this API Resource. + // +patchMergeKey=type + // +patchStrategy=merge + Conditions []metav1.Condition `json:"conditions"` + + // requestsLastHour contains request history for the current hour. This is porcelain to make the API + // easier to read by humans seeing if they addressed a problem. This field is reset on the hour. + RequestsLastHour RequestLog `json:"requestsLastHour"` + + // requestsLast24h contains request history for the last 24 hours, indexed by the hour, so + // 12:00AM-12:59 is in index 0, 6am-6:59am is index 6, etc. The index of the current hour + // is updated live and then duplicated into the requestsLastHour field. + RequestsLast24h []RequestLog `json:"requestsLast24h"` +} + +// RequestLog logs request for various nodes. +type RequestLog struct { + + // nodes contains logs of requests per node. + Nodes []NodeRequestLog `json:"nodes"` +} + +// NodeRequestLog contains logs of requests to a certain node. +type NodeRequestLog struct { + + // nodeName where the request are being handled. + NodeName string `json:"nodeName"` + + // lastUpdate should *always* being within the hour this is for. This is a time indicating + // the last moment the server is recording for, not the actual update time. + LastUpdate metav1.Time `json:"lastUpdate"` + + // users contains request details by top 10 users. Note that because in the case of an apiserver + // restart the list of top 10 users is determined on a best-effort basis, the list might be imprecise. + Users []RequestUser `json:"users"` +} + +type DeprecatedAPIRequestConditionType string + +const ( + // UsedInPastDay condition indicates a request has been made against the deprecated api in the last 24h. + UsedInPastDay DeprecatedAPIRequestConditionType = "UsedInPastDay" +) + +// RequestUser contains logs of a user's requests. +type RequestUser struct { + + // userName that made the request. + UserName string `json:"username"` + + // count of requests. + Count int `json:"count"` + + // requests details by verb. + Requests []RequestCount `json:"requests"` +} + +// RequestCount counts requests by API request verb. +type RequestCount struct { + + // verb of API request (get, list, create, etc...) + Verb string `json:"verb"` + + // count of requests for verb. + Count int `json:"count"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// DeprecatedAPIRequestList is a list of DeprecatedAPIRequest resources. +type DeprecatedAPIRequestList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata"` + + Items []DeprecatedAPIRequest `json:"items"` +} diff --git a/vendor/github.com/openshift/api/apiserver/v1/zz_generated.deepcopy.go b/vendor/github.com/openshift/api/apiserver/v1/zz_generated.deepcopy.go new file mode 100644 index 0000000000..3fb611c1bb --- /dev/null +++ b/vendor/github.com/openshift/api/apiserver/v1/zz_generated.deepcopy.go @@ -0,0 +1,202 @@ +// +build !ignore_autogenerated + +// Code generated by deepcopy-gen. DO NOT EDIT. + +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DeprecatedAPIRequest) DeepCopyInto(out *DeprecatedAPIRequest) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeprecatedAPIRequest. +func (in *DeprecatedAPIRequest) DeepCopy() *DeprecatedAPIRequest { + if in == nil { + return nil + } + out := new(DeprecatedAPIRequest) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DeprecatedAPIRequest) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DeprecatedAPIRequestList) DeepCopyInto(out *DeprecatedAPIRequestList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]DeprecatedAPIRequest, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeprecatedAPIRequestList. +func (in *DeprecatedAPIRequestList) DeepCopy() *DeprecatedAPIRequestList { + if in == nil { + return nil + } + out := new(DeprecatedAPIRequestList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DeprecatedAPIRequestList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DeprecatedAPIRequestSpec) DeepCopyInto(out *DeprecatedAPIRequestSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeprecatedAPIRequestSpec. +func (in *DeprecatedAPIRequestSpec) DeepCopy() *DeprecatedAPIRequestSpec { + if in == nil { + return nil + } + out := new(DeprecatedAPIRequestSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DeprecatedAPIRequestStatus) DeepCopyInto(out *DeprecatedAPIRequestStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]metav1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + in.RequestsLastHour.DeepCopyInto(&out.RequestsLastHour) + if in.RequestsLast24h != nil { + in, out := &in.RequestsLast24h, &out.RequestsLast24h + *out = make([]RequestLog, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeprecatedAPIRequestStatus. +func (in *DeprecatedAPIRequestStatus) DeepCopy() *DeprecatedAPIRequestStatus { + if in == nil { + return nil + } + out := new(DeprecatedAPIRequestStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeRequestLog) DeepCopyInto(out *NodeRequestLog) { + *out = *in + in.LastUpdate.DeepCopyInto(&out.LastUpdate) + if in.Users != nil { + in, out := &in.Users, &out.Users + *out = make([]RequestUser, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeRequestLog. +func (in *NodeRequestLog) DeepCopy() *NodeRequestLog { + if in == nil { + return nil + } + out := new(NodeRequestLog) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RequestCount) DeepCopyInto(out *RequestCount) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RequestCount. +func (in *RequestCount) DeepCopy() *RequestCount { + if in == nil { + return nil + } + out := new(RequestCount) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RequestLog) DeepCopyInto(out *RequestLog) { + *out = *in + if in.Nodes != nil { + in, out := &in.Nodes, &out.Nodes + *out = make([]NodeRequestLog, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RequestLog. +func (in *RequestLog) DeepCopy() *RequestLog { + if in == nil { + return nil + } + out := new(RequestLog) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RequestUser) DeepCopyInto(out *RequestUser) { + *out = *in + if in.Requests != nil { + in, out := &in.Requests, &out.Requests + *out = make([]RequestCount, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RequestUser. +func (in *RequestUser) DeepCopy() *RequestUser { + if in == nil { + return nil + } + out := new(RequestUser) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/github.com/openshift/api/apiserver/v1/zz_generated.swagger_doc_generated.go b/vendor/github.com/openshift/api/apiserver/v1/zz_generated.swagger_doc_generated.go new file mode 100644 index 0000000000..66f3dc582a --- /dev/null +++ b/vendor/github.com/openshift/api/apiserver/v1/zz_generated.swagger_doc_generated.go @@ -0,0 +1,91 @@ +package v1 + +// This file contains a collection of methods that can be used from go-restful to +// generate Swagger API documentation for its models. Please read this PR for more +// information on the implementation: https://github.com/emicklei/go-restful/pull/215 +// +// TODOs are ignored from the parser (e.g. TODO(andronat):... || TODO:...) if and only if +// they are on one line! For multiple line or blocks that you want to ignore use ---. +// Any context after a --- is ignored. +// +// Those methods can be generated by using hack/update-swagger-docs.sh + +// AUTO-GENERATED FUNCTIONS START HERE +var map_DeprecatedAPIRequest = map[string]string{ + "": "DeprecatedAPIRequest tracts requests made to a deprecated API. The instance name should be of the form `resource.version.group`, matching the deprecated resource.", + "spec": "spec defines the characteristics of the resource.", + "status": "status contains the observed state of the resource.", +} + +func (DeprecatedAPIRequest) SwaggerDoc() map[string]string { + return map_DeprecatedAPIRequest +} + +var map_DeprecatedAPIRequestList = map[string]string{ + "": "DeprecatedAPIRequestList is a list of DeprecatedAPIRequest resources.", +} + +func (DeprecatedAPIRequestList) SwaggerDoc() map[string]string { + return map_DeprecatedAPIRequestList +} + +var map_DeprecatedAPIRequestSpec = map[string]string{ + "removedRelease": "removedRelease is when the API will be removed.", +} + +func (DeprecatedAPIRequestSpec) SwaggerDoc() map[string]string { + return map_DeprecatedAPIRequestSpec +} + +var map_DeprecatedAPIRequestStatus = map[string]string{ + "conditions": "conditions contains details of the current status of this API Resource.", + "requestsLastHour": "requestsLastHour contains request history for the current hour. This is porcelain to make the API easier to read by humans seeing if they addressed a problem. This field is reset on the hour.", + "requestsLast24h": "requestsLast24h contains request history for the last 24 hours, indexed by the hour, so 12:00AM-12:59 is in index 0, 6am-6:59am is index 6, etc. The index of the current hour is updated live and then duplicated into the requestsLastHour field.", +} + +func (DeprecatedAPIRequestStatus) SwaggerDoc() map[string]string { + return map_DeprecatedAPIRequestStatus +} + +var map_NodeRequestLog = map[string]string{ + "": "NodeRequestLog contains logs of requests to a certain node.", + "nodeName": "nodeName where the request are being handled.", + "lastUpdate": "lastUpdate should *always* being within the hour this is for. This is a time indicating the last moment the server is recording for, not the actual update time.", + "users": "users contains request details by top 10 users. Note that because in the case of an apiserver restart the list of top 10 users is determined on a best-effort basis, the list might be imprecise.", +} + +func (NodeRequestLog) SwaggerDoc() map[string]string { + return map_NodeRequestLog +} + +var map_RequestCount = map[string]string{ + "": "RequestCount counts requests by API request verb.", + "verb": "verb of API request (get, list, create, etc...)", + "count": "count of requests for verb.", +} + +func (RequestCount) SwaggerDoc() map[string]string { + return map_RequestCount +} + +var map_RequestLog = map[string]string{ + "": "RequestLog logs request for various nodes.", + "nodes": "nodes contains logs of requests per node.", +} + +func (RequestLog) SwaggerDoc() map[string]string { + return map_RequestLog +} + +var map_RequestUser = map[string]string{ + "": "RequestUser contains logs of a user's requests.", + "username": "userName that made the request.", + "count": "count of requests.", + "requests": "requests details by verb.", +} + +func (RequestUser) SwaggerDoc() map[string]string { + return map_RequestUser +} + +// AUTO-GENERATED FUNCTIONS END HERE diff --git a/vendor/github.com/openshift/api/cloudnetwork/OWNERS b/vendor/github.com/openshift/api/cloudnetwork/OWNERS new file mode 100644 index 0000000000..0bc20628a2 --- /dev/null +++ b/vendor/github.com/openshift/api/cloudnetwork/OWNERS @@ -0,0 +1,6 @@ +reviewers: + - danwinship + - dcbw + - knobunc + - squeed + - abhat diff --git a/vendor/github.com/openshift/api/cloudnetwork/install.go b/vendor/github.com/openshift/api/cloudnetwork/install.go new file mode 100644 index 0000000000..f839ebf00b --- /dev/null +++ b/vendor/github.com/openshift/api/cloudnetwork/install.go @@ -0,0 +1,26 @@ +package cloudnetwork + +import ( + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + + cloudnetworkv1 "github.com/openshift/api/cloudnetwork/v1" +) + +const ( + GroupName = "cloud.network.openshift.io" +) + +var ( + schemeBuilder = runtime.NewSchemeBuilder(cloudnetworkv1.Install) + // Install is a function which adds every version of this group to a scheme + Install = schemeBuilder.AddToScheme +) + +func Resource(resource string) schema.GroupResource { + return schema.GroupResource{Group: GroupName, Resource: resource} +} + +func Kind(kind string) schema.GroupKind { + return schema.GroupKind{Group: GroupName, Kind: kind} +} diff --git a/vendor/github.com/openshift/api/cloudnetwork/v1/001-cloudprivateipconfig.crd.yaml b/vendor/github.com/openshift/api/cloudnetwork/v1/001-cloudprivateipconfig.crd.yaml new file mode 100644 index 0000000000..91c71ad51e --- /dev/null +++ b/vendor/github.com/openshift/api/cloudnetwork/v1/001-cloudprivateipconfig.crd.yaml @@ -0,0 +1,148 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: cloudprivateipconfig.cloud.network.openshift.io +spec: + group: cloud.network.openshift.io + names: + kind: CloudPrivateIPConfig + listKind: CloudPrivateIPConfigList + plural: cloudprivateipconfig + singular: cloudprivateipconfig + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + description: 'CloudPrivateIPConfig performs an assignment of a private IP + address to the primary NIC associated with cloud VMs. This is done by specifying + the IP and Kubernetes node which the IP should be assigned to. This CRD + is intended to be used by the network plugin which manages the cluster network. + The spec side represents the desired state requested by the network plugin, + and the status side represents the current state that this CRD''s controller + has executed. No users will have permission to modify it, and if a cluster-admin + decides to edit it for some reason, their changes will be overwritten the + next time the network plugin reconciles the object. Note: the CR''s name + must specify the requested private IP address (can be IPv4 or IPv6).' + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + properties: + name: + anyOf: + - format: ipv4 + - format: ipv6 + type: string + type: object + spec: + description: spec is the definition of the desired private IP request. + properties: + node: + description: 'node is the node name, as specified by the Kubernetes + field: node.metadata.name' + type: string + type: object + status: + description: status is the observed status of the desired private IP request. + Read-only. + properties: + conditions: + description: condition is the assignment condition of the private + IP and its status + items: + description: "Condition contains details for one aspect of the current + state of this API Resource. --- This struct is intended for direct + use as an array at the field path .status.conditions. For example, + type FooStatus struct{ // Represents the observations of a + foo's current state. // Known .status.conditions.type are: + \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type + \ // +patchStrategy=merge // +listType=map // +listMapKey=type + \ Conditions []metav1.Condition `json:\"conditions,omitempty\" + patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` + \n // other fields }" + properties: + lastTransitionTime: + description: lastTransitionTime is the last time the condition + transitioned from one status to another. This should be when + the underlying condition changed. If that is not known, then + using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: message is a human readable message indicating + details about the transition. This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: observedGeneration represents the .metadata.generation + that the condition was set based upon. For instance, if .metadata.generation + is currently 12, but the .status.conditions[x].observedGeneration + is 9, the condition is out of date with respect to the current + state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: reason contains a programmatic identifier indicating + the reason for the condition's last transition. Producers + of specific condition types may define expected values and + meanings for this field, and whether the values are considered + a guaranteed API. The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + --- Many .condition.type values are consistent across resources + like Available, but because arbitrary conditions can be useful + (see .node.status.conditions), the ability to deconflict is + important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + type: array + node: + description: 'node is the node name, as specified by the Kubernetes + field: node.metadata.name' + type: string + required: + - conditions + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/vendor/github.com/openshift/api/cloudnetwork/v1/001-cloudprivateipconfig.crd.yaml-patch b/vendor/github.com/openshift/api/cloudnetwork/v1/001-cloudprivateipconfig.crd.yaml-patch new file mode 100644 index 0000000000..1239c05439 --- /dev/null +++ b/vendor/github.com/openshift/api/cloudnetwork/v1/001-cloudprivateipconfig.crd.yaml-patch @@ -0,0 +1,10 @@ +- op: add + path: /spec/versions/name=v1/schema/openAPIV3Schema/properties/metadata + value: + type: object + properties: + name: + type: string + anyOf: + - format: ipv4 + - format: ipv6 diff --git a/vendor/github.com/openshift/api/cloudnetwork/v1/doc.go b/vendor/github.com/openshift/api/cloudnetwork/v1/doc.go new file mode 100644 index 0000000000..1d495ee24c --- /dev/null +++ b/vendor/github.com/openshift/api/cloudnetwork/v1/doc.go @@ -0,0 +1,5 @@ +// Package v1 contains API Schema definitions for the cloud network v1 API group +// +k8s:deepcopy-gen=package,register +// +groupName=cloud.network.openshift.io +// +kubebuilder:validation:Optional +package v1 diff --git a/vendor/github.com/openshift/api/cloudnetwork/v1/generated.pb.go b/vendor/github.com/openshift/api/cloudnetwork/v1/generated.pb.go new file mode 100644 index 0000000000..d1938bb783 --- /dev/null +++ b/vendor/github.com/openshift/api/cloudnetwork/v1/generated.pb.go @@ -0,0 +1,1045 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: github.com/openshift/api/cloudnetwork/v1/generated.proto + +package v1 + +import ( + fmt "fmt" + + io "io" + + proto "github.com/gogo/protobuf/proto" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + math "math" + math_bits "math/bits" + reflect "reflect" + strings "strings" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +func (m *CloudPrivateIPConfig) Reset() { *m = CloudPrivateIPConfig{} } +func (*CloudPrivateIPConfig) ProtoMessage() {} +func (*CloudPrivateIPConfig) Descriptor() ([]byte, []int) { + return fileDescriptor_454253a7ab01c6d0, []int{0} +} +func (m *CloudPrivateIPConfig) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CloudPrivateIPConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *CloudPrivateIPConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_CloudPrivateIPConfig.Merge(m, src) +} +func (m *CloudPrivateIPConfig) XXX_Size() int { + return m.Size() +} +func (m *CloudPrivateIPConfig) XXX_DiscardUnknown() { + xxx_messageInfo_CloudPrivateIPConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_CloudPrivateIPConfig proto.InternalMessageInfo + +func (m *CloudPrivateIPConfigList) Reset() { *m = CloudPrivateIPConfigList{} } +func (*CloudPrivateIPConfigList) ProtoMessage() {} +func (*CloudPrivateIPConfigList) Descriptor() ([]byte, []int) { + return fileDescriptor_454253a7ab01c6d0, []int{1} +} +func (m *CloudPrivateIPConfigList) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CloudPrivateIPConfigList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *CloudPrivateIPConfigList) XXX_Merge(src proto.Message) { + xxx_messageInfo_CloudPrivateIPConfigList.Merge(m, src) +} +func (m *CloudPrivateIPConfigList) XXX_Size() int { + return m.Size() +} +func (m *CloudPrivateIPConfigList) XXX_DiscardUnknown() { + xxx_messageInfo_CloudPrivateIPConfigList.DiscardUnknown(m) +} + +var xxx_messageInfo_CloudPrivateIPConfigList proto.InternalMessageInfo + +func (m *CloudPrivateIPConfigSpec) Reset() { *m = CloudPrivateIPConfigSpec{} } +func (*CloudPrivateIPConfigSpec) ProtoMessage() {} +func (*CloudPrivateIPConfigSpec) Descriptor() ([]byte, []int) { + return fileDescriptor_454253a7ab01c6d0, []int{2} +} +func (m *CloudPrivateIPConfigSpec) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CloudPrivateIPConfigSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *CloudPrivateIPConfigSpec) XXX_Merge(src proto.Message) { + xxx_messageInfo_CloudPrivateIPConfigSpec.Merge(m, src) +} +func (m *CloudPrivateIPConfigSpec) XXX_Size() int { + return m.Size() +} +func (m *CloudPrivateIPConfigSpec) XXX_DiscardUnknown() { + xxx_messageInfo_CloudPrivateIPConfigSpec.DiscardUnknown(m) +} + +var xxx_messageInfo_CloudPrivateIPConfigSpec proto.InternalMessageInfo + +func (m *CloudPrivateIPConfigStatus) Reset() { *m = CloudPrivateIPConfigStatus{} } +func (*CloudPrivateIPConfigStatus) ProtoMessage() {} +func (*CloudPrivateIPConfigStatus) Descriptor() ([]byte, []int) { + return fileDescriptor_454253a7ab01c6d0, []int{3} +} +func (m *CloudPrivateIPConfigStatus) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CloudPrivateIPConfigStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *CloudPrivateIPConfigStatus) XXX_Merge(src proto.Message) { + xxx_messageInfo_CloudPrivateIPConfigStatus.Merge(m, src) +} +func (m *CloudPrivateIPConfigStatus) XXX_Size() int { + return m.Size() +} +func (m *CloudPrivateIPConfigStatus) XXX_DiscardUnknown() { + xxx_messageInfo_CloudPrivateIPConfigStatus.DiscardUnknown(m) +} + +var xxx_messageInfo_CloudPrivateIPConfigStatus proto.InternalMessageInfo + +func init() { + proto.RegisterType((*CloudPrivateIPConfig)(nil), "github.com.openshift.api.cloudnetwork.v1.CloudPrivateIPConfig") + proto.RegisterType((*CloudPrivateIPConfigList)(nil), "github.com.openshift.api.cloudnetwork.v1.CloudPrivateIPConfigList") + proto.RegisterType((*CloudPrivateIPConfigSpec)(nil), "github.com.openshift.api.cloudnetwork.v1.CloudPrivateIPConfigSpec") + proto.RegisterType((*CloudPrivateIPConfigStatus)(nil), "github.com.openshift.api.cloudnetwork.v1.CloudPrivateIPConfigStatus") +} + +func init() { + proto.RegisterFile("github.com/openshift/api/cloudnetwork/v1/generated.proto", fileDescriptor_454253a7ab01c6d0) +} + +var fileDescriptor_454253a7ab01c6d0 = []byte{ + // 482 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x92, 0x3f, 0x6f, 0xd3, 0x40, + 0x18, 0xc6, 0x7d, 0x69, 0x5a, 0x95, 0x2b, 0x20, 0x64, 0x31, 0x58, 0x19, 0xae, 0x51, 0xa6, 0x2c, + 0xdc, 0x91, 0x0a, 0xa1, 0x0e, 0x88, 0xc1, 0x61, 0xa9, 0xc4, 0x9f, 0xca, 0x6c, 0x88, 0x81, 0xcb, + 0xf9, 0xe2, 0x1c, 0xa9, 0xef, 0x2c, 0xdf, 0xd9, 0x88, 0x8d, 0x8f, 0xc0, 0x77, 0xe0, 0xcb, 0x64, + 0x60, 0xe8, 0xd8, 0x85, 0x8a, 0x98, 0x2f, 0x82, 0xee, 0xe2, 0x24, 0x56, 0x9b, 0xaa, 0x91, 0xb2, + 0xf9, 0x7d, 0xed, 0xe7, 0xf9, 0xbd, 0xef, 0xf3, 0x1a, 0x9e, 0x26, 0xc2, 0x4c, 0x8a, 0x11, 0x66, + 0x2a, 0x25, 0x2a, 0xe3, 0x52, 0x4f, 0xc4, 0xd8, 0x10, 0x9a, 0x09, 0xc2, 0x2e, 0x54, 0x11, 0x4b, + 0x6e, 0xbe, 0xa9, 0x7c, 0x4a, 0xca, 0x01, 0x49, 0xb8, 0xe4, 0x39, 0x35, 0x3c, 0xc6, 0x59, 0xae, + 0x8c, 0xf2, 0xfb, 0x6b, 0x25, 0x5e, 0x29, 0x31, 0xcd, 0x04, 0x6e, 0x2a, 0x71, 0x39, 0xe8, 0x3c, + 0x6b, 0x30, 0x12, 0x95, 0x28, 0xe2, 0x0c, 0x46, 0xc5, 0xd8, 0x55, 0xae, 0x70, 0x4f, 0x0b, 0xe3, + 0xce, 0x8b, 0xe9, 0xa9, 0xc6, 0x42, 0xd9, 0x21, 0x52, 0xca, 0x26, 0x42, 0xf2, 0xfc, 0x3b, 0xc9, + 0xa6, 0x89, 0x6d, 0x68, 0x92, 0x72, 0x43, 0x37, 0x8c, 0xd3, 0x21, 0x77, 0xa9, 0xf2, 0x42, 0x1a, + 0x91, 0xf2, 0x5b, 0x82, 0x97, 0xf7, 0x09, 0x34, 0x9b, 0xf0, 0x94, 0xde, 0xd4, 0xf5, 0x7e, 0xb7, + 0xe0, 0xd3, 0xa1, 0xdd, 0xf0, 0x3c, 0x17, 0x25, 0x35, 0xfc, 0xec, 0x7c, 0xa8, 0xe4, 0x58, 0x24, + 0xfe, 0x17, 0x78, 0x68, 0x87, 0x8b, 0xa9, 0xa1, 0x01, 0xe8, 0x82, 0xfe, 0xd1, 0xc9, 0x73, 0xbc, + 0x60, 0xe0, 0x26, 0x03, 0x67, 0xd3, 0xc4, 0x36, 0x34, 0xb6, 0x5f, 0xe3, 0x72, 0x80, 0x3f, 0x8c, + 0xbe, 0x72, 0x66, 0xde, 0x71, 0x43, 0x43, 0x7f, 0x76, 0x7d, 0xec, 0x55, 0xd7, 0xc7, 0x70, 0xdd, + 0x8b, 0x56, 0xae, 0x7e, 0x0c, 0xdb, 0x3a, 0xe3, 0x2c, 0x68, 0x39, 0xf7, 0x10, 0x6f, 0x7b, 0x01, + 0xbc, 0x69, 0xde, 0x8f, 0x19, 0x67, 0xe1, 0xc3, 0x9a, 0xd7, 0xb6, 0x55, 0xe4, 0xdc, 0xfd, 0x0b, + 0x78, 0xa0, 0x0d, 0x35, 0x85, 0x0e, 0xf6, 0x1c, 0xe7, 0xcd, 0x8e, 0x1c, 0xe7, 0x15, 0x3e, 0xae, + 0x49, 0x07, 0x8b, 0x3a, 0xaa, 0x19, 0xbd, 0x3f, 0x00, 0x06, 0x9b, 0x64, 0x6f, 0x85, 0x36, 0xfe, + 0xe7, 0x5b, 0x91, 0xe2, 0xed, 0x22, 0xb5, 0x6a, 0x17, 0xe8, 0x93, 0x1a, 0x7b, 0xb8, 0xec, 0x34, + 0xe2, 0x64, 0x70, 0x5f, 0x18, 0x9e, 0xea, 0xa0, 0xd5, 0xdd, 0xeb, 0x1f, 0x9d, 0xbc, 0xde, 0x6d, + 0xcf, 0xf0, 0x51, 0x8d, 0xda, 0x3f, 0xb3, 0xa6, 0xd1, 0xc2, 0xbb, 0xf7, 0x6a, 0xf3, 0x7a, 0x36, + 0x6f, 0xbf, 0x0b, 0xdb, 0x52, 0xc5, 0xdc, 0xad, 0xf6, 0x60, 0x7d, 0x8b, 0xf7, 0x2a, 0xe6, 0x91, + 0x7b, 0xd3, 0xfb, 0x05, 0x60, 0xe7, 0xee, 0x50, 0xef, 0x37, 0xf0, 0x19, 0x84, 0x4c, 0xc9, 0x58, + 0x18, 0xa1, 0xe4, 0x72, 0x51, 0xb2, 0x5d, 0x86, 0xc3, 0xa5, 0x6e, 0xfd, 0x57, 0xae, 0x5a, 0x3a, + 0x6a, 0xd8, 0x86, 0xfd, 0xd9, 0x1c, 0x79, 0x97, 0x73, 0xe4, 0x5d, 0xcd, 0x91, 0xf7, 0xa3, 0x42, + 0x60, 0x56, 0x21, 0x70, 0x59, 0x21, 0x70, 0x55, 0x21, 0xf0, 0xb7, 0x42, 0xe0, 0xe7, 0x3f, 0xe4, + 0x7d, 0x6a, 0x95, 0x83, 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, 0xa5, 0xd1, 0x85, 0x90, 0x6f, 0x04, + 0x00, 0x00, +} + +func (m *CloudPrivateIPConfig) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CloudPrivateIPConfig) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CloudPrivateIPConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *CloudPrivateIPConfigList) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CloudPrivateIPConfigList) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CloudPrivateIPConfigList) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Items) > 0 { + for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *CloudPrivateIPConfigSpec) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CloudPrivateIPConfigSpec) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CloudPrivateIPConfigSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Node) + copy(dAtA[i:], m.Node) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Node))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *CloudPrivateIPConfigStatus) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CloudPrivateIPConfigStatus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CloudPrivateIPConfigStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Conditions) > 0 { + for iNdEx := len(m.Conditions) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Conditions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + i -= len(m.Node) + copy(dAtA[i:], m.Node) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Node))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int { + offset -= sovGenerated(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *CloudPrivateIPConfig) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ObjectMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Spec.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Status.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *CloudPrivateIPConfigList) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ListMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Items) > 0 { + for _, e := range m.Items { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *CloudPrivateIPConfigSpec) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Node) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *CloudPrivateIPConfigStatus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Node) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Conditions) > 0 { + for _, e := range m.Conditions { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func sovGenerated(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenerated(x uint64) (n int) { + return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *CloudPrivateIPConfig) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&CloudPrivateIPConfig{`, + `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, + `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "CloudPrivateIPConfigSpec", "CloudPrivateIPConfigSpec", 1), `&`, ``, 1) + `,`, + `Status:` + strings.Replace(strings.Replace(this.Status.String(), "CloudPrivateIPConfigStatus", "CloudPrivateIPConfigStatus", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *CloudPrivateIPConfigList) String() string { + if this == nil { + return "nil" + } + repeatedStringForItems := "[]CloudPrivateIPConfig{" + for _, f := range this.Items { + repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "CloudPrivateIPConfig", "CloudPrivateIPConfig", 1), `&`, ``, 1) + "," + } + repeatedStringForItems += "}" + s := strings.Join([]string{`&CloudPrivateIPConfigList{`, + `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`, + `Items:` + repeatedStringForItems + `,`, + `}`, + }, "") + return s +} +func (this *CloudPrivateIPConfigSpec) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&CloudPrivateIPConfigSpec{`, + `Node:` + fmt.Sprintf("%v", this.Node) + `,`, + `}`, + }, "") + return s +} +func (this *CloudPrivateIPConfigStatus) String() string { + if this == nil { + return "nil" + } + repeatedStringForConditions := "[]Condition{" + for _, f := range this.Conditions { + repeatedStringForConditions += fmt.Sprintf("%v", f) + "," + } + repeatedStringForConditions += "}" + s := strings.Join([]string{`&CloudPrivateIPConfigStatus{`, + `Node:` + fmt.Sprintf("%v", this.Node) + `,`, + `Conditions:` + repeatedStringForConditions + `,`, + `}`, + }, "") + return s +} +func valueToStringGenerated(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *CloudPrivateIPConfig) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CloudPrivateIPConfig: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CloudPrivateIPConfig: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CloudPrivateIPConfigList) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CloudPrivateIPConfigList: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CloudPrivateIPConfigList: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Items = append(m.Items, CloudPrivateIPConfig{}) + if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CloudPrivateIPConfigSpec) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CloudPrivateIPConfigSpec: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CloudPrivateIPConfigSpec: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Node", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Node = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CloudPrivateIPConfigStatus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CloudPrivateIPConfigStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CloudPrivateIPConfigStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Node", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Node = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Conditions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Conditions = append(m.Conditions, v1.Condition{}) + if err := m.Conditions[len(m.Conditions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenerated(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenerated + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenerated + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenerated + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGenerated + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenerated + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenerated + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenerated = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenerated = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenerated = fmt.Errorf("proto: unexpected end of group") +) diff --git a/vendor/github.com/openshift/api/cloudnetwork/v1/generated.proto b/vendor/github.com/openshift/api/cloudnetwork/v1/generated.proto new file mode 100644 index 0000000000..18bba8a9fe --- /dev/null +++ b/vendor/github.com/openshift/api/cloudnetwork/v1/generated.proto @@ -0,0 +1,78 @@ + +// This file was autogenerated by go-to-protobuf. Do not edit it manually! + +syntax = "proto2"; + +package github.com.openshift.api.cloudnetwork.v1; + +import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; +import "k8s.io/apimachinery/pkg/runtime/generated.proto"; +import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; + +// Package-wide variables from generator "generated". +option go_package = "v1"; + +// CloudPrivateIPConfig performs an assignment of a private IP address to the +// primary NIC associated with cloud VMs. This is done by specifying the IP and +// Kubernetes node which the IP should be assigned to. This CRD is intended to +// be used by the network plugin which manages the cluster network. The spec +// side represents the desired state requested by the network plugin, and the +// status side represents the current state that this CRD's controller has +// executed. No users will have permission to modify it, and if a cluster-admin +// decides to edit it for some reason, their changes will be overwritten the +// next time the network plugin reconciles the object. Note: the CR's name +// must specify the requested private IP address (can be IPv4 or IPv6). +// +genclient +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:resource:path=cloudprivateipconfig,scope=Cluster +message CloudPrivateIPConfig { + optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + + // spec is the definition of the desired private IP request. + // +kubebuilder:validation:Required + // +required + optional CloudPrivateIPConfigSpec spec = 2; + + // status is the observed status of the desired private IP request. Read-only. + // +kubebuilder:validation:Optional + // +optional + optional CloudPrivateIPConfigStatus status = 3; +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +resource:path=cloudprivateipconfig +// CloudPrivateIPConfigList is the list of CloudPrivateIPConfigList. +message CloudPrivateIPConfigList { + optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + + // List of CloudPrivateIPConfig. + repeated CloudPrivateIPConfig items = 2; +} + +// CloudPrivateIPConfigSpec consists of a node name which the private IP should be assigned to. +// +k8s:openapi-gen=true +message CloudPrivateIPConfigSpec { + // node is the node name, as specified by the Kubernetes field: node.metadata.name + // +kubebuilder:validation:Optional + // +optional + optional string node = 1; +} + +// CloudPrivateIPConfigStatus specifies the node assignment together with its assignment condition. +// +k8s:openapi-gen=true +message CloudPrivateIPConfigStatus { + // node is the node name, as specified by the Kubernetes field: node.metadata.name + // +kubebuilder:validation:Optional + // +optional + optional string node = 1; + + // condition is the assignment condition of the private IP and its status + // +kubebuilder:validation:Required + // +required + repeated k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 2; +} + diff --git a/vendor/github.com/openshift/api/cloudnetwork/v1/register.go b/vendor/github.com/openshift/api/cloudnetwork/v1/register.go new file mode 100644 index 0000000000..28eaf0d810 --- /dev/null +++ b/vendor/github.com/openshift/api/cloudnetwork/v1/register.go @@ -0,0 +1,32 @@ +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +var ( + GroupName = "cloud.network.openshift.io" + SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"} + SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) + Install = SchemeBuilder.AddToScheme + // AddToScheme exists solely to keep the old generators creating valid code + // DEPRECATED + AddToScheme = SchemeBuilder.AddToScheme +) + +// Resource takes an unqualified resource and returns a Group qualified GroupResource +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +// Adds the list of known types to api.Scheme. +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, + &CloudPrivateIPConfig{}, + &CloudPrivateIPConfigList{}, + ) + metav1.AddToGroupVersion(scheme, SchemeGroupVersion) + return nil +} diff --git a/vendor/github.com/openshift/api/cloudnetwork/v1/types.go b/vendor/github.com/openshift/api/cloudnetwork/v1/types.go new file mode 100644 index 0000000000..3f899f5598 --- /dev/null +++ b/vendor/github.com/openshift/api/cloudnetwork/v1/types.go @@ -0,0 +1,80 @@ +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// CloudPrivateIPConfig performs an assignment of a private IP address to the +// primary NIC associated with cloud VMs. This is done by specifying the IP and +// Kubernetes node which the IP should be assigned to. This CRD is intended to +// be used by the network plugin which manages the cluster network. The spec +// side represents the desired state requested by the network plugin, and the +// status side represents the current state that this CRD's controller has +// executed. No users will have permission to modify it, and if a cluster-admin +// decides to edit it for some reason, their changes will be overwritten the +// next time the network plugin reconciles the object. Note: the CR's name +// must specify the requested private IP address (can be IPv4 or IPv6). +// +genclient +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:resource:path=cloudprivateipconfig,scope=Cluster +type CloudPrivateIPConfig struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + // spec is the definition of the desired private IP request. + // +kubebuilder:validation:Required + // +required + Spec CloudPrivateIPConfigSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"` + // status is the observed status of the desired private IP request. Read-only. + // +kubebuilder:validation:Optional + // +optional + Status CloudPrivateIPConfigStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` +} + +// CloudPrivateIPConfigSpec consists of a node name which the private IP should be assigned to. +// +k8s:openapi-gen=true +type CloudPrivateIPConfigSpec struct { + // node is the node name, as specified by the Kubernetes field: node.metadata.name + // +kubebuilder:validation:Optional + // +optional + Node string `json:"node" protobuf:"bytes,1,opt,name=node"` +} + +// CloudPrivateIPConfigStatus specifies the node assignment together with its assignment condition. +// +k8s:openapi-gen=true +type CloudPrivateIPConfigStatus struct { + // node is the node name, as specified by the Kubernetes field: node.metadata.name + // +kubebuilder:validation:Optional + // +optional + Node string `json:"node" protobuf:"bytes,1,opt,name=node"` + // condition is the assignment condition of the private IP and its status + // +kubebuilder:validation:Required + // +required + Conditions []metav1.Condition `json:"conditions" protobuf:"bytes,2,rep,name=conditions"` +} + +// CloudPrivateIPConfigConditionType specifies the current condition type of the CloudPrivateIPConfig +type CloudPrivateIPConfigConditionType string + +const ( + // Assigned is the condition type of the cloud private IP request. + // It is paired with the following ConditionStatus: + // - True - in the case of a successful assignment + // - False - in the case of a failed assignment + // - Unknown - in the case of a pending assignment + Assigned CloudPrivateIPConfigConditionType = "Assigned" +) + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +resource:path=cloudprivateipconfig +// CloudPrivateIPConfigList is the list of CloudPrivateIPConfigList. +type CloudPrivateIPConfigList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // List of CloudPrivateIPConfig. + Items []CloudPrivateIPConfig `json:"items" protobuf:"bytes,2,rep,name=items"` +} diff --git a/vendor/github.com/openshift/api/cloudnetwork/v1/zz_generated.deepcopy.go b/vendor/github.com/openshift/api/cloudnetwork/v1/zz_generated.deepcopy.go new file mode 100644 index 0000000000..dc791b0fb2 --- /dev/null +++ b/vendor/github.com/openshift/api/cloudnetwork/v1/zz_generated.deepcopy.go @@ -0,0 +1,110 @@ +// +build !ignore_autogenerated + +// Code generated by deepcopy-gen. DO NOT EDIT. + +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CloudPrivateIPConfig) DeepCopyInto(out *CloudPrivateIPConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudPrivateIPConfig. +func (in *CloudPrivateIPConfig) DeepCopy() *CloudPrivateIPConfig { + if in == nil { + return nil + } + out := new(CloudPrivateIPConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *CloudPrivateIPConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CloudPrivateIPConfigList) DeepCopyInto(out *CloudPrivateIPConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]CloudPrivateIPConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudPrivateIPConfigList. +func (in *CloudPrivateIPConfigList) DeepCopy() *CloudPrivateIPConfigList { + if in == nil { + return nil + } + out := new(CloudPrivateIPConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *CloudPrivateIPConfigList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CloudPrivateIPConfigSpec) DeepCopyInto(out *CloudPrivateIPConfigSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudPrivateIPConfigSpec. +func (in *CloudPrivateIPConfigSpec) DeepCopy() *CloudPrivateIPConfigSpec { + if in == nil { + return nil + } + out := new(CloudPrivateIPConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CloudPrivateIPConfigStatus) DeepCopyInto(out *CloudPrivateIPConfigStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]metav1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudPrivateIPConfigStatus. +func (in *CloudPrivateIPConfigStatus) DeepCopy() *CloudPrivateIPConfigStatus { + if in == nil { + return nil + } + out := new(CloudPrivateIPConfigStatus) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/github.com/openshift/api/cloudnetwork/v1/zz_generated.swagger_doc_generated.go b/vendor/github.com/openshift/api/cloudnetwork/v1/zz_generated.swagger_doc_generated.go new file mode 100644 index 0000000000..849e579efe --- /dev/null +++ b/vendor/github.com/openshift/api/cloudnetwork/v1/zz_generated.swagger_doc_generated.go @@ -0,0 +1,52 @@ +package v1 + +// This file contains a collection of methods that can be used from go-restful to +// generate Swagger API documentation for its models. Please read this PR for more +// information on the implementation: https://github.com/emicklei/go-restful/pull/215 +// +// TODOs are ignored from the parser (e.g. TODO(andronat):... || TODO:...) if and only if +// they are on one line! For multiple line or blocks that you want to ignore use ---. +// Any context after a --- is ignored. +// +// Those methods can be generated by using hack/update-swagger-docs.sh + +// AUTO-GENERATED FUNCTIONS START HERE +var map_CloudPrivateIPConfig = map[string]string{ + "": "CloudPrivateIPConfig performs an assignment of a private IP address to the primary NIC associated with cloud VMs. This is done by specifying the IP and Kubernetes node which the IP should be assigned to. This CRD is intended to be used by the network plugin which manages the cluster network. The spec side represents the desired state requested by the network plugin, and the status side represents the current state that this CRD's controller has executed. No users will have permission to modify it, and if a cluster-admin decides to edit it for some reason, their changes will be overwritten the next time the network plugin reconciles the object. Note: the CR's name must specify the requested private IP address (can be IPv4 or IPv6).", + "spec": "spec is the definition of the desired private IP request.", + "status": "status is the observed status of the desired private IP request. Read-only.", +} + +func (CloudPrivateIPConfig) SwaggerDoc() map[string]string { + return map_CloudPrivateIPConfig +} + +var map_CloudPrivateIPConfigList = map[string]string{ + "": "CloudPrivateIPConfigList is the list of CloudPrivateIPConfigList.", + "items": "List of CloudPrivateIPConfig.", +} + +func (CloudPrivateIPConfigList) SwaggerDoc() map[string]string { + return map_CloudPrivateIPConfigList +} + +var map_CloudPrivateIPConfigSpec = map[string]string{ + "": "CloudPrivateIPConfigSpec consists of a node name which the private IP should be assigned to.", + "node": "node is the node name, as specified by the Kubernetes field: node.metadata.name", +} + +func (CloudPrivateIPConfigSpec) SwaggerDoc() map[string]string { + return map_CloudPrivateIPConfigSpec +} + +var map_CloudPrivateIPConfigStatus = map[string]string{ + "": "CloudPrivateIPConfigStatus specifies the node assignment together with its assignment condition.", + "node": "node is the node name, as specified by the Kubernetes field: node.metadata.name", + "conditions": "condition is the assignment condition of the private IP and its status", +} + +func (CloudPrivateIPConfigStatus) SwaggerDoc() map[string]string { + return map_CloudPrivateIPConfigStatus +} + +// AUTO-GENERATED FUNCTIONS END HERE diff --git a/vendor/github.com/openshift/api/config/v1/0000_10_config-operator_01_network.crd.yaml b/vendor/github.com/openshift/api/config/v1/0000_10_config-operator_01_network.crd.yaml index 7390943a12..8d5c193efe 100644 --- a/vendor/github.com/openshift/api/config/v1/0000_10_config-operator_01_network.crd.yaml +++ b/vendor/github.com/openshift/api/config/v1/0000_10_config-operator_01_network.crd.yaml @@ -144,6 +144,17 @@ spec: clusterNetworkMTU: description: ClusterNetworkMTU is the MTU for inter-pod networking. type: integer + migration: + description: Migration contains the cluster network migration configuration. + type: object + properties: + networkType: + description: 'NetworkType is the target plugin that is to be deployed. + Currently supported values are: OpenShiftSDN, OVNKubernetes' + type: string + enum: + - OpenShiftSDN + - OVNKubernetes networkType: description: NetworkType is the plugin that is deployed (e.g. OpenShiftSDN). type: string diff --git a/vendor/github.com/openshift/api/config/v1/types_feature.go b/vendor/github.com/openshift/api/config/v1/types_feature.go index e4ee3d19f3..b083e6d1f6 100644 --- a/vendor/github.com/openshift/api/config/v1/types_feature.go +++ b/vendor/github.com/openshift/api/config/v1/types_feature.go @@ -106,8 +106,10 @@ var FeatureSets = map[FeatureSet]*FeatureGateEnabledDisabled{ Disabled: []string{}, }, TechPreviewNoUpgrade: newDefaultFeatures(). - with("CSIDriverAzureDisk"). // sig-storage, jsafrane - with("CSIDriverVSphere"). // sig-storage, jsafrane + with("CSIDriverAzureDisk"). // sig-storage, jsafrane, OCP specific + with("CSIDriverVSphere"). // sig-storage, jsafrane, OCP specific + with("CSIMigrationAWS"). // sig-storage, jsafrane, Kubernetes feature gate + with("CSIMigrationOpenStack"). // sig-storage, jsafrane, Kubernetes feature gate toFeatures(), LatencySensitive: newDefaultFeatures(). with( diff --git a/vendor/github.com/openshift/api/config/v1/types_network.go b/vendor/github.com/openshift/api/config/v1/types_network.go index 257b54b08d..ebfdf01626 100644 --- a/vendor/github.com/openshift/api/config/v1/types_network.go +++ b/vendor/github.com/openshift/api/config/v1/types_network.go @@ -76,6 +76,9 @@ type NetworkStatus struct { // ClusterNetworkMTU is the MTU for inter-pod networking. ClusterNetworkMTU int `json:"clusterNetworkMTU,omitempty"` + + // Migration contains the cluster network migration configuration. + Migration *NetworkMigration `json:"migration,omitempty"` } // ClusterNetworkEntry is a contiguous block of IP addresses from which pod IPs @@ -131,3 +134,11 @@ type NetworkList struct { Items []Network `json:"items"` } + +// NetworkMigration represents the cluster network configuration. +type NetworkMigration struct { + // NetworkType is the target plugin that is to be deployed. + // Currently supported values are: OpenShiftSDN, OVNKubernetes + // +kubebuilder:validation:Enum={"OpenShiftSDN","OVNKubernetes"} + NetworkType string `json:"networkType"` +} diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.deepcopy.go b/vendor/github.com/openshift/api/config/v1/zz_generated.deepcopy.go index d1143545e8..e6012e04e3 100644 --- a/vendor/github.com/openshift/api/config/v1/zz_generated.deepcopy.go +++ b/vendor/github.com/openshift/api/config/v1/zz_generated.deepcopy.go @@ -2563,6 +2563,22 @@ func (in *NetworkList) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkMigration) DeepCopyInto(out *NetworkMigration) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkMigration. +func (in *NetworkMigration) DeepCopy() *NetworkMigration { + if in == nil { + return nil + } + out := new(NetworkMigration) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NetworkSpec) DeepCopyInto(out *NetworkSpec) { *out = *in @@ -2607,6 +2623,11 @@ func (in *NetworkStatus) DeepCopyInto(out *NetworkStatus) { *out = make([]string, len(*in)) copy(*out, *in) } + if in.Migration != nil { + in, out := &in.Migration, &out.Migration + *out = new(NetworkMigration) + **out = **in + } return } diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.swagger_doc_generated.go b/vendor/github.com/openshift/api/config/v1/zz_generated.swagger_doc_generated.go index ec4a37cb6c..6cc78bc37b 100644 --- a/vendor/github.com/openshift/api/config/v1/zz_generated.swagger_doc_generated.go +++ b/vendor/github.com/openshift/api/config/v1/zz_generated.swagger_doc_generated.go @@ -1087,6 +1087,15 @@ func (Network) SwaggerDoc() map[string]string { return map_Network } +var map_NetworkMigration = map[string]string{ + "": "NetworkMigration represents the cluster network configuration.", + "networkType": "NetworkType is the target plugin that is to be deployed. Currently supported values are: OpenShiftSDN, OVNKubernetes", +} + +func (NetworkMigration) SwaggerDoc() map[string]string { + return map_NetworkMigration +} + var map_NetworkSpec = map[string]string{ "": "NetworkSpec is the desired network configuration. As a general rule, this SHOULD NOT be read directly. Instead, you should consume the NetworkStatus, as it indicates the currently deployed configuration. Currently, most spec fields are immutable after installation. Please view the individual ones for further details on each.", "clusterNetwork": "IP address pool to use for pod IPs. This field is immutable after installation.", @@ -1106,6 +1115,7 @@ var map_NetworkStatus = map[string]string{ "serviceNetwork": "IP address pool for services. Currently, we only support a single entry here.", "networkType": "NetworkType is the plugin that is deployed (e.g. OpenShiftSDN).", "clusterNetworkMTU": "ClusterNetworkMTU is the MTU for inter-pod networking.", + "migration": "Migration contains the cluster network migration configuration.", } func (NetworkStatus) SwaggerDoc() map[string]string { diff --git a/vendor/github.com/openshift/api/install.go b/vendor/github.com/openshift/api/install.go index 9318743e71..00ec821f84 100644 --- a/vendor/github.com/openshift/api/install.go +++ b/vendor/github.com/openshift/api/install.go @@ -31,9 +31,11 @@ import ( kstoragev1beta1 "k8s.io/api/storage/v1beta1" "k8s.io/apimachinery/pkg/runtime" + "github.com/openshift/api/apiserver" "github.com/openshift/api/apps" "github.com/openshift/api/authorization" "github.com/openshift/api/build" + "github.com/openshift/api/cloudnetwork" "github.com/openshift/api/config" "github.com/openshift/api/helm" "github.com/openshift/api/image" @@ -61,6 +63,7 @@ import ( var ( schemeBuilder = runtime.NewSchemeBuilder( + apiserver.Install, apps.Install, authorization.Install, build.Install, @@ -69,6 +72,7 @@ var ( image.Install, imageregistry.Install, kubecontrolplane.Install, + cloudnetwork.Install, network.Install, networkoperator.Install, oauth.Install, diff --git a/vendor/github.com/openshift/api/operator/v1/0000_50_ingress-operator_00-ingresscontroller.crd.yaml b/vendor/github.com/openshift/api/operator/v1/0000_50_ingress-operator_00-ingresscontroller.crd.yaml index 0181f8a340..b2c13e0550 100644 --- a/vendor/github.com/openshift/api/operator/v1/0000_50_ingress-operator_00-ingresscontroller.crd.yaml +++ b/vendor/github.com/openshift/api/operator/v1/0000_50_ingress-operator_00-ingresscontroller.crd.yaml @@ -279,6 +279,25 @@ spec: required: - type type: object + httpErrorCodePages: + description: httpErrorCodePages specifies a configmap with custom + error pages. The administrator must create this configmap in the + openshift-config namespace. This configmap should have keys in the + format "error-page-.http", where is an + HTTP error code. For example, "error-page-503.http" defines an error + page for HTTP 503 responses. Currently only error pages for 503 + and 404 responses can be customized. Each value in the configmap + should be the full response, including HTTP headers. Eg- https://raw.githubusercontent.com/openshift/router/fadab45747a9b30cc3f0a4b41ad2871f95827a93/images/router/haproxy/conf/error-page-503.http + If this field is empty, the ingress controller uses the default + error pages. + properties: + name: + description: name is the metadata.name of the referenced config + map + type: string + required: + - name + type: object httpHeaders: description: "httpHeaders defines policy for HTTP headers. \n If this field is empty, the default values are used." @@ -974,6 +993,12 @@ spec: minimum: 1 type: integer type: object + unsupportedConfigOverrides: + description: unsupportedConfigOverrides allows specifying unsupported + configuration options. Its use is unsupported. + nullable: true + type: object + x-kubernetes-preserve-unknown-fields: true type: object status: description: status is the most recently observed status of the IngressController. diff --git a/vendor/github.com/openshift/api/operator/v1/0000_70_cluster-network-operator_01_crd.yaml b/vendor/github.com/openshift/api/operator/v1/0000_70_cluster-network-operator_01_crd.yaml index 2320458115..2c9c04ea8d 100644 --- a/vendor/github.com/openshift/api/operator/v1/0000_70_cluster-network-operator_01_crd.yaml +++ b/vendor/github.com/openshift/api/operator/v1/0000_70_cluster-network-operator_01_crd.yaml @@ -494,6 +494,17 @@ spec: should manage the component type: string pattern: ^(Managed|Unmanaged|Force|Removed)$ + migration: + description: migration enables and configures the cluster network + migration. Setting this to the target network type to allow changing + the default network. If unset, the operation of changing cluster + default network plugin will be rejected. + type: object + properties: + networkType: + description: networkType is the target type of network migration + The supported values are OpenShiftSDN, OVNKubernetes + type: string observedConfig: description: observedConfig holds a sparse config that controller has observed from the cluster state. It exists in spec because diff --git a/vendor/github.com/openshift/api/operator/v1/0000_70_console-operator.crd.yaml b/vendor/github.com/openshift/api/operator/v1/0000_70_console-operator.crd.yaml index a6ca9d9a9a..d640e60388 100644 --- a/vendor/github.com/openshift/api/operator/v1/0000_70_console-operator.crd.yaml +++ b/vendor/github.com/openshift/api/operator/v1/0000_70_console-operator.crd.yaml @@ -176,6 +176,17 @@ spec: type: array items: type: string + quickStarts: + description: quickStarts allows customization of available ConsoleQuickStart + resources in console. + type: object + properties: + disabled: + description: disabled is a list of ConsoleQuickStart resource + names that are not shown to users. + type: array + items: + type: string logLevel: description: "logLevel is an intent based logging for an overall component. \ It does not give fine grained control, but it is a simple way diff --git a/vendor/github.com/openshift/api/operator/v1/types_console.go b/vendor/github.com/openshift/api/operator/v1/types_console.go index e0ed656e52..866ce26faa 100644 --- a/vendor/github.com/openshift/api/operator/v1/types_console.go +++ b/vendor/github.com/openshift/api/operator/v1/types_console.go @@ -119,6 +119,10 @@ type ConsoleCustomization struct { // +kubebuilder:validation:Optional // +optional ProjectAccess ProjectAccess `json:"projectAccess,omitempty"` + // quickStarts allows customization of available ConsoleQuickStart resources in console. + // +kubebuilder:validation:Optional + // +optional + QuickStarts QuickStarts `json:"quickStarts,omitempty"` } // ProjectAccess contains options for project access roles @@ -171,6 +175,14 @@ type DeveloperConsoleCatalogCategory struct { Subcategories []DeveloperConsoleCatalogCategoryMeta `json:"subcategories,omitempty"` } +// QuickStarts allow cluster admins to customize available ConsoleQuickStart resources. +type QuickStarts struct { + // disabled is a list of ConsoleQuickStart resource names that are not shown to users. + // +kubebuilder:validation:Optional + // +optional + Disabled []string `json:"disabled,omitempty"` +} + // Brand is a specific supported brand within the console. // +kubebuilder:validation:Pattern=`^$|^(ocp|origin|okd|dedicated|online|azure)$` type Brand string diff --git a/vendor/github.com/openshift/api/operator/v1/types_ingress.go b/vendor/github.com/openshift/api/operator/v1/types_ingress.go index 4a663eaa3c..fa107ab875 100644 --- a/vendor/github.com/openshift/api/operator/v1/types_ingress.go +++ b/vendor/github.com/openshift/api/operator/v1/types_ingress.go @@ -2,6 +2,7 @@ package v1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" corev1 "k8s.io/api/core/v1" @@ -60,6 +61,17 @@ type IngressControllerSpec struct { // +optional Domain string `json:"domain,omitempty"` + // httpErrorCodePages specifies a configmap with custom error pages. + // The administrator must create this configmap in the openshift-config namespace. + // This configmap should have keys in the format "error-page-.http", + // where is an HTTP error code. + // For example, "error-page-503.http" defines an error page for HTTP 503 responses. + // Currently only error pages for 503 and 404 responses can be customized. + // Each value in the configmap should be the full response, including HTTP headers. + // Eg- https://raw.githubusercontent.com/openshift/router/fadab45747a9b30cc3f0a4b41ad2871f95827a93/images/router/haproxy/conf/error-page-503.http + // If this field is empty, the ingress controller uses the default error pages. + HttpErrorCodePages configv1.ConfigMapNameReference `json:"httpErrorCodePages,omitempty"` + // replicas is the desired number of ingress controller replicas. If unset, // defaults to 2. // @@ -187,6 +199,14 @@ type IngressControllerSpec struct { // // +optional TuningOptions IngressControllerTuningOptions `json:"tuningOptions,omitempty"` + + // unsupportedConfigOverrides allows specifying unsupported + // configuration options. Its use is unsupported. + // + // +optional + // +nullable + // +kubebuilder:pruning:PreserveUnknownFields + UnsupportedConfigOverrides runtime.RawExtension `json:"unsupportedConfigOverrides"` } // NodePlacement describes node scheduling configuration for an ingress diff --git a/vendor/github.com/openshift/api/operator/v1/types_network.go b/vendor/github.com/openshift/api/operator/v1/types_network.go index bb4e971ef7..d258773c2b 100644 --- a/vendor/github.com/openshift/api/operator/v1/types_network.go +++ b/vendor/github.com/openshift/api/operator/v1/types_network.go @@ -97,6 +97,19 @@ type NetworkSpec struct { // +optional // +kubebuilder:validation:MinProperties=1 ExportNetworkFlows *ExportNetworkFlows `json:"exportNetworkFlows,omitempty"` + + // migration enables and configures the cluster network migration. + // Setting this to the target network type to allow changing the default network. + // If unset, the operation of changing cluster default network plugin will be rejected. + // +optional + Migration *NetworkMigration `json:"migration,omitempty"` +} + +// NetworkMigration represents the cluster network configuration. +type NetworkMigration struct { + // networkType is the target type of network migration + // The supported values are OpenShiftSDN, OVNKubernetes + NetworkType NetworkType `json:"networkType"` } // ClusterNetworkEntry is a subnet from which to allocate PodIPs. A network of size diff --git a/vendor/github.com/openshift/api/operator/v1/zz_generated.deepcopy.go b/vendor/github.com/openshift/api/operator/v1/zz_generated.deepcopy.go index c4334813f2..9368a39d6d 100644 --- a/vendor/github.com/openshift/api/operator/v1/zz_generated.deepcopy.go +++ b/vendor/github.com/openshift/api/operator/v1/zz_generated.deepcopy.go @@ -656,6 +656,7 @@ func (in *ConsoleCustomization) DeepCopyInto(out *ConsoleCustomization) { out.CustomLogoFile = in.CustomLogoFile in.DeveloperCatalog.DeepCopyInto(&out.DeveloperCatalog) in.ProjectAccess.DeepCopyInto(&out.ProjectAccess) + in.QuickStarts.DeepCopyInto(&out.QuickStarts) return } @@ -1531,6 +1532,7 @@ func (in *IngressControllerLogging) DeepCopy() *IngressControllerLogging { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *IngressControllerSpec) DeepCopyInto(out *IngressControllerSpec) { *out = *in + out.HttpErrorCodePages = in.HttpErrorCodePages if in.Replicas != nil { in, out := &in.Replicas, &out.Replicas *out = new(int32) @@ -1582,6 +1584,7 @@ func (in *IngressControllerSpec) DeepCopyInto(out *IngressControllerSpec) { (*in).DeepCopyInto(*out) } out.TuningOptions = in.TuningOptions + in.UnsupportedConfigOverrides.DeepCopyInto(&out.UnsupportedConfigOverrides) return } @@ -2243,6 +2246,22 @@ func (in *NetworkList) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkMigration) DeepCopyInto(out *NetworkMigration) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkMigration. +func (in *NetworkMigration) DeepCopy() *NetworkMigration { + if in == nil { + return nil + } + out := new(NetworkMigration) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NetworkSpec) DeepCopyInto(out *NetworkSpec) { *out = *in @@ -2290,6 +2309,11 @@ func (in *NetworkSpec) DeepCopyInto(out *NetworkSpec) { *out = new(ExportNetworkFlows) (*in).DeepCopyInto(*out) } + if in.Migration != nil { + in, out := &in.Migration, &out.Migration + *out = new(NetworkMigration) + **out = **in + } return } @@ -2875,6 +2899,27 @@ func (in *ProxyConfig) DeepCopy() *ProxyConfig { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *QuickStarts) DeepCopyInto(out *QuickStarts) { + *out = *in + if in.Disabled != nil { + in, out := &in.Disabled, &out.Disabled + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QuickStarts. +func (in *QuickStarts) DeepCopy() *QuickStarts { + if in == nil { + return nil + } + out := new(QuickStarts) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *RouteAdmissionPolicy) DeepCopyInto(out *RouteAdmissionPolicy) { *out = *in diff --git a/vendor/github.com/openshift/api/operator/v1/zz_generated.swagger_doc_generated.go b/vendor/github.com/openshift/api/operator/v1/zz_generated.swagger_doc_generated.go index 6c2b218c16..59c937c743 100644 --- a/vendor/github.com/openshift/api/operator/v1/zz_generated.swagger_doc_generated.go +++ b/vendor/github.com/openshift/api/operator/v1/zz_generated.swagger_doc_generated.go @@ -205,6 +205,7 @@ var map_ConsoleCustomization = map[string]string{ "customLogoFile": "customLogoFile replaces the default OpenShift logo in the masthead and about dialog. It is a reference to a ConfigMap in the openshift-config namespace. This can be created with a command like 'oc create configmap custom-logo --from-file=/path/to/file -n openshift-config'. Image size must be less than 1 MB due to constraints on the ConfigMap size. The ConfigMap key should include a file extension so that the console serves the file with the correct MIME type. Recommended logo specifications: Dimensions: Max height of 68px and max width of 200px SVG format preferred", "developerCatalog": "developerCatalog allows to configure the shown developer catalog categories.", "projectAccess": "projectAccess allows customizing the available list of ClusterRoles in the Developer perspective Project access page which can be used by a project admin to specify roles to other users and restrict access within the project. If set, the list will replace the default ClusterRole options.", + "quickStarts": "quickStarts allows customization of available ConsoleQuickStart resources in console.", } func (ConsoleCustomization) SwaggerDoc() map[string]string { @@ -278,6 +279,15 @@ func (ProjectAccess) SwaggerDoc() map[string]string { return map_ProjectAccess } +var map_QuickStarts = map[string]string{ + "": "QuickStarts allow cluster admins to customize available ConsoleQuickStart resources.", + "disabled": "disabled is a list of ConsoleQuickStart resource names that are not shown to users.", +} + +func (QuickStarts) SwaggerDoc() map[string]string { + return map_QuickStarts +} + var map_StatuspageProvider = map[string]string{ "": "StatuspageProvider provides identity for statuspage account.", "pageID": "pageID is the unique ID assigned by Statuspage for your page. This must be a public page.", @@ -610,6 +620,7 @@ func (IngressControllerLogging) SwaggerDoc() map[string]string { var map_IngressControllerSpec = map[string]string{ "": "IngressControllerSpec is the specification of the desired behavior of the IngressController.", "domain": "domain is a DNS name serviced by the ingress controller and is used to configure multiple features:\n\n* For the LoadBalancerService endpoint publishing strategy, domain is\n used to configure DNS records. See endpointPublishingStrategy.\n\n* When using a generated default certificate, the certificate will be valid\n for domain and its subdomains. See defaultCertificate.\n\n* The value is published to individual Route statuses so that end-users\n know where to target external DNS records.\n\ndomain must be unique among all IngressControllers, and cannot be updated.\n\nIf empty, defaults to ingress.config.openshift.io/cluster .spec.domain.", + "httpErrorCodePages": "httpErrorCodePages specifies a configmap with custom error pages. The administrator must create this configmap in the openshift-config namespace. This configmap should have keys in the format \"error-page-.http\", where is an HTTP error code. For example, \"error-page-503.http\" defines an error page for HTTP 503 responses. Currently only error pages for 503 and 404 responses can be customized. Each value in the configmap should be the full response, including HTTP headers. Eg- https://raw.githubusercontent.com/openshift/router/fadab45747a9b30cc3f0a4b41ad2871f95827a93/images/router/haproxy/conf/error-page-503.http If this field is empty, the ingress controller uses the default error pages.", "replicas": "replicas is the desired number of ingress controller replicas. If unset, defaults to 2.", "endpointPublishingStrategy": "endpointPublishingStrategy is used to publish the ingress controller endpoints to other networks, enable load balancer integrations, etc.\n\nIf unset, the default is based on infrastructure.config.openshift.io/cluster .status.platform:\n\n AWS: LoadBalancerService (with External scope)\n Azure: LoadBalancerService (with External scope)\n GCP: LoadBalancerService (with External scope)\n IBMCloud: LoadBalancerService (with External scope)\n Libvirt: HostNetwork\n\nAny other platform types (including None) default to HostNetwork.\n\nendpointPublishingStrategy cannot be updated.", "defaultCertificate": "defaultCertificate is a reference to a secret containing the default certificate served by the ingress controller. When Routes don't specify their own certificate, defaultCertificate is used.\n\nThe secret must contain the following keys and data:\n\n tls.crt: certificate file contents\n tls.key: key file contents\n\nIf unset, a wildcard certificate is automatically generated and used. The certificate is valid for the ingress controller domain (and subdomains) and the generated certificate's CA will be automatically integrated with the cluster's trust store.\n\nIf a wildcard certificate is used and shared by multiple HTTP/2 enabled routes (which implies ALPN) then clients (i.e., notably browsers) are at liberty to reuse open connections. This means a client can reuse a connection to another route and that is likely to fail. This behaviour is generally known as connection coalescing.\n\nThe in-use certificate (whether generated or user-specified) will be automatically integrated with OpenShift's built-in OAuth server.", @@ -621,6 +632,7 @@ var map_IngressControllerSpec = map[string]string{ "logging": "logging defines parameters for what should be logged where. If this field is empty, operational logs are enabled but access logs are disabled.", "httpHeaders": "httpHeaders defines policy for HTTP headers.\n\nIf this field is empty, the default values are used.", "tuningOptions": "tuningOptions defines parameters for adjusting the performance of ingress controller pods. All fields are optional and will use their respective defaults if not set. See specific tuningOptions fields for more details.\n\nSetting fields within tuningOptions is generally not recommended. The default values are suitable for most configurations.", + "unsupportedConfigOverrides": "unsupportedConfigOverrides allows specifying unsupported configuration options. Its use is unsupported.", } func (IngressControllerSpec) SwaggerDoc() map[string]string { @@ -898,6 +910,15 @@ func (NetworkList) SwaggerDoc() map[string]string { return map_NetworkList } +var map_NetworkMigration = map[string]string{ + "": "NetworkMigration represents the cluster network configuration.", + "networkType": "networkType is the target type of network migration The supported values are OpenShiftSDN, OVNKubernetes", +} + +func (NetworkMigration) SwaggerDoc() map[string]string { + return map_NetworkMigration +} + var map_NetworkSpec = map[string]string{ "": "NetworkSpec is the top-level network configuration object.", "clusterNetwork": "clusterNetwork is the IP address pool to use for pod IPs. Some network providers, e.g. OpenShift SDN, support multiple ClusterNetworks. Others only support one. This is equivalent to the cluster-cidr.", @@ -910,6 +931,7 @@ var map_NetworkSpec = map[string]string{ "disableNetworkDiagnostics": "disableNetworkDiagnostics specifies whether or not PodNetworkConnectivityCheck CRs from a test pod to every node, apiserver and LB should be disabled or not. If unset, this property defaults to 'false' and network diagnostics is enabled. Setting this to 'true' would reduce the additional load of the pods performing the checks.", "kubeProxyConfig": "kubeProxyConfig lets us configure desired proxy configuration. If not specified, sensible defaults will be chosen by OpenShift directly. Not consumed by all network providers - currently only openshift-sdn.", "exportNetworkFlows": "exportNetworkFlows enables and configures the export of network flow metadata from the pod network by using protocols NetFlow, SFlow or IPFIX. Currently only supported on OVN-Kubernetes plugin. If unset, flows will not be exported to any collector.", + "migration": "migration enables and configures the cluster network migration. Setting this to the target network type to allow changing the default network. If unset, the operation of changing cluster default network plugin will be rejected.", } func (NetworkSpec) SwaggerDoc() map[string]string { diff --git a/vendor/github.com/openshift/api/route/v1/types.go b/vendor/github.com/openshift/api/route/v1/types.go index af3e3a6ad1..0931bdecc7 100644 --- a/vendor/github.com/openshift/api/route/v1/types.go +++ b/vendor/github.com/openshift/api/route/v1/types.go @@ -303,3 +303,11 @@ const ( // needs to use routes with invalid hosts. AllowNonDNSCompliantHostAnnotation = "route.openshift.io/allow-non-dns-compliant-host" ) + +// Ingress-to-route controller +const ( + // IngressToRouteIngressClassControllerName is the name of the + // controller that translates ingresses into routes. This value is + // intended to be used for the spec.controller field of ingressclasses. + IngressToRouteIngressClassControllerName = "openshift.io/ingress-to-route" +) diff --git a/vendor/modules.txt b/vendor/modules.txt index d49c4ea6b0..66df6a4732 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -100,11 +100,6 @@ github.com/gophercloud/gophercloud/openstack/identity/v3/extensions/ec2tokens github.com/gophercloud/gophercloud/openstack/identity/v3/extensions/oauth1 github.com/gophercloud/gophercloud/openstack/identity/v3/tokens github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/apiversions -github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/l7policies -github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/listeners -github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/loadbalancers -github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/monitors -github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/pools github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/providers github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/attributestags github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/layer3/routers @@ -173,15 +168,19 @@ github.com/onsi/gomega/matchers/support/goraph/edge github.com/onsi/gomega/matchers/support/goraph/node github.com/onsi/gomega/matchers/support/goraph/util github.com/onsi/gomega/types -# github.com/openshift/api v0.0.0-20210402143208-92e9dab578e8 +# github.com/openshift/api v0.0.0-20210409143810-a99ffa1cac67 ## explicit github.com/openshift/api +github.com/openshift/api/apiserver +github.com/openshift/api/apiserver/v1 github.com/openshift/api/apps github.com/openshift/api/apps/v1 github.com/openshift/api/authorization github.com/openshift/api/authorization/v1 github.com/openshift/api/build github.com/openshift/api/build/v1 +github.com/openshift/api/cloudnetwork +github.com/openshift/api/cloudnetwork/v1 github.com/openshift/api/config github.com/openshift/api/config/v1 github.com/openshift/api/helm