Skip to content
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

Removing rbacProvider from pkg contoller.go file #82

Open
wants to merge 92 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 89 commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
d95eaf0
Removing rbacProvider from pkg contoller.go file
Aug 5, 2024
22eeb06
Removing the dependencies
Aug 5, 2024
75b44a6
Added toolchain go1.22.4
Aug 5, 2024
3632868
changed go version to go 1.22
Aug 5, 2024
b504b03
Added go toolchain go1.22.4
Aug 5, 2024
614162f
updated go version
Aug 5, 2024
64366bc
Removed rbac v1 and updated pkg, controller.go file
Aug 7, 2024
b245403
Changed go version to go 1.22 and added toolchain
Aug 7, 2024
c6bec6a
Removed toolchain
Aug 7, 2024
ce79c8f
Upgraded the package for github.com/stretchr/testif
Aug 7, 2024
57b3e76
Adding github.com/stretchr/objx package
Aug 7, 2024
cdcfb81
Fixing github.com/stretchr/testify package
Aug 7, 2024
0cd474f
Adding github.com/google/go-cmp package
Aug 7, 2024
1d841de
Updating go version with go 1.22.0
Aug 8, 2024
13d7053
Adding go toolchain
Aug 8, 2024
c19075c
Updated go toolchain go1.22.0
Aug 8, 2024
f930db2
Removed go toolchain
Aug 8, 2024
4472e4f
Updated go version locally
Aug 8, 2024
a851aae
Fixed package version of golang.org/x/net
Aug 8, 2024
0065f77
Fixed package golang.org/x/crypto version
Aug 8, 2024
a03ce7c
udpated package golang.org/x/net
Aug 8, 2024
33cb9b9
updated package golang.org/x/sys
Aug 8, 2024
b2b484b
udpated package golang.org/x/sys
Aug 8, 2024
dc49e0a
Added go toolchain go1.22.2
Aug 9, 2024
2900b4c
t
Aug 9, 2024
a0249bb
Updated kubernetes version to 1.21 and removed go mod init
Aug 9, 2024
142f9d9
commented out integration-tests to check the build status
Aug 9, 2024
50f5f26
Updated go version in go.mod file in integration directory
Aug 12, 2024
da96f01
Updated integration-tests steps in screwdriver
Aug 12, 2024
7e89580
Made code changes related t v1alpha1 under test/integration directory
Aug 15, 2024
bfa368c
Removed resources in rbac/v1alpha1 package
Aug 16, 2024
0d3eee5
fixed gofmt
Aug 19, 2024
57c0f01
reverted back go.mod file in test/integration directory
Aug 19, 2024
babe7ec
Reverting the main go.mod and go.sum files"
Aug 20, 2024
8a4ebf1
Reverted changes in screwdriver.yaml file
Aug 20, 2024
5c3029d
Removed unused package from fixtures/fixtures.go
Aug 20, 2024
74496e8
Adding authz_v1_test.go file to check the build failure
Aug 20, 2024
57b0866
Added new line
Aug 20, 2024
2a0b46b
Added missing variables
Aug 21, 2024
5b44e30
removed rbac/v1alpha1 package from onboarding_test.go
Aug 21, 2024
946b29f
Removed code that was dependent on the rbac/v1alpha1 package in onboa…
Aug 21, 2024
e543f63
increased timeout(cluster rbac config to be created) for rolloutAndVa…
Aug 21, 2024
bdd1183
Removed the code to debugging the issue
Aug 21, 2024
df275b9
removed the unused the package
Aug 21, 2024
99f362d
Removed v1alpha1 package from onboarding_test.go file
Aug 22, 2024
619bf5c
Removed unused packages like time and wait
Aug 22, 2024
544ab22
Removed IstioClientset package from TestDeleteCRCIfServiceExists func…
Aug 22, 2024
fc0c2c0
Removed more unused packages
Aug 22, 2024
b48648e
Cleanedup onboarding_test.go file
Aug 22, 2024
7140bfc
Removed pkg/controller
UdayMadhav88 Sep 4, 2024
5d5be49
Removed istio/onboarding files
UdayMadhav88 Sep 4, 2024
719340f
Removed istio/processor files
UdayMadhav88 Sep 4, 2024
3b386a3
Removed pkg/controller file
UdayMadhav88 Sep 4, 2024
d8cbfd4
Removed onboarding_test.go file
UdayMadhav88 Sep 4, 2024
1a57e97
Cleanedup unused packages
UdayMadhav88 Sep 4, 2024
6ba274f
Cleanup unused packages
UdayMadhav88 Sep 5, 2024
f2525e2
Reverting controller in framework.go file
UdayMadhav88 Sep 5, 2024
c0eaeb7
Removed conttoller package from framework.go file
UdayMadhav88 Sep 5, 2024
c251400
Updated the framework.go file by adding authzController
UdayMadhav88 Sep 6, 2024
4491ec9
Fixed the istioClient package Mismatch issue
UdayMadhav88 Sep 6, 2024
738009a
Fixed the authzpolicy Controller parameters
UdayMadhav88 Sep 6, 2024
a5aaafc
Fixing the frmework.go file by modifying Setup function
UdayMadhav88 Sep 6, 2024
75409ee
Defined config variable in Setup()
UdayMadhav88 Sep 6, 2024
ba047b8
Adding condition for kubeconfig to check if its empty
UdayMadhav88 Sep 6, 2024
0e7d64b
Reverting istioCLient value
UdayMadhav88 Sep 6, 2024
bfc7c82
Modified git clone step in integration-tests
UdayMadhav88 Sep 6, 2024
ecab9ae
Cleanedup framework.go file by removing unwanted variables
UdayMadhav88 Sep 7, 2024
f416419
Removed kubeconfig and dnsSuffix variables from framework.go file
UdayMadhav88 Sep 7, 2024
8705169
Modified versionedclient value from config to restConfig
UdayMadhav88 Sep 7, 2024
7639b15
removed the IstioRbacV1Alpha1Servicerolebinding and IstioRbacV1Alpha1…
UdayMadhav88 Sep 10, 2024
1a207ae
Removed the dereferencing from the variable enableOriginJwtSubject
UdayMadhav88 Sep 10, 2024
cee3a31
Added logs to componentsEnabledAuthzPolicy
UdayMadhav88 Sep 10, 2024
c8ec453
Fixed undefined err
UdayMadhav88 Sep 10, 2024
d204c25
defined authzPolicyEnabledList variable
UdayMadhav88 Sep 10, 2024
f53664c
defined error in Setup()
UdayMadhav88 Sep 10, 2024
9ccf3bf
Reverted componentsEnabledAuthzPolicy value
UdayMadhav88 Sep 10, 2024
872893e
Formatted the Framework.go file
UdayMadhav88 Sep 10, 2024
4c6db29
Increased apResyncInterval to 30 seconds
UdayMadhav88 Sep 10, 2024
100cdcd
Adding configStoreCache
UdayMadhav88 Sep 11, 2024
ab315df
Chnaged the apResyncInterval to minute
UdayMadhav88 Sep 11, 2024
ee1925f
Removed pkg/controller
UdayMadhav88 Sep 13, 2024
61aeae0
Updated the authorizaionPolicy controller
UdayMadhav88 Sep 12, 2024
c8f7030
Removed standalone usage from authorizationPolicy controller_test.go …
UdayMadhav88 Sep 12, 2024
82ef3c0
Updated authorizationPolicy controller_test.go file
UdayMadhav88 Sep 12, 2024
8e4f3da
Reverted github directory
UdayMadhav88 Sep 13, 2024
67082fb
Removed idea directory
UdayMadhav88 Sep 13, 2024
c2560f8
reverted the unwanted changes in bug_repost.md
UdayMadhav88 Sep 13, 2024
2da905a
Removed un wanted lines
UdayMadhav88 Sep 13, 2024
41054ab
Restored files
UdayMadhav88 Sep 13, 2024
c4851cb
Signed commit with SSH key
UdayMadhav88 Sep 16, 2024
8f98099
Added GPG key for all commits
UdayMadhav88 Sep 17, 2024
8380b78
Fixed the gfmt issue in authz_v2_test
UdayMadhav88 Sep 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 9 additions & 32 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"syscall"
"time"

