Skip to content

Conversation

@matmerr
Copy link
Member

@matmerr matmerr commented Nov 11, 2021

Reason for Change:

build and deploy windows npm example

Issue Fixed:

Requirements:

Notes:

npm/npm.go Outdated
podInformer: informerFactory.Core().V1().Pods(),
nsInformer: informerFactory.Core().V1().Namespaces(),
npInformer: informerFactory.Networking().V1().NetworkPolicies(),
ipsMgr: ipsm.NewIpsetManager(exec),
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we move this out from general and put in V1 controller section ?

}

type Flags struct {
KubeConfigPath string `json:"KubeConfigPath"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any value in adding all our configmap params under flags ?

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 makes the signature for start cleaner, passing in config struct and flags struct, when we add more flags in the future

func start(config npmconfig.Config, flags npmconfig.Flags) error {

npm/cmd/main.go Outdated
)

const (
FlagVersion = "version"
Copy link
Contributor

Choose a reason for hiding this comment

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

Can these constants be lower case ?

klog.Infof("Start NPM version: %s", version)

var err error
defer func() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason to remove recover ?

Copy link
Member Author

Choose a reason for hiding this comment

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

if we have a crash we want to crash hard and bubble that up to orchestrator

npm/cmd/start.go Outdated
// Create the kubernetes client
var k8sConfig *rest.Config
if flags.KubeConfigPath == "" {
var err error
Copy link
Contributor

Choose a reason for hiding this comment

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

move this var err outside the if condition?

@@ -0,0 +1,9 @@
$cpEndpoint = Get-Content C:\k\config | ForEach-Object -Process {if($_.Contains("server:")) {$_.Trim().Split()[1]}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add some comments on what/how cpendpoint is or looks like, similarly for other fields. Have a readme.md for this logic, if possible

@matmerr
Copy link
Member Author

matmerr commented Nov 12, 2021

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@matmerr
Copy link
Member Author

matmerr commented Nov 12, 2021

add powershell.exe -command "& { . .\windows.ps1; azure-npm-image v26-windows-amd64 }"

@matmerr matmerr force-pushed the windowsnpmdaemonset branch from 223b16d to 49e971b Compare November 16, 2021 23:45
@matmerr
Copy link
Member Author

matmerr commented Nov 17, 2021

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@matmerr matmerr force-pushed the windowsnpmdaemonset branch from 2925669 to b0717d0 Compare November 17, 2021 18:59
@vakalapa
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@vakalapa
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@vakalapa
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Pull request contains merge conflicts.

npm.txt Outdated
@@ -0,0 +1,59 @@
start here
Copy link
Member Author

Choose a reason for hiding this comment

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

remove this

@matmerr
Copy link
Member Author

matmerr commented Nov 29, 2021

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@matmerr
Copy link
Member Author

matmerr commented Nov 29, 2021

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

npm/cmd/start.go Outdated
return fmt.Errorf("failed to generate clientset with cluster config: %w", err)
}

klog.Infof("received clientset %+v", clientset)
Copy link
Member Author

Choose a reason for hiding this comment

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

delete this from logs

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
kind: ClusterRoleBinding
Copy link
Contributor

@vakalapa vakalapa Dec 1, 2021

Choose a reason for hiding this comment

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

< nit > remove the space,

npm/cmd/main.go Outdated
var version string

func main() {
fmt.Println("start here")
Copy link
Contributor

Choose a reason for hiding this comment

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

we will need to remove these comments in next PR

npm/cmd/main.go Outdated
viper.AutomaticEnv()
initCommandFlags(rootCmd.Commands())
})
fmt.Println("made it here2")
Copy link
Contributor

Choose a reason for hiding this comment

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

this should be removed too.

vakalapa
vakalapa previously approved these changes Dec 1, 2021
Copy link
Contributor

@vakalapa vakalapa left a comment

Choose a reason for hiding this comment

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

lgtm just couple of comments for us to apply in next PR

@matmerr matmerr merged commit 537b11c into Azure:master Dec 2, 2021
@matmerr matmerr deleted the windowsnpmdaemonset branch December 2, 2021 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants