Skip to content

Conversation

@matmerr
Copy link
Member

@matmerr matmerr commented Oct 9, 2020

Reason for Change:

Start a long lived process to tail the azure-vnet.log and output to stdout of the installer container

Issue Fixed:

Requirements:

Notes:

@matmerr
Copy link
Member Author

matmerr commented Oct 9, 2020

/azp run

@azure-pipelines
Copy link

No pipelines are associated with this pull request.

apiVersion: apps/v1
kind: DaemonSet
metadata:
name: azure-cni-installer-agent
Copy link
Member

Choose a reason for hiding this comment

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

is it installer or manager? im fine with anything but can we follow same convention everywhere


func (i *installerConfig) SetCNIMode(cniMode string) error {
// get paths for singletenancy and multitenancy
if cniMode != "" {
Copy link
Member

Choose a reason for hiding this comment

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

one more check if ipv6mode is set, then mode can be only bridge..can;t be transparent

"gopkg.in/fsnotify.v1"
)

func follow(filename string) error {
Copy link
Member

Choose a reason for hiding this comment

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

what this package is for? can add brief comment

@matmerr
Copy link
Member Author

matmerr commented Oct 12, 2020

/azp run

@azure-pipelines
Copy link

No pipelines are associated with this pull request.

@matmerr matmerr changed the title Tail azure-vnet.logs in CNI installer Add "acn" cli tool to install and manage Azure CNI Oct 13, 2020
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.

Added a few comments. Mostly looks good.

func GenerateConflistCmd() *cobra.Command {
var cmd = &cobra.Command{
Use: "conflist",
Short: fmt.Sprintf("Retrieves the logs of %s binary", c.AzureCNIBin),
Copy link
Contributor

Choose a reason for hiding this comment

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

Not the right description i suppose ?

fmt.Printf("%+v", viper.GetBool(c.FlagFollow))
// this loop exists for when the logfile gets rotated, and tail loses the original file
for {
t, err := tail.TailFile(viper.GetString(c.FlagLogFilePath), tail.Config{Follow: viper.GetBool(c.FlagFollow)})
Copy link
Contributor

Choose a reason for hiding this comment

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

not the right func ?

)

// installCmd can register an object
func GenerateCmd() *cobra.Command {
Copy link
Contributor

Choose a reason for hiding this comment

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

Where is this Cmd being used ? Also comment on the top.

"github.com/spf13/viper"
)

// installCmd can register an object
Copy link
Contributor

Choose a reason for hiding this comment

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

Comment correction.

"github.com/spf13/cobra"
)

// installCmd can register an object
Copy link
Contributor

Choose a reason for hiding this comment

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

Comment correction.

}}

cmd.Flags().BoolP(c.FlagFollow, "f", c.DefaultToggles[c.FlagFollow], fmt.Sprintf("Follow the log file, similar to 'tail -f'"))

Copy link
Contributor

Choose a reason for hiding this comment

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

extra line

}

func InstallLocal(installerConf InstallerConfig) error {
fmt.Printf("📁 - Checking if destination bin directory (%s) exists...\n", installerConf.DstBinDir)
Copy link
Contributor

Choose a reason for hiding this comment

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

<!comment> Great idea with the emojis, are these printed in stdout or logfile ? If logfile are we sure the form exists ? If stdout, some terminals may not have support for emojis.

value: linux
- name: CNI_TYPE
value: singletenancy
- name: CNI_MODE
Copy link
Contributor

Choose a reason for hiding this comment

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

Two different naming conventions for envs in agent and master, agent has "Azure_*".

)

func SetOrUseDefault(setValue, defaultValue string) string {
if setValue == "" {
Copy link
Contributor

Choose a reason for hiding this comment

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

Check for nil too ?

@matmerr
Copy link
Member Author

matmerr commented Oct 14, 2020

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@codecov
Copy link

codecov bot commented Oct 14, 2020

Codecov Report

Merging #688 into master will decrease coverage by 0.04%.
The diff coverage is 25.00%.

@@            Coverage Diff             @@
##           master     #688      +/-   ##
==========================================
- Coverage   38.60%   38.56%   -0.05%     
==========================================
  Files          78       79       +1     
  Lines       10433    10447      +14     
==========================================
+ Hits         4028     4029       +1     
- Misses       5913     5926      +13     
  Partials      492      492              

@matmerr
Copy link
Member Author

matmerr commented Oct 15, 2020

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

return err
}

// only allow windows and linux binaries
Copy link
Contributor

Choose a reason for hiding this comment

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

Comment remove or change to //only allow Single or Multi tenancy

return err
}

// only allow windows and linux binaries
Copy link
Contributor

Choose a reason for hiding this comment

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

same as above

@matmerr matmerr dismissed tamilmani1989’s stale review October 20, 2020 20:58

Handle extra checking can be done in a seperate PR

@matmerr matmerr merged commit 7bd8a26 into Azure:master Oct 20, 2020
@matmerr matmerr deleted the cniinstaller branch October 20, 2020 21:00
matmerr added a commit that referenced this pull request Nov 12, 2020
* tail azure-vnet.logs

* dockerfile update

* installer fixes

* remove external deps

* move to cli design

* manager cmd

* update vendor

* minor fixes

* logs

* update makefile

* Update manager-master.yaml

* Update manager-agent.yaml
matmerr added a commit that referenced this pull request Nov 12, 2020
* tail azure-vnet.logs

* dockerfile update

* installer fixes

* remove external deps

* move to cli design

* manager cmd

* update vendor

* minor fixes

* logs

* update makefile

* Update manager-master.yaml

* Update manager-agent.yaml
neaggarwMS pushed a commit to neaggarwMS/azure-container-networking that referenced this pull request Nov 13, 2020
* tail azure-vnet.logs

* dockerfile update

* installer fixes

* remove external deps

* move to cli design

* manager cmd

* update vendor

* minor fixes

* logs

* update makefile

* Update manager-master.yaml

* Update manager-agent.yaml
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.

3 participants