Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

only enable aggregated api if rbac != disabled #3813

Merged
merged 2 commits into from
Sep 7, 2018

Conversation

jackfrancis
Copy link
Member

What this PR does / why we need it: Prior to this change, default configuration for RBAC and enable aggregated APIs was distinct. These default enforcements need to happen in tandem, as aggregated API functionality depends upon RBAC. So, if RBAC is disabled, we need to ensure that aggregated API functionality is not by-default enabled.

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #

Special notes for your reviewer:

If applicable:

  • documentation
  • unit tests
  • tested backward compatibility (ie. deploy with previous version, upgrade with this branch)

Release note:

only enable aggregated api if rbac != disabled

@ghost ghost assigned jackfrancis Sep 7, 2018
@ghost ghost added in progress and removed approved labels Sep 7, 2018
@acs-bot acs-bot added the size/M label Sep 7, 2018
@jackfrancis
Copy link
Member Author

Fixes a regression introduced in this PR:

#3751

@@ -137,15 +137,15 @@ func (cli *CLIProvisioner) provision() error {

c, err := config.ParseConfig()
if err != nil {
return errors.New("unable to parse base config")
return errors.Wrap(err, "unable to parse base config")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By not wrapping the errors they were not being bubbled up and exposed in our E2E runs (which is why it took 10 days to find this).

@@ -59,6 +59,14 @@ func IsTrueBoolPointer(b *bool) bool {
return false
}

// IsFalseBoolPointer is a simple boolean helper function for boolean pointers
func IsFalseBoolPointer(b *bool) bool {
Copy link
Contributor

@tariq1890 tariq1890 Sep 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: Do you think IsFalse would suffice as there being a bool pointer as the argument is already suggestive?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because we already have lots of places using IsTrueBoolPointer it makes the most sense to keep the same naming pattern.

@codecov
Copy link

codecov bot commented Sep 7, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@849e5fd). Click here to learn what that means.
The diff coverage is 55.55%.

@@            Coverage Diff            @@
##             master    #3813   +/-   ##
=========================================
  Coverage          ?   55.63%           
=========================================
  Files             ?      109           
  Lines             ?    16251           
  Branches          ?        0           
=========================================
  Hits              ?     9042           
  Misses            ?     6424           
  Partials          ?      785

@@ -703,7 +703,7 @@ var _ = Describe("Azure Container Cluster using the Kubernetes Orchestrator", fu
})

It("should be able to autoscale", func() {
if eng.HasLinuxAgents() {
if eng.HasLinuxAgents() && eng.ExpandedDefinition.Properties.OrchestratorProfile.KubernetesConfig.EnableAggregatedAPIs {
Copy link
Member Author

@jackfrancis jackfrancis Sep 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HPA implementation uses metrics-server, which requires aggregated api

See:

https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/

Copy link
Contributor

@CecileRobertMichon CecileRobertMichon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@acs-bot
Copy link

acs-bot commented Sep 7, 2018

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: CecileRobertMichon, jackfrancis

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [CecileRobertMichon,jackfrancis]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants