Skip to content

AzureRmKubernetes cmdlets for managed Kubernetes #5087

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 65 commits into from
Feb 5, 2018

Conversation

devigned
Copy link
Member

@devigned devigned commented Dec 6, 2017

Description


This checklist is used to make sure that common guidelines for a pull request are followed. You can find a more complete discussion of PowerShell cmdlet best practices here.

General Guidelines

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.
  • The pull request does not introduce breaking changes (unless a major version change occurs in the assembly and module).

Testing Guidelines

  • Pull request includes test coverage for the included changes.
  • PowerShell scripts used in tests should do any necessary setup as part of the test or suite setup, and should not use hard-coded values for locations or existing resources.

Cmdlet Signature Guidelines

  • New cmdlets that make changes or have side effects should implement ShouldProcess and have SupportShouldProcess=true specified in the cmdlet attribute. You can find more information on ShouldProcess here.
  • Cmdlet specifies OutputType attribute if any output is produced - if the cmdlet produces no output, it should implement a PassThru parameter.

Cmdlet Parameter Guidelines

  • Parameter types should not expose types from the management library - complex parameter types should be defined in the module.
  • Complex parameter types are discouraged - a parameter type should be simple types as often as possible. If complex types are used, they should be shallow and easily creatable from a constructor or another cmdlet.
  • Cmdlet parameter sets should be mutually exclusive - each parameter set must have at least one mandatory parameter not in other parameter sets.

@twitchax
Copy link
Contributor

twitchax commented Dec 7, 2017

Restarted the travis build: no idea why it died.

@twitchax
Copy link
Contributor

twitchax commented Dec 7, 2017

Looks like there are some errors with api version namespaces?

@maddieclayton
Copy link
Contributor

@devigned I'll assign this back to you for the moment, please reassign it to me when you're ready for me to take a look. Thanks!