"github.com/yahoo/k8s-athenz-istio-auth/pkg/controller"
authzpolicy "github.com/yahoo/k8s-athenz-istio-auth/pkg/istio/authorizationpolicy"
adInformer "github.com/yahoo/k8s-athenz-syncer/pkg/client/informers/externalversions/athenz/v1"
v1 "k8s.io/api/core/v1"
Expand All @@ -37,8 +36,6 @@ import (
func main() {
dnsSuffix := flag.String("dns-suffix", "svc.cluster.local", "dns suffix used for service role target services")
kubeconfig := flag.String("kubeconfig", "", "(optional) absolute path to the kubeconfig file")
adResyncIntervalRaw := flag.String("ad-resync-interval", "1h", "athenz domain resync interval")
crcResyncIntervalRaw := flag.String("crc-resync-interval", "1h", "cluster rbac config resync interval")
apResyncIntervalRaw := flag.String("ap-resync-interval", "1h", "authorization policy resync interval")
enableOriginJwtSubject := flag.Bool("enable-origin-jwt-subject", true, "enable adding origin jwt subject to service role binding")
logFile := flag.String("log-file", "/var/log/k8s-athenz-istio-auth/k8s-athenz-istio-auth.log", "log file location")
Expand All @@ -47,7 +44,6 @@ func main() {
authzPolicyEnabledList := flag.String("ap-enabled-list", "", "List of namespace/service that enabled authz policy, "+
"use format 'example-ns1/example-service1' to enable a single service, use format 'example-ns2/*' to enable all services in a namespace, and use '*' to enable all services in the cluster' ")
combinationPolicyTag := flag.String("combo-policy-tag", "proxy-principals", "key of tag for proxy principals list")
authPolicyControllerOnlyMode := flag.Bool("auth-policy-only-mode", false, "only run authzpolicy controller")
enableSpiffeTrustDomain := flag.Bool("enable-spiffe-trust-domain", true, "Allow new SPIFFE ID's")
adminDomain := flag.String("admin-domain", "", "admin domain")
systemNamespaces := flag.String("system-namespaces", "istio-system,kube-system", "list of cluster system namespaces")
Expand Down Expand Up @@ -89,11 +85,8 @@ func main() {
}
}
var configDescriptor collection.Schemas
if *authPolicyControllerOnlyMode {
configDescriptor = collection.SchemasFor(collections.IstioSecurityV1Beta1Authorizationpolicies)
} else {
configDescriptor = collection.SchemasFor(collections.IstioRbacV1Alpha1Serviceroles, collections.IstioRbacV1Alpha1Clusterrbacconfigs, collections.IstioRbacV1Alpha1Servicerolebindings, collections.IstioSecurityV1Beta1Authorizationpolicies)
}
configDescriptor = collection.SchemasFor(collections.IstioSecurityV1Beta1Authorizationpolicies)

// If kubeconfig arg is not passed-in, try user $HOME config only if it exists
if *kubeconfig == "" {
home := filepath.Join(homedir.HomeDir(), ".kube", "config")
Expand Down Expand Up @@ -126,16 +119,6 @@ func main() {

istioClientSet, err := versionedclient.NewForConfig(config)

adResyncInterval, err := time.ParseDuration(*adResyncIntervalRaw)
if err != nil {
log.Panicf("Error parsing ad-resync-interval duration: %s", err.Error())
}

crcResyncInterval, err := time.ParseDuration(*crcResyncIntervalRaw)
if err != nil {
log.Panicf("Error parsing crc-resync-interval duration: %s", err.Error())
}

apResyncInterval, err := time.ParseDuration(*apResyncIntervalRaw)
if err != nil {
log.Panicf("Error parsing ap-resync-interval duration: %s", err.Error())
Expand Down Expand Up @@ -167,19 +150,13 @@ func main() {
for _, domain := range strings.Split(*adminDomain, ",") {
adminDomains = append(adminDomains, strings.TrimSpace(domain))
}
if *authPolicyControllerOnlyMode {
configStoreCache := crdController.NewController(istioClient, istioController.Options{})
serviceListWatch := cache.NewListWatchFromClient(k8sClient.CoreV1().RESTClient(), "services", v1.NamespaceAll, fields.Everything())
serviceIndexInformer := cache.NewSharedIndexInformer(serviceListWatch, &v1.Service{}, 0, nil)
adIndexInformer := adInformer.NewAthenzDomainInformer(adClient, 0, cache.Indexers{})

apController := authzpolicy.NewController(configStoreCache, serviceIndexInformer, adIndexInformer, istioClientSet, apResyncInterval, *enableOriginJwtSubject, componentsEnabledAuthzPolicy, *combinationPolicyTag, *authPolicyControllerOnlyMode, *enableSpiffeTrustDomain, namespaces, serviceAccountNamespaceMap, adminDomains)
configStoreCache.RegisterEventHandler(collections.IstioSecurityV1Beta1Authorizationpolicies.Resource().GroupVersionKind(), apController.EventHandler)
go apController.Run(stopCh)
} else {
c := controller.NewController(*dnsSuffix, istioClient, k8sClient, adClient, istioClientSet, adResyncInterval, crcResyncInterval, apResyncInterval, *enableOriginJwtSubject, *enableAuthzPolicyController, componentsEnabledAuthzPolicy, *combinationPolicyTag, *enableSpiffeTrustDomain, namespaces, serviceAccountNamespaceMap, adminDomains)
go c.Run(stopCh)
}
configStoreCache := crdController.NewController(istioClient, istioController.Options{})
serviceListWatch := cache.NewListWatchFromClient(k8sClient.CoreV1().RESTClient(), "services", v1.NamespaceAll, fields.Everything())
serviceIndexInformer := cache.NewSharedIndexInformer(serviceListWatch, &v1.Service{}, 0, nil)
adIndexInformer := adInformer.NewAthenzDomainInformer(adClient, 0, cache.Indexers{})

apController := authzpolicy.NewController(configStoreCache, serviceIndexInformer, adIndexInformer, istioClientSet, apResyncInterval, *enableOriginJwtSubject, componentsEnabledAuthzPolicy, *combinationPolicyTag, *enableSpiffeTrustDomain, namespaces, serviceAccountNamespaceMap, adminDomains)
go apController.Run(stopCh)

signalCh := make(chan os.Signal, 1)
signal.Notify(signalCh, syscall.SIGINT, syscall.SIGTERM)
Expand Down
290 changes: 0 additions & 290 deletions pkg/controller/controller.go

This file was deleted.

Loading