PSData = @{

# Tags applied to this module. These help with module discovery in online galleries.
Tags = 'Azure','Kubernetes','ARM','Provider','AKS'
Copy link
Member

Choose a reason for hiding this comment

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

Needs the tags that indicates this runs on core (Linux, Mac) - this is the mechanism that the posh team is using to differentiate module compatible with PowerShell Core.

Copy link
Member Author

Choose a reason for hiding this comment

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

What tags would those be? As far as I can tell, AzureRM.Profile.Netcore.psd1 doesn't have any tags that jump out at me which scream netcore (Tags = 'Azure','ResourceManager','ARM','Profile','Authentication','Environment','Subscription').

RequiredModules = @(@{ModuleName = 'AzureRM.Profile'; ModuleVersion = '4.0.0'; })

# Assemblies that must be loaded prior to importing this module
RequiredAssemblies = '.\YamlDotNet.dll'
Copy link
Member

Choose a reason for hiding this comment

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

All assemblies required by the cmdlet assembly should go here, normally this includes the associated management library.

Copy link
Member Author

Choose a reason for hiding this comment

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

The generated management library is included in the command module. This will need to be removed and replaced with a reference when the SDK is produced.

PSData = @{

# Tags applied to this module. These help with module discovery in online galleries.
Tags = 'Azure','ResourceManager','ARM','AKS', 'Kubernetes'
Copy link
Member

Choose a reason for hiding this comment

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

Container?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure!

}

[Fact]
public void MergedKubeConfigOverwriteClustersTest()
Copy link
Member

Choose a reason for hiding this comment

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

Use traits to mark these as check-in tests ([Trait(Category.AcceptanceType, Category.CheckIn)] these constants are in the common scenario test assembly

$location = Get-ProviderLocation "Microsoft.ContainerService/managedClusters"

New-AzureRmResourceGroup -Name $resourceGroupName -Location $location

Copy link
Member

Choose a reason for hiding this comment

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

I am assuming this will contain a CRUD test at some point.

_dashPod = dashPod;
}

public override string StatusMessage { get; }
Copy link
Member

Choose a reason for hiding this comment

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

need to implement.

namespace Microsoft.Azure.Commands.Kubernetes
{
[Cmdlet("Stop", KubeNounStr + "Dashboard")]
public class StopDashboard : KubeCmdletBase
Copy link
Member

Choose a reason for hiding this comment

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

I don't know that we need this. If we return a job from the first cmdlet, the user can simply stop it.

Copy link
Member Author

Choose a reason for hiding this comment

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

It not needed by someone that understands powershell jobs, but it does give a simple way to kill the job if you are not adept with Jobs.

@@ -0,0 +1,3 @@
Import-Module -Name ./src/Package/Release/ResourceManager/AzureRM.Profile.Netcore/AzureRM.Profile.Netcore.psd1
Copy link
Member

Choose a reason for hiding this comment

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

??

Copy link
Member Author

Choose a reason for hiding this comment

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

This was just for testing. I'll drop it before the PR is final.

PS C:\> Stop-AzureRmKubernetes
```

{{ Add example description here }}
Copy link
Member

Choose a reason for hiding this comment

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

Please ensure that you fill these out in the markdown files.

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
Copy link
Member

Choose a reason for hiding this comment

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

I think the changes below this are unintentional, right?

@maddieclayton
Copy link
Contributor

maddieclayton commented Dec 22, 2017

@devigned Looks like you are failing because of some signature issues. If you check out the SignatureIssues.csv here you can see what is causing the failure. You can ignore severity 2 issues for the most part, but you should look through the sev 1 issues.


namespace Microsoft.Azure.Commands.Kubernetes
{
[Cmdlet(VerbsCommon.New, KubeNounStr, DefaultParameterSetName = DefaultParamSet)]
Copy link
Contributor

Choose a reason for hiding this comment

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

All action cmdlets should include supportsshouldprocess: more info here

public SwitchParameter AsJob { get; set; }

[Parameter(Mandatory = false)]
public Hashtable Tags { get; set; }
Copy link
Contributor

Choose a reason for hiding this comment

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

Rename to "Tag" (more info here)

@devigned devigned changed the title [WIP Do Not Merge] AzureRmKubernetes cmdlets for managed Kubernetes AzureRmKubernetes cmdlets for managed Kubernetes Jan 9, 2018
@devigned
Copy link
Member Author

devigned commented Jan 9, 2018

@markcowl and @maddieclayton I the PR has had most of the boulders excavated and is ready for nits and finer review. I believe I've addressed all of the feedback thus far. I think I need to clean up some signing errors, but that should be about it. Let me know if there are any other changes you'd like me to make.

@devigned devigned force-pushed the feature/aks branch 2 times, most recently from 1cbf85e to dd6e688 Compare January 9, 2018 16:44
@devigned
Copy link
Member Author

devigned commented Jan 9, 2018

@markcowl it looks like the errors in the build are caused by a project I haven't touched. Thoughts?

@maddieclayton
Copy link
Contributor

@azuresdkci Test this please

@maddieclayton
Copy link
Contributor

@devigned That's a Batch test that fails intermittently, started the build again.

@devigned
Copy link
Member Author

@markcowl I just rebased again due to another conflicting change merged.

markcowl
markcowl previously approved these changes Feb 2, 2018
<HintPath>..\..\..\packages\AutoMapper.6.2.1\lib\net45\AutoMapper.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
Copy link
Member

Choose a reason for hiding this comment

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

@twitchax it is another place we have to change it if we update the common runtime to newtonsoft.json 10, as we plan to do. If this assembly has a specific dependency on newtonsoft.json, other than in its management client, then this should be removed.

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
Copy link
Member

Choose a reason for hiding this comment

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

no need for this file

@markcowl
Copy link
Member

markcowl commented Feb 2, 2018

@markcowl markcowl removed their assignment Feb 2, 2018
@cormacpayne
Copy link
Member

@markcowl
Copy link
Member

markcowl commented Feb 3, 2018

@markcowl markcowl merged commit 6d78a52 into Azure:preview Feb 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